$caller="active"; $caller1="open"; $appoint="active"; require_once '../template/superadmin/action_connection.php' ; include("../settings/adminsession.php"); session_start(); ?> if($_REQUEST['id']!='') { $update_option =1; } ?> if(isset($_POST['Submit'])) { $id = $_POST['get_id']; $date = date('Y-m-d', strtotime($_POST['from_date'])); $my_date = date('Y-m-d H:i:s'); $upd_date = $_REQUEST['upd_date']; $upd_sta_1 = $_REQUEST['upd_sta']; if($upd_date != $date && $upd_sta_1 !="1"){ $update_status = "1"; }else{ $update_status = "0"; } $time_id = explode("$$", $_POST['time_id']); $app_id = $time_id[1]; $eds = explode(" ", $time_id[0]); $eds1 = explode(":", $eds[0]); $hh = ltrim($eds1[0], "0"); if(ltrim($eds1[1], "0") == ''){ $mm = 0; }else{ $mm = $eds1[1]; } $am = $eds[1]; $get_inch = "select * from tbl_appointment_office where id = '$id'"; $get_inches = $DB->query($get_inch); $set_u = mysql_fetch_array($get_inches); $insert_query = "INSERT INTO tbl_appointment_office_track (track_id, earlier_date, hour_date, min_date, am_date, app_id, added_date) VALUES('$id', '".$set_u['appointment_date']."', '".$set_u['hour_date']."', '".$set_u['min_date']."', '".$set_u['am_date']."', '".$set_u['app_id']."', '$my_date');"; $DB->query($insert_query); $flag="sucess"; $Query="update tbl_appointment_office set appointment_date = '$date', mobile_no='".$_POST['mobile']."', order_id = '".$_POST['order_id']."', name='".$_POST['name']."', location='".$_POST['location']."', razid='".$_POST['vehicle']."', amount = '".$_POST['age']."', payment = '".$_POST['req_pay']."', des = '".$_POST['consulting']."', paid_amount = '".$_POST['paid_amount']."', app_id = '$app_id', hour_date = '$hh', min_date = '$mm', am_date = '$am', update_status='$update_status' where id='$id'"; $DB->query($Query); $insert_query = "INSERT INTO tbl_appointment_office_track (track_id, earlier_date, modified_date, from_hour, from_min, from_sta, to_hour, to_min, to_sta, added_date) VALUES('$id', '', '', 0, 0, '', 0, 0, '', '');"; $flag="sucess"; // header("location:appointment_details_direct.php"); } ?>