512000){ $error = 'Upload FAILED, the resume file is too large !'; j_alert($error); exit; } $array=$db->getrow("SELECT name FROM `job` where id='".escapeit($job_id)."' "); $name=$array[name]; /* Kowloon HK Island New Territories Outlying Islands */ $page_tbname="apply"; //insert ORDER $sql = "INSERT INTO `".$page_tbname."` ( `id` ) VALUES ( NULL );"; $db->query($sql); $insert_id = $db->insert_id(); $display=1; $status=0; $date=$currentdate; $mid=$temp_memberid; $category_id=$id; $rid=$id; //update $strsql=" UPDATE ".$page_tbname." SET `sorting` = '".escapeit($sorting)."' , `display` = '".escapeit($display)."' , `date` = '".escapeit($date)."' , `mobile` = '".escapeit($mobile)."' , `phone` = '".escapeit($phone)."' , `phone_office` = '".escapeit($phone_office)."' , `email` = '".escapeit($email)."' , `linkin` = '".escapeit($linkin)."' , `address` = '".escapeit($address1.", ".$address2)."' , `district` = '".escapeit($district)."' , `msg` = '".escapeit($msg)."' where `id` = '$insert_id' "; $db->query($strsql); /* ===================*/ $page_attachment_path='upload/apply/'; $id=$insert_id; $page_tbname='apply'; $col_name='file1'; //upload file if(!empty($_FILES)){ foreach ($_FILES as $key => $value) { $col_name=$key; if($value["name"]!=""){ $file_array = add_attachment($_FILES[$key], "".$page_attachment_path, $page_attachment_path, $page_tbname, $id, '', $col_name, $sorting=0); } /*print " $_FILES[$key] $page_attachment_path, $page_attachment_path, $page_tbname, $id, $col_name, $sorting
"; exit; */ } } $to = $adminemail; $subject = 'Job Hunter New Apply Form'; $message = "Please check the back-end for the new apply form details.\r\n http://job-hunter.com.hk/sys/apply/apply_form.php?id=".$insert_id."\r\n \r\n Mobile : ".$mobile."\r\n Phone : ".$phone."\r\n Office Number : ".$phone_office."\r\n Email : ".$email."\r\n Linkedin : ".$linkin."\r\n Message : ".$msg; $headers = 'From: '.$adminemail . "\r\n" . 'Reply-To: $adminemail' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); j_alert("The form have been submited, thank you."); j_goTo("joblisting.php"); //j_goTo("job_details.php?id=".$job_id); ?>