$_SESSION["userid"]; session_start(); if($_SESSION["userid"]=="") { header("location:index.php"); } $ses_ma_id=$_SESSION["userid"]; $browsessionid=session_id(); ?> if(isset($_POST['Submit'])) { $cust_id=$_POST['cust_id']; date_default_timezone_set('Asia/Kolkata'); $date = date('Y-m-d H:i:s ', time()); $payment_amount_1=trim(addslashes($_POST['payment_amount_1'])); $name=trim(addslashes($_POST['name'])); $id_gender=trim(addslashes($_POST['id_gender'])); $phone=trim(addslashes($_POST['phone'])); $email=trim(addslashes($_POST['email'])); $password=trim(addslashes($_POST['p_word'])); $message=trim(addslashes($_POST['message'])); $address=trim(addslashes($_POST['address'])); $country=trim(addslashes($_POST['country'])); $consulting_for=trim(addslashes($_POST['con_for'])); $pincode=trim(addslashes($_POST['pincode'])); $city=trim(addslashes($_POST['city'])); $state=trim(addslashes($_POST['state'])); $id_lang=trim(addslashes($_POST['id_lang'])); $skypeid=trim(addslashes($_POST['skypeid'])); $dob1=trim(addslashes($_POST['dob'])); $ses_user_id=$_SESSION["userid"]; //$time=strtotime($dob1); $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); $query_pag_num = "SELECT * FROM tbl_member where email='$email' "; $result_pag_num = mysql_query($query_pag_num); $rows = mysql_num_rows($result_pag_num); $Query_delete = mysql_query("DELETE from tbl_appointment where session_id='$browsessionid' and status='0'"); if($ses_user_id!='') { } $sessionid_free=$cust_id; $login = "SELECT * from shop_user WHERE user_id= '$sessionid_free' "; $resqry = mysql_query($login) or die("ERROR:".mysql_error()); $numrows = mysql_num_rows($resqry); if($numrows==0) { $Insert_Qry_12 = "INSERT INTO shop_user (`name`,`gender`,`phone`,`email`,`dob`,`password`,`language`,`skypeid`,`state`,`city`,`country`,`address`,`status`) VALUES ('$name','$id_gender','$phone','$email','$dob1','123456','$id_lang','$phone','$state','$city','$country','$address','1')"; $Insert_Run_12 = mysql_query($Insert_Qry_12) or die("Insert query error".mysql_error()); } $query_pag_mem = "SELECT * FROM tbl_appointment where email_id='$email' and status='1' "; $result_pag_mem = mysql_query($query_pag_mem); $rows_page_mem = mysql_num_rows($result_pag_mem); $country; if($country=="India") { if($rows_page_mem==0) { //$amount=40; $amount=399; } if($rows_page_mem==1) { //$amount=40; $amount=199; } if($rows_page_mem>1) { //$amount=40; $amount=99; } } else { if($country=="Malaysia") { if($rows_page_mem==0) { //$amount=40; $amount=12; } if($rows_page_mem==1) { //$amount=40; $amount=7; } if($rows_page_mem>1) { //$amount=40; $amount=5; } } else { if($rows_page_mem==0) { //$amount=40; $amount=50; } if($rows_page_mem==1) { //$amount=40; $amount=30; } if($rows_page_mem>1) { //$amount=40; $amount=20; } } } $payment_mode=addslashes($_POST['payment_mode']); if($payment_mode=="Cash") { $login_12 = "SELECT * from tbl_appointment WHERE order_id!= '' and payment_type='Cash' "; $resqry_12 = mysql_query($login_12) or die("ERROR:".mysql_error()); $numrows_12 = mysql_num_rows($resqry_12); $tot_order_id=($numrows_12+1); } else { $login_12 = "SELECT * from tbl_appointment WHERE order_id!= '' and payment_type!='Cash' "; $resqry_12 = mysql_query($login_12) or die("ERROR:".mysql_error()); $numrows_12 = mysql_num_rows($resqry_12); $tot_order_id=($numrows_12+4); } $Insert_Qry = "INSERT INTO tbl_member (`name`,`gender`,`phone`,`email`,`dob`,`password`,`language`,`skypeid`,`country`) VALUES ('$name','$id_gender','$phone','$email','$dob1','$password','$id_lang','$phone','$country')"; $Insert_Run = mysql_query($Insert_Qry) or die("Insert query error".mysql_error()); $attachmentfileid = mysql_insert_id(); $Insert_Qry_1 = "INSERT INTO tbl_appointment (`mem_id`,`appointment_date`,`hour_date`,`min_date`,`am_date`,`des`,`email_id`,`session_id`,`status`,`consulting_for`,`amount`,`payment_type`,`c_id`,`added_date`,`order_id`) VALUES ('$attachmentfileid','$appointment_date','$appointment_time_1','$appointment_time_2','$appointment_time_3','$message','$email','$browsessionid','1','$consulting_for','$payment_amount_1','$payment_mode','1','$date','$tot_order_id')"; $Insert_Run_1 = mysql_query($Insert_Qry_1) or die("Insert query error".mysql_error()); $attachmentfileid_1 = mysql_insert_id(); $login = "SELECT * from tbl_appointment WHERE id= '$attachmentfileid_1' "; $resqry = mysql_query($login) or die("ERROR:".mysql_error()); $numrows = mysql_num_rows($resqry); $Fetcorderid = mysql_fetch_array($resqry); $mailcopy=$Fetcorderid ['email_id']; $date=$rowsss['date']; $me_id=$Fetcorderid['mem_id']; $order_id=$Fetcorderid['id']; $ap_date= $Fetcorderid['appointment_date']; $consulting_for= $Fetcorderid['consulting_for']; $ap_hour= sprintf("%02d",$Fetcorderid['hour_date']); $ap_min= sprintf("%02d",$Fetcorderid['min_date']); $ap_sec= $Fetcorderid['am_date']; $amount= $Fetcorderid['amount']; $Query = "SELECT * from `tbl_member` where id='$me_id' "; $name = mysql_query($Query) or die("ERROR:".mysql_error()); $no=mysql_num_rows($name); $row = mysql_fetch_array($name); $firstname= $row['name']; $country= $row['country']; $mobss= $row['phone']; $language= $row['language']; $age= $row['dob']; $skypeid=$row['skypeid']; $msg1dddd.="$ap_date"; $msg1dddd.=" $ap_hour"; $message = "Hi ".$firstname." your appointment with Dr. G.ANBUGANAPATHI on ".$ap_date." ".$msg1dddd.":".$ap_min.":".$ap_sec." is booked. DRANBU"; //enter Your Message $message = urlencode($message); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'http://sms.dial4sms.com/api/v2/SendSMS?SenderId=DRANBU&Message='.$message.'&MobileNumbers='.$mobss.'&ApiKey=eYfIWFmiAMhbL6JDTfOb3kzGzQr+eimy6prshuD8qLo=&ClientId=b45d4e3d-cb26-4856-8cbf-93a02a7b9eeb', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', )); $response = curl_exec($curl); curl_close($curl); if($_FILES['file']['name']!="") { $size = 190; // the thumbnail height $filedir = 'uploads/'; // the directory for the original image $thumbdir = 'uploads/'; // the directory for the thumbnail image $maxfile = '200000000000'; $mode = '0666'; $userfile_name = $_FILES['file']['name']; $userfile_tmp = $_FILES['file']['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(); $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=($attachmentfileid.$new_file_name); $prod_img = $filedir.$new_file_name; // original_images/456546565465465464jhh.jpg $items[] = $prod_img; $prod_img_thumb = $thumbdir.$getExt[0].".".$getExt[1]; $_SERVER['DOCUMENT_ROOT']."/uploads/$userfile_name" ; @move_uploaded_file($userfile_tmp, $prod_img); $upload_img = mysql_query("UPDATE tbl_appointment SET document_name='".$new_file_name."' WHERE id='".$attachmentfileid_1."'"); } $id=$_REQUEST['id']; $m_id=$_REQUEST['m_id']; header("location:/siddhaadmin/order-admin/appointment_details_view_print_admin.php?id=".$attachmentfileid_1); //header("location:/para/siddha_live3/admin/order-admin/appointment_details_view_print_admin.php?id=".$attachmentfileid_1); } ?>