| Server IP : 210.245.233.93 / Your IP : 216.73.216.226 Web Server : Apache/2.2.15 (CentOS) System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64 User : apache ( 48) PHP Version : 5.3.3 Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/(Del)pathways.org.hk/MIS20140127/old20140407/staff/ |
Upload File : |
<?php
include_once '../include/DBConnect.php';
//$score = "1";
if ($_POST) {
$score = $_POST['Rate1'];
$score++;
$score2 = $_POST['Rate2'];
$score2++;
//'campus'; //check box
//'programs'; //check box
//'subjects'; //check box
$position = $_POST['Position_id'];
$status = $_POST['Status'];
$join_date = $_POST['Join_date'];
$registration_date = $_POST['Registration_date'];
$last_name = $_POST['Last_name'];
$first_name = $_POST['First_name'];
$zh_name = $_POST['Zh_name'];
$gender = $_POST['Gender'];
$dob = $_POST['Dob'];
$tel = $_POST['Tel'];
$mobile = $_POST['Mobile'];
$email = $_POST['Email'];
$address = $_POST['Address'];
$refer_by = $_POST['Refer_by'];
$salary = $_POST['Salary'];
$rate1 = $_POST['Rate1'];
$rate2 = $_POST['Rate2'];
$rate3 = $_POST['Rate3'];
$rate4 = $_POST['Rate4'];
$rate5 = $_POST['Rate5'];
$rate6 = $_POST['Rate6'];
$rate6_other = $_POST['Rate6_other'];
$remarks = $_POST['Remarks'];
$working_mode = $_POST['Working_mode'];
$currentStaff;
date_default_timezone_set("Hongkong");
$today = date("Y-m-d H:i:s");
$createby = 0;
$actived = 1;
$deleted = 0;
$sth = $dbh->prepare("INSERT INTO `staff`(`createby`, `createdate`, `lastupby`, `lastupdate`, `actived`, `deleted`, `position_id`, `status`, `join_date`, `registration_date`, `last_name`, `first_name`, `ch_name`, `gender`, `date_of_brith`, `home_tel`, `mobile`, `email`, `address`, `refer_by`, `salary`, `rate1`, `rate2`, `rate3`, `rate4`, `rate5`, `rate6`, `other_rate`, `remarks`, `working_mode`) VALUES
($createby,'$today',$createby,'$today',$actived,$deleted,'$position','$status','$join_date','$registration_date','$last_name','$first_name','$zh_name','$gender','$dob','$tel','$mobile','$email','$address','$refer_by','$salary','$rate1','$rate2','$rate3','$rate4','$rate5','$rate6','$rate6_other','$remarks','$working_mode')");
$sth->execute();
$message;
if ($sth)
$message = "1 record inserted";
else
$message = $sth->errorInfo();
$sth = $dbh->prepare("SELECT `staff_id` FROM `staff` WHERE `createdate` = '$today' AND `last_name` = '$last_name'");
$sth->execute();
while ($ResultSet = $sth->fetch(PDO::FETCH_ASSOC)) {
$currentStaff = $ResultSet['staff_id'];
}
$Array = array(
"1" => $message,
"2" => $currentStaff,
"3" => $score * 3,
"4" => $score * 4,
"5" => $score2 * 5
);
$Arrays[] = $Array;
}
echo json_encode($Array);
?>