$caller="active"; $caller1="open"; $add_caller="active"; require_once '../template/superadmin/action_connection.php' ; include("../settings/adminsession.php"); session_start(); ?> if($_REQUEST['id']!='') { $update_option =1; } if(isset($_POST['sumbit'])) { $reason_from_hour=trim(addslashes($_REQUEST['reason_from_hour'])); $reason_from_min=trim(addslashes($_REQUEST['reason_from_min'])); $reason_from_am=trim(addslashes($_REQUEST['reason_from_am'])); $reason_to_hour=trim(addslashes($_REQUEST['reason_to_hour'])); $reason_to_min=trim(addslashes($_REQUEST['reason_to_min'])); $reason_to_am=trim(addslashes($_REQUEST['reason_to_am'])); if ($_REQUEST["form_action"] == "Update") { $date=$_REQUEST['date']; $date = date("Y-m-d", strtotime($date)); $Query="UPDATE `tbl_doctor_appointment` SET `date`='" .$date. "',`from_hour`='" .$reason_from_hour. "',`from_min`='" .$reason_from_min. "',`from_sta`='" .$reason_from_am ."',`to_hour`='" .$reason_to_hour. "',`to_min`='" .$reason_to_min. "',`to_sta`='" .$reason_to_am ."' WHERE `id`='".$_REQUEST['id']."'"; $DB->query($Query); $flag="sucess"; } $total_file=$_REQUEST['date']; $pieces = explode(",", $total_file); $total_file=count($pieces); for($i = 0; $i < $total_file; $i++) { $new_d=$pieces[$i]; date_default_timezone_set('Asia/Kolkata'); $date_ss = date('Y-m-d H:i:s ', time()); $tablename = "`tbl_doctor_appointment`"; $new_d = date("Y-m-d", strtotime($new_d)); //$date=trim(addslashes($_REQUEST['date'])); $date = date("Y-m-d", strtotime($new_d)); if ($_REQUEST["form_action"] == "Insert") { $Query_last_invoice = "SELECT date from tbl_doctor_appointment where (date='".$date."' ) "; $name_last_invoice=$DB->query($Query_last_invoice); $noo=mysql_num_rows($name_last_invoice); /*if($noo==0) {*/ $Query = "insert into $tablename values( NULL,'". $date . "','". $reason_from_hour . "','". $reason_from_min . "','". $reason_from_am . "','". $reason_to_hour . "','" . $reason_to_min . "','" . $reason_to_am."', '".$date_ss ."','0')"; $DB->query($Query); $flag="sucess"; /*}*/ /* else { $flag="failure"; }*/ } } } date_default_timezone_set("Asia/Kolkata"); $tablename='tbl_job_details'; if ($update_option == 1) { $id=$_REQUEST['id']; $Query_last_data = "SELECT * from tbl_doctor_appointment where id='$id' "; $name_last_data=$DB->query($Query_last_data); $row_12_123=mysql_fetch_array($name_last_data); $datea=$row_12_123['date']; $from_hour=$row_12_123['from_hour']; $from_min=$row_12_123['from_min']; $from_sta=$row_12_123['from_sta']; $to_hour=$row_12_123['to_hour']; $to_min=$row_12_123['to_min']; $to_sta=$row_12_123['to_sta']; $app_date = date("m/d/Y", strtotime($datea)); } ?>