$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'])) { date_default_timezone_set('Asia/Kolkata'); $date_ss = date('Y-m-d H:i:s ', time()); $tablename = "`tbl_doctor_appointment`"; $date=trim(addslashes($_REQUEST['date'])); $date = date("Y-m-d", strtotime($date)); $app_agg=$_REQUEST['app_agg']; $app_name=$_REQUEST['app_name']; $app_age=$_REQUEST['app_age']; $app_phone=$_REQUEST['app_phone']; $dob=date('Y-m-d', strtotime($date)); $upd_date = $_REQUEST['upd_date']; $upd_sta_1 = $_REQUEST['upd_sta']; if($upd_date != $dob && $upd_sta_1 !="1"){ $update_status = "1"; }else{ $update_status = "0"; } $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); /*$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") { $new_id_client=$_REQUEST['new_id_client']; $Query_last_data = "SELECT * from tbl_appointment where mem_id='$new_id_client' "; $name_last_data=$DB->query($Query_last_data); $row_12_123_maddd=mysql_fetch_array($name_last_data); $app_phone=$_REQUEST['app_phone']; $app_age=$_REQUEST['app_age']; $app_name=$_REQUEST['app_name']; $location = $_REQUEST['location']; $Query_1="UPDATE `tbl_member` SET `phone`='" .$app_phone. "',`skypeid`='" .$app_phone. "',`name`='" .$app_name. "',`dob`='" .$app_age. "', `location_city`= '".$location."' WHERE `id`='".$_REQUEST['new_id_client']."'"; $DB->query($Query_1); $Query="UPDATE `tbl_appointment` SET `appointment_date`='" .$dob. "',`hour_date`='" .$appointment_time_1. "',`min_date`='" .$appointment_time_2. "',`am_date`='" .$appointment_time_3 ."', `update_status`='".$update_status."' WHERE `id`='".$_REQUEST['id']."'"; $DB->query($Query); if($_FILES['mast_1']['name']!="") { $size = 190; // the thumbnail height $filedir = '../../default/uploads/'; // the directory for the original image $thumbdir = '../../default/uploads/'; // the directory for the thumbnail image $maxfile = '200000000000'; $mode = '0666'; echo $userfile_name = $_FILES['mast_1']['name']; $mysql_insert_id=$_REQUEST['id']; $files = array_filter($_FILES['mast_1']['name']); //Use something similar before processing files. // Count the number of uploaded files in array $total_count = count($_FILES['mast_1']['name']); // Loop through every file for( $i=0 ; $i < $total_count ; $i++ ) { //The temp file path is obtained $tmpFilePath = $_FILES['mast_1']['tmp_name'][$i]; //A file path needs to be present if ($tmpFilePath != ""){ //Setup our new file path $new_file_names.=$mysql_insert_id.$_FILES['mast_1']['name'][$i].'$$$'; $newFilePath = $filedir.$mysql_insert_id.$_FILES['mast_1']['name'][$i]; //File is uploaded to temp dir if(move_uploaded_file($tmpFilePath, $newFilePath)) { //Other code goes here } } } $new_iii=$_REQUEST['id']; $upload_img = "UPDATE tbl_appointment SET document_name='".$new_file_names."' WHERE id='".$new_iii."'"; $DB->query($upload_img); // $upload_img = mysql_query("UPDATE shop_product SET image='".$new_file_name."' WHERE id='".$mysql_insert_id."'"); } if($_FILES['mast_2']['name']!="") { $size = 190; // the thumbnail height $filedir = '../../default/uploads/'; // the directory for the original image $thumbdir = '../../default/uploads/'; // the directory for the thumbnail image $maxfile = '200000000000'; $mode = '0666'; echo $userfile_name = $_FILES['mast_2']['name']; $userfile_tmp = $_FILES['mast_2']['tmp_name']; //$userfile_name = $_FILES['uploadFile']['name']; //$userfile_tmp = $_FILES['uploadFile']['tmp_name']; $getExt = explode ('.', $userfile_name); $rand_name = md5(rand(000,999)); /* $prod_img = $filedir.$mysql_insert_id.$i.$getExt[0].".".$getExt[1];*/ $new_file_name = $userfile_name; //exit(); $mysql_insert_id=$_REQUEST['id']; $new_file_name = str_replace('&','and',$new_file_name); $new_file_name = str_replace('#','',$new_file_name); $new_file_name = str_replace('+','',$new_file_name); $new_file_name = str_replace("'", '', $new_file_name); $new_file_name = str_replace(' ','',$new_file_name); $new_file_name_3730=$new_file_name; $new_file_name=($mysql_insert_id.$new_file_name); $prod_img = $filedir.$new_file_name; // original_images/456546565465465464jhh.jpg $items[] = $prod_img; $prod_img_thumb = $thumbdir.$getExt[0].".".$getExt[1]; move_uploaded_file($userfile_tmp, $prod_img); $new_iii=$_REQUEST['id']; $upload_img = "UPDATE tbl_appointment SET document_name_1='".$new_file_name."' WHERE id='".$new_iii."'"; $DB->query($upload_img); // $upload_img = mysql_query("UPDATE shop_product SET image='".$new_file_name."' WHERE id='".$mysql_insert_id."'"); } if($_FILES['mast_3']['name']!="") { $size = 190; // the thumbnail height $filedir = '../../default/uploads/'; // the directory for the original image $thumbdir = '../../default/uploads/'; // the directory for the thumbnail image $maxfile = '200000000000'; $mode = '0666'; $userfile_name = $_FILES['mast_3']['name']; $userfile_tmp = $_FILES['mast_3']['tmp_name']; //$userfile_name = $_FILES['uploadFile']['name']; //$userfile_tmp = $_FILES['uploadFile']['tmp_name']; $getExt = explode ('.', $userfile_name); $rand_name = md5(rand(000,999)); /* $prod_img = $filedir.$mysql_insert_id.$i.$getExt[0].".".$getExt[1];*/ $new_file_name = $userfile_name; //exit(); $mysql_insert_id=$_REQUEST['id']; $new_file_name = str_replace('&','and',$new_file_name); $new_file_name = str_replace('#','',$new_file_name); $new_file_name = str_replace('+','',$new_file_name); $new_file_name = str_replace("'", '', $new_file_name); $new_file_name = str_replace(' ','',$new_file_name); $new_file_name_3730=$new_file_name; $new_file_name=($mysql_insert_id.$new_file_name); $prod_img = $filedir.$new_file_name; // original_images/456546565465465464jhh.jpg $items[] = $prod_img; $prod_img_thumb = $thumbdir.$getExt[0].".".$getExt[1]; move_uploaded_file($userfile_tmp, $prod_img); $new_iii=$_REQUEST['id']; $upload_img = "UPDATE tbl_appointment SET document_name_2='".$new_file_name."' WHERE id='".$new_iii."'"; $DB->query($upload_img); // $upload_img = mysql_query("UPDATE shop_product SET image='".$new_file_name."' WHERE id='".$mysql_insert_id."'"); } if($_FILES['mast_4']['name']!="") { $size = 190; // the thumbnail height $filedir = '../../default/uploads/'; // the directory for the original image $thumbdir = '../../default/uploads/'; // the directory for the thumbnail image $maxfile = '200000000000'; $mode = '0666'; $userfile_name = $_FILES['mast_4']['name']; $userfile_tmp = $_FILES['mast_4']['tmp_name']; //$userfile_name = $_FILES['uploadFile']['name']; //$userfile_tmp = $_FILES['uploadFile']['tmp_name']; $getExt = explode ('.', $userfile_name); $rand_name = md5(rand(000,999)); /* $prod_img = $filedir.$mysql_insert_id.$i.$getExt[0].".".$getExt[1];*/ $new_file_name = $userfile_name; //exit(); $mysql_insert_id=$_REQUEST['id']; $new_file_name = str_replace('&','and',$new_file_name); $new_file_name = str_replace('#','',$new_file_name); $new_file_name = str_replace('+','',$new_file_name); $new_file_name = str_replace("'", '', $new_file_name); $new_file_name = str_replace(' ','',$new_file_name); $new_file_name_3730=$new_file_name; $new_file_name=($mysql_insert_id.$new_file_name); $prod_img = $filedir.$new_file_name; // original_images/456546565465465464jhh.jpg $items[] = $prod_img; $prod_img_thumb = $thumbdir.$getExt[0].".".$getExt[1]; move_uploaded_file($userfile_tmp, $prod_img); $new_iii=$_REQUEST['id']; $upload_img = "UPDATE tbl_appointment SET document_name_3='".$new_file_name."' WHERE id='".$new_iii."'"; $DB->query($upload_img); // $upload_img = mysql_query("UPDATE shop_product SET image='".$new_file_name."' WHERE id='".$mysql_insert_id."'"); } if($_FILES['mast_5']['name']!="") { $size = 190; // the thumbnail height $filedir = '../../default/uploads/'; // the directory for the original image $thumbdir = '../../default/uploads/'; // the directory for the thumbnail image $maxfile = '200000000000'; $mode = '0666'; $userfile_name = $_FILES['mast_5']['name']; $userfile_tmp = $_FILES['mast_5']['tmp_name']; //$userfile_name = $_FILES['uploadFile']['name']; //$userfile_tmp = $_FILES['uploadFile']['tmp_name']; $getExt = explode ('.', $userfile_name); $rand_name = md5(rand(000,999)); /* $prod_img = $filedir.$mysql_insert_id.$i.$getExt[0].".".$getExt[1];*/ $new_file_name = $userfile_name; //exit(); $mysql_insert_id=$_REQUEST['id']; $new_file_name = str_replace('&','and',$new_file_name); $new_file_name = str_replace('#','',$new_file_name); $new_file_name = str_replace('+','',$new_file_name); $new_file_name = str_replace("'", '', $new_file_name); $new_file_name = str_replace(' ','',$new_file_name); $new_file_name_3730=$new_file_name; $new_file_name=($mysql_insert_id.$new_file_name); $prod_img = $filedir.$new_file_name; // original_images/456546565465465464jhh.jpg $items[] = $prod_img; $prod_img_thumb = $thumbdir.$getExt[0].".".$getExt[1]; move_uploaded_file($userfile_tmp, $prod_img); $new_iii=$_REQUEST['id']; $upload_img = "UPDATE tbl_appointment SET document_name_4='".$new_file_name."' WHERE id='".$new_iii."'"; $DB->query($upload_img); // $upload_img = mysql_query("UPDATE shop_product SET image='".$new_file_name."' WHERE id='".$mysql_insert_id."'"); } if($_FILES['mast_6']['name']!="") { $size = 190; // the thumbnail height $filedir = '../../default/uploads/'; // the directory for the original image $thumbdir = '../../default/uploads/'; // the directory for the thumbnail image $maxfile = '200000000000'; $mode = '0666'; $userfile_name = $_FILES['mast_6']['name']; $userfile_tmp = $_FILES['mast_6']['tmp_name']; //$userfile_name = $_FILES['uploadFile']['name']; //$userfile_tmp = $_FILES['uploadFile']['tmp_name']; $getExt = explode ('.', $userfile_name); $rand_name = md5(rand(000,999)); /* $prod_img = $filedir.$mysql_insert_id.$i.$getExt[0].".".$getExt[1];*/ $new_file_name = $userfile_name; //exit(); $mysql_insert_id=$_REQUEST['id']; $new_file_name = str_replace('&','and',$new_file_name); $new_file_name = str_replace('#','',$new_file_name); $new_file_name = str_replace('+','',$new_file_name); $new_file_name = str_replace("'", '', $new_file_name); $new_file_name = str_replace(' ','',$new_file_name); $new_file_name_3730=$new_file_name; $new_file_name=($mysql_insert_id.$new_file_name); $prod_img = $filedir.$new_file_name; // original_images/456546565465465464jhh.jpg $items[] = $prod_img; $prod_img_thumb = $thumbdir.$getExt[0].".".$getExt[1]; move_uploaded_file($userfile_tmp, $prod_img); $new_iii=$_REQUEST['id']; $upload_img = "UPDATE tbl_appointment SET document_name_5='".$new_file_name."' WHERE id='".$new_iii."'"; $DB->query($upload_img); // $upload_img = mysql_query("UPDATE shop_product SET image='".$new_file_name."' WHERE id='".$mysql_insert_id."'"); } header("location:appointment_details.php?msg=sucess"); //$flag="sucess"; } 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 ."')"; $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_appointment where id='$id' "; $name_last_data=$DB->query($Query_last_data); $row_12_123=mysql_fetch_array($name_last_data); $new_id=$row_12_123['id']; $new_id_new=$row_12_123['mem_id']; $appointment_date=$row_12_123['appointment_date']; $app_date = date("m/d/Y", strtotime($appointment_date)); $update_sta = $row_12_123['update_status']; $mas_date_sss=date('Y-m-d', strtotime($appointment_date)); $from_hour_1_s=$row_12_123['hour_date']; $from_min_1_s=$row_12_123['min_date']; $from_min_1_s=$row_12_123['min_date']; $from_min_1_s = sprintf("%02d", $from_min_1_s); $from_sta_s=$row_12_123['am_date']; $new_time_ma_sss = ''.$from_hour_1_s.':'.$from_min_1_s.' '.$from_sta_s.''; $new_time_ma_1_ssss=strtotime($new_time_ma_sss); $malath_ch=date('h:i a', $new_time_ma_1_ssss); $Query_last_data_1 = "SELECT * from tbl_member where id='$new_id' "; $name_last_data_1=$DB->query($Query_last_data_1); $row_12_123_1=mysql_fetch_array($name_last_data_1); $name_app=$row_12_123_1['name']; $phone_app=$row_12_123_1['skypeid']; $location_city = $row_12_123_1['location_city']; $age_app=$row_12_123_1['dob']; } ?> $Query_last_data_1 = "SELECT * from tbl_member where id='$new_id_new' "; $name_last_data_1=$DB->query($Query_last_data_1); $row_12_123_1=mysql_fetch_array($name_last_data_1); $name_app=$row_12_123_1['name']; $phone_app=$row_12_123_1['skypeid']; $age_app=$row_12_123_1['dob']; $location_city = $row_12_123_1['location_city']; $app_phone=$row_12_123_1['phone']; $app_name=$row_12_123_1['name']; ?>