
For your Travel & Hotel needs
|
 |
Please Visit
|
|
|
|
|
For your real estate needs,
|
 |
Please Visit
|
|
|
|
|
|
| Careers
require_once('connect.php');
if($_POST['submit'])
{
extract($_POST) ;
$query_XUser = "SELECT email FROM user WHERE email = '" .$email. "' and appliedfor = '" . $appliedfor. "'";
$XUser = mysql_query($query_XUser) or die(mysql_error());
$totalRows_XUser = mysql_num_rows($XUser);
if ($totalRows_XUser == 0)
{
$Already_user = "No";
$postdate = date('Y-m-d');
$dob=$day . "-" . $month . "-" . $year;
$insertSQL = "INSERT INTO user set expected_salary='".$expected_salary."',current_salary='".$txtsalary."',name='".$name."',appliedfor='".$appliedfor."',email='".$email."',gender='".$sex."' , dateofbirth='".$dob."' , current_address='".$address."' , current_location='".$currentloc."' , other_location='".$othercurrentloc."',country_code='".$isd_code."',std_code='".$std_code."',phone_number='".$phone."',mobile='".$mobile."',industry='".$industry."',duration='".$duration."',current_employer='".$cur_employer."',prev_employer='".$prev_employer."',high_degree='".$txteducation."',institute='".$universityid."',other_institute='".$university."',resume_title='".$title."',resume='".$text."',pincode='".$pincode."',jobinvolve='".$jobinvolve."'";
//echo $insertSQL;
$Result1 = mysql_query($insertSQL) or die(mysql_error());
$newval = $email . $appliedfor . date("H:i:s");
$upuserid = md5($newval);
$img1_name=$_FILES['img1']['name'];
$uploadfilename =$img1_name ;
$dotpos = strpos($uploadfilename,".");
$dotpos++;
$stringlen = strlen($uploadfilename) - $dotpos;
$afstring = substr($uploadfilename,$dotpos,$stringlen);
$uploadfilename = $upuserid . "." . $afstring;
$dir = "dir";
$fileleng = strlen($_FILES['img1']);
if (!empty($img1_name))
{
$img1_name = "upload/".$uploadfilename;
if (file_exists("$img1_name"))
{
die("File already exists");
}
$ext = strrchr($img1_name,'.');
if (($extlimit == "yes") && (!in_array($ext,$limitedext)))
{
die("The file you are uploading doesn't have the correct extension OR Empty File Name.");
}
echo $img1_name;
move_uploaded_file($_FILES['img1']['tmp_name'], $img1_name) or die("The file you are trying to upload couldn't be copied to the server");
$updateimg = "update user set upload_cv='".$img1_name."' where email='".$email."'";
$Result1 = mysql_query($updateimg) or die(mysql_error());
}
$colname_appliedfor = $appliedfor;
############# add attachment ############################
$fileatt = "upload/" . $uploadfilename; // Path to the file
$fileatt_type = "application/octet-stream"; // File Type
//here i made the file that will be sent as attachment to have the name "CV_name_surname.doc" you can make it what format you like,
//i needed the doc format... and i'll modify this code to accept just doc file later...i'm really tired right now :D
$fileatt_name = "upload/" . $uploadfilename; // Filename that will be used for the file as the attachment
//echo $fileatt_name . " ";
//$email_from is the variable that gets the value, of the From: field that will appear in your received mail
$email_from = $email; // Who the email is from
//Here you define the subject of you message
$email_subject = "Resume from $email"; // The Subject of the email
//here you define the body of the message, the message itself
//you can modify the "post" textfield in sendmail.php to a textarea....
//$email_message = "Please download the Resume"; // Message that the email has in it
if(!$universityid)
{
$universityid=$university;
}
$pnumber=$isdcode . "-" . $stdcode . "-" . $phone;
$messageto = "Dear " . $name . ",
";
$messageto .= "We thank you for having applied for the post of " . $appliedfor . ".";
$messageto .= "We have taken record of your resume. You will be intimated if your profile matches with our requirements on ";
$messageto .=" Applied For :" . $appliedfor . " Name :" . $name . " Email Id :" . $email . " Gender :" . $gender . " Date of Birth :" . $dob . " Current Address :" . $address . " Current Location :" . $location . " Pincode :" . $pincode . " Other Location :" . $otherloc . " Phone Number :" . $pnumber . " Mobile Number :" . $mobile . " Duration :" . $duration . " Current Employer :" . $cempoloyed . " Job Involved :" . $jobinvolved . " Previous Employer :" . $pemployer . " Expected Salary (Per Annum) :" . $esalary . " Present Salary :" . $psalary . " Education : " . $txteducation . " Institute :" . $universityid . " Resume Title :" . $title . " Resume Detail :" . $text;
$messageto .= "
your mail id.
" . $email;
$messageto .= "Regards,
MLB Capital";
//echo $messageto;
//here you enter the e-mail address to wich you want the message to be sent
//$email_to1 = "vikas@indiafin.com";
$email_to1 = "$email";
// Who the email is too
//$email_to = "vikas@indiafin.com";
$email_to = "ukddelhi@ushabreco.com, projects@ushabreco.com, ms@indiafin.com";
//adds the e-mail address of the sender
$headers= "From:".$email;
$headers .= "\nMIME-Version: 1.0\n" .
"Content-Type: multipart/mixed;\n" .
" boundary=\"{$mime_boundary}\"";
$headers1 = "From:www.ushamartin.com";
$headers1 .= "\nMIME-Version: 1.0\n" .
"Content-Type: multipart/mixed;\n" .
" boundary=\"{$mime_boundary}\"";
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
$messageto .= "This is a multi-part message in MIME format.\n\n" .
"--{$mime_boundary}\n" .
"Content-Type:text/html; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$messageto . "\n\n";
/********************************************** First File ********************************************/
//$filleant takes the value of the picture that was jut uploaded with the unique name to the ftp in the www.yourname.com/upload/upload
$fileatt = "upload/" . $uploadfilename; // Path to the file
$fileatt_type = "application/octet-stream"; // File Type
//here i made the file that will be sent as attachment to have the name "CV_name_surname.doc" you can make it what format you like,
//i needed the doc format... and i'll modify this code to accept just doc file later...i'm really tired right now :D
$fileatt_name = "upload/" . $uploadfilename; // Filename that will be used for the file as the attachment
$file = fopen($fileatt,'rb');
$data = fread($file,filesize($fileatt));
fclose($file);
$data = chunk_split(base64_encode($data));
$messageto .= "--{$mime_boundary}\n" .
"Content-Type: {$fileatt_type};\n" .
" name=\"{$fileatt_name}\"\n" .
//"Content-Disposition: attachment;\n" .
//" filename=\"{$fileatt_name}\"\n" .
"Content-Transfer-Encoding: base64\n\n" .
$data . "\n\n" .
"--{$mime_boundary}\n";
unset($data);
unset($file);
unset($fileatt);
unset($fileatt_type);
unset($fileatt_name);
/********************************************** End of File Config ********************************************/
// To add more files just copy the file section again, but make sure they are all one after the other! If they are not it will not work!
$ok1 = mail($email_to1, $email_subject, $messageto, $headers1);
$ok = @mail($email_to, $email_subject, $messageto, $headers);
if($ok1)
{
echo "";
}
else
{
die("Sorry but the email could not be sent. Please go back and try again!");
}
############ end attachment #############################
/*$emailto = $HTTP_POST_VARS['email'];
$messageto = "Dear " . $HTTP_POST_VARS[name] . ",
";
$messageto .= $messageto . "We thank you for having applied for the post of " . $HTTP_POST_VARS[appliedfor] . ".";
$messageto .= $messageto . "We have taken record of your resume. You will be intimated if your profile matches with our requirements on ";
$messageto .= $messageto . "your mail id.
";
$messageto .= $messageto . "Regards,
Abir Constructions";
$emailsub = "Thanks for applying";
$headers .= "From: Abir Constructions \n";
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
@mail($emailto,$emailsub,$messageto,$headers);*/
$msg="Your Message Sent Succeffuly.";
$_SESSION['msg']=$msg;
header('location:careers.php');
}
} ?>
|
|
|