$_SESSION["userid"]; session_start(); ?> if($_SESSION["userid"]=="") { header("location:login_staff.php"); } ?> $ses_ma_id=$_SESSION["userid"]; $browsessionid=session_id(); ?> if(isset($_POST['Submit'])) { $ses_ma_id=$_SESSION["userid"]; date_default_timezone_set('Asia/Kolkata'); $date = date('Y-m-d H:i:s ', time()); $mobile=trim(addslashes($_POST['mobile'])); $name=trim(addslashes($_POST['name'])); $location=trim(addslashes($_POST['location'])); $consulting=trim(addslashes($_POST['consulting'])); $amount=trim(addslashes($_POST['age'])); $id=$_REQUEST['id']; $m_id=$_REQUEST['m_id']; $dob=date('Y-m-d', strtotime($dob)); $time_id=trim(addslashes($_POST['time_id'])); $time_id_1=strtotime($time_id); $date_id=trim(addslashes($_POST['date_id'])); $date_id_1=strtotime($date_id); $appointment_time=date('h:i a', $time_id_1); $appointment_date=date('Y-m-d', $date_id_1); $appointment_time_1=date('h', $time_id_1); $appointment_time_2=date('i', $time_id_1); $appointment_time_3=date('a', $time_id_1); //$time_t=date('h:i a', $time_id); //$date_t=date('Y-m-d', $date_id); $app_id=$_REQUEST['app_id']; if($app_id=="") { $Insert_Qry_1 = "INSERT INTO tbl_appointment_office (`appointment_date`,`hour_date`,`min_date`,`am_date`,`mobile_no`,`name`,`location`,`status`,`added_date`,`des`,`mem_id`,`amount`) VALUES ('$appointment_date','$appointment_time_1','$appointment_time_2','$appointment_time_3','$mobile','$name','$location','1','$date','$consulting','$ses_ma_id','$amount')"; $Insert_Run_1 = mysql_query($Insert_Qry_1) or die("Insert query error".mysql_error()); $attachmentfileid_1 = mysql_insert_id(); } else { $Updatecart = mysql_query("UPDATE tbl_appointment_office SET `name`='$name',`appointment_date`='$appointment_date',`hour_date`='$appointment_time_1',`min_date`='$appointment_time_2',`am_date`='$appointment_time_3',`mobile_no`='$mobile',`location`='$location',`des`='$consulting',`amount`='$amount' where id='$app_id' "); } header("location:appointment-offline.php"); // header("location:appointment-confirmation.php?id=".$id ."&m_id=".$m_id); } ?>