CasperSecurity

Current Path : /var/www/uim.org.in/admin/inc/
Upload File :
Current File : /var/www/uim.org.in/admin/inc/ajaxrequest.php

<?php
	include('class.php');
	include('../functions.php');
	$ajax = new user();
	$action = $_GET['action'];
	//code to add specialities
	
	//update status of treatment services
	if($action == 'status_update_banner'){
		$id 	= $ajax->escape_string($_POST['id']);
		$status = $ajax->escape_string($_POST['status']);
		$data 	= $ajax->update_data2('home_banner', array('active_status'=>$status), array('id'=>$id));
		//echo json_encode($data);
	}
	
	
	//update status of treatment services
	if($action == 'status_update_treatmentservices'){
		$id 	= $ajax->escape_string($_POST['id']);
		$status = $ajax->escape_string($_POST['status']);
		$data 	= $ajax->update_data2('treatmentservices', array('active_status'=>$status), array('id'=>$id));
		//echo json_encode($data);
	}
	
	//update status of treatment services
	if($action == 'featured_update_treatmentservices'){
		$id 	= $ajax->escape_string($_POST['id']);
		$status = $ajax->escape_string($_POST['status']);
		$data 	= $ajax->update_data2('treatmentservices', array('featured'=>$status), array('id'=>$id));
		//echo json_encode($data);
	}
	
	
	if($action == 'featured_update_clinics'){
		$id 	= $ajax->escape_string($_POST['id']);
		$status = $ajax->escape_string($_POST['status']);
		$data 	= $ajax->update_data2('clinics', array('featured'=>$status), array('id'=>$id));
		//echo json_encode($data);
	}
	if($action == 'status_update_clinics'){
		$id 	= $ajax->escape_string($_POST['id']);
		$status = $ajax->escape_string($_POST['status']);
		$data 	= $ajax->update_data2('clinics', array('active_status'=>$status), array('id'=>$id));
		//echo json_encode($data);
	}
	
	if($action == 'status_update_testimonials'){
		$id 	= $ajax->escape_string($_POST['id']);
		$status = $ajax->escape_string($_POST['status']);
		$data 	= $ajax->update_data2('eng_testimonials', array('active_status'=>$status), array('id'=>$id));
		//echo json_encode($data);
	}
	
	if($action == 'actionshowtestimonials'){
		$id = $ajax->escape_string($_POST['id']);
		$data = $ajax->query_databy('eng_testimonials', 'id', $id);
		echo json_encode($data);
	}
	if($action == 'actionaddtestimonials'){
		//print_r($_FILES);
		//$path ="../photos/";
		$postedby = $_POST['postedby'];
		$testimonial = $_POST['testimonial'];
		//$photo = $_FILES['photo'];
		//$upload = $ajax->image_upload($photo, $path);
		if(trim($postedby) != ''){
			$table 	= 'eng_testimonials';
			$field 	= array('postedby', 'testimonial');
			$values	= array($postedby, $testimonial);
			$ins 	= $ajax->insert_data($table, $field, $values);
			if($ins==1)
				echo 'Insert successful';
			else
				echo 'Insert Error';
		}else{
			echo 'Error, Please enter the testimonials.';
		}
	}
	//code to edit testi
	if($action == 'actionedittestimonials'){
		$postedby = $_POST['postedby'];
		$testimonial = $_POST['testimonial'];
		$id 	= $ajax->escape_string($_POST['sid']);
		$table 	= 'eng_testimonials';
			$field 	= array('postedby', 'testimonial');
			$values	= array($postedby, $testimonial);
			$ins 	= $ajax->update_data($table, $field, $values, $id);
			if($ins==1)
				echo 'Update successful';
			else
				echo 'Update Error';
		
	}
	//code to delete category
	if($action == 'actiondeletetestimonials'){
		//print_r($_FILES);		
		$table 	= 'eng_testimonials';
		$id 	= $ajax->escape_string($_POST['delid']);
		$ins = $ajax->delete_data($table, $id);
			if($ins==1)
				echo 'Delete successful';
			else
				echo 'Delete Error';
		
	}
	//code to delete banner
	if($action == 'actiondeletebanner'){
		//print_r($_FILES);		
		$table 	= 'home_banner';
		$id 	= $ajax->escape_string($_POST['delid']);
		$ins = $ajax->delete_data($table, $id);
			if($ins==1)
				echo 'Delete successful.';
			else
				echo 'Delete Error.';
		
	}
	if($action == 'status_update_testimonialsarb'){
		$id 	= $ajax->escape_string($_POST['id']);
		$status = $ajax->escape_string($_POST['status']);
		$data 	= $ajax->update_data2('arb_testimonials', array('active_status'=>$status), array('id'=>$id));
		//echo json_encode($data);
	}
	if($action == 'actionshowtestimonialsarb'){
		$id = $ajax->escape_string($_POST['id']);
		$data = $ajax->query_databy('arb_testimonials', 'id', $id);
		echo json_encode($data);
	}
	if($action == 'actionaddtestimonialsarb'){
		//print_r($_FILES);
		//$path ="../photos/";
		$postedby = $_POST['postedby'];
		$testimonial = $_POST['testimonial'];
		//$photo = $_FILES['photo'];
		//$upload = $ajax->image_upload($photo, $path);
		if(trim($postedby) != ''){
			$table 	= 'arb_testimonials';
			$field 	= array('postedby', 'testimonial');
			$values	= array($postedby, $testimonial);
			$ins 	= $ajax->insert_data($table, $field, $values);
			if($ins==1)
				echo 'Insert successful';
			else
				echo 'Insert Error';
		}else{
			echo 'Error, Please enter the testimonials.';
		}
	}
	//code to edit testi
	if($action == 'actionedittestimonialsarb'){
		$postedby = $_POST['postedby'];
		$testimonial = $_POST['testimonial'];
		$id 	= $ajax->escape_string($_POST['sid']);
		$table 	= 'arb_testimonials';
			$field 	= array('postedby', 'testimonial');
			$values	= array($postedby, $testimonial);
			$ins 	= $ajax->update_data($table, $field, $values, $id);
			if($ins==1)
				echo 'Update successful';
			else
				echo 'Update Error';
		
	}
	//code to delete coupon
	if($action == 'actiondeletecoupon'){
		//print_r($_FILES);		
		$table 	= 'coupon';
		$id 	= $ajax->escape_string($_POST['delid']);
		$ins = $ajax->delete_data($table, $id);
			if($ins==1)
				echo 'Delete successful.';
			else
				echo 'Delete Error';
		
	}
	if($action == 'status_update_coupon'){
		$id 	= $ajax->escape_string($_POST['id']);
		$status = $ajax->escape_string($_POST['status']);
		$data 	= $ajax->update_data2('coupon', array('active_status'=>$status), array('id'=>$id));
		//echo json_encode($data);
	}
	if($action == 'actionaddcoupon'){
		//print_r($_FILES);
		//$path ="../photos/";
		$coupon_code = $_POST['coupon_code'];
		$coupon_type = $_POST['coupon_type'];
		$coupon_value = $_POST['coupon_value'];
		//$photo = $_FILES['photo'];
		//$upload = $ajax->image_upload($photo, $path);
		if(trim($coupon_code) != ''){
			$table 	= 'coupon';
			$field 	= array('coupon_code', 'coupon_type,coupon_value');
			$values	= array($coupon_code, $coupon_type,$coupon_value);
			$ins 	= $ajax->insert_data($table, $field, $values);
			if($ins==1)
				echo 'Insert successful.';
			else
				echo 'Insert Error.';
		}else{
			echo 'Error, Please enter the coupon code.';
		}
	}
	//code to delete category
	if($action == 'actiondeletetestimonialsarb'){
		//print_r($_FILES);		
		$table 	= 'arb_testimonials';
		$id 	= $ajax->escape_string($_POST['delid']);
		$ins = $ajax->delete_data($table, $id);
			if($ins==1)
				echo 'Delete successful.';
			else
				echo 'Delete Error';
		
	}
	
	
	
	if($action == 'actionaddcat'){
		//print_r($_FILES);
		//$path ="../photos/";
		$cat_name = $_POST['cat_name'];
		$arb_cat_name = $_POST['arb_cat_name'];
		//$photo = $_FILES['photo'];
		//$upload = $ajax->image_upload($photo, $path);
		if(trim($cat_name) != ''){
			$table 	= 'treatment_category';
			$field 	= array('cat_name', 'arb_cat_name');
			$values	= array($cat_name, $arb_cat_name);
			$ins 	= $ajax->insert_data($table, $field, $values);
			if($ins==1)
				echo 'Insert successful';
			else
				echo 'Insert Error';
		}else{
			echo 'Error, Please enter the category name.';
		}
	}
	//code to edit category
	if($action == 'actioneditcat'){
		$cat_name = $_POST['cat_name'];
		$arb_cat_name = $_POST['arb_cat_name'];
		$id 	= $ajax->escape_string($_POST['sid']);
		
		
			$table 	= 'treatment_category';
			$field 	= array('cat_name', 'arb_cat_name');
			$values	= array($cat_name, $arb_cat_name);
			$ins 	= $ajax->update_data($table, $field, $values, $id);
			if($ins==1)
				echo 'Update successful';
			else
				echo 'Update Error';
		
	}
	//code to delete category
	if($action == 'actiondeletecat'){
		//print_r($_FILES);		
		$table 	= 'treatment_category';
		$id 	= $ajax->escape_string($_POST['delid']);
		$ins = $ajax->delete_data($table, $id);
			if($ins==1)
				echo 'Delete successful';
			else
				echo 'Delete Error';
		
	}
	//code to delete services
	if($action == 'actiondeleteservice'){
		$path 	="../services/";
		$table 	= 'treatmentservices';
		$id 	= $ajax->escape_string($_POST['delid']);
		$row 	= $ajax->query_databy($table, 'id', $id);
		if($row[0]['service_image'] != ''){
			if(file_exists($path.$row[0]['service_image'])) :
				unlink($path.$row[0]['service_image']);
			endif;			
		}
		$ins = $ajax->delete_data($table, $id);
			if($ins==1)
				echo 'Delete successful';
			else
				echo 'Delete Error';
		
	}
	//code to delete clinic
	if($action == 'actiondeleteclinic'){
		
		$path 	="../clinics/";
		$table 	= 'clinics';
		$id 	= $ajax->escape_string($_POST['delid']);
		$row 	= $ajax->query_databy($table, 'id', $id);
		if($row[0]['clinics_image'] != ''){
			if(file_exists($path.$row[0]['clinics_image'])) :
				unlink($path.$row[0]['clinics_image']);
			endif;			
		}

		$ins = $ajax->delete_data($table, $id);
			if($ins==1)
				echo 'Delete successful';
			else
				echo 'Delete Error';
		
	}
	
	//code to remove clinic image and update table
	if($action == 'removeclinicimages'){
		
		//print_r($_FILES);
		$path 	="../clinics/";
		$table 	= 'clinics';
		$id 	= $ajax->escape_string($_POST['dr_id']);
		$img 	= $ajax->escape_string($_POST['image']);
		$row 	= $ajax->custom_query("SELECT clinic_images FROM $table WHERE id=$id");
		if($row[0]['clinic_images'] != ''){
			$images 	= explode(',', $row[0]['clinic_images']);
			if(file_exists($path.$img)) :
				unlink($path.$img);
			endif;
			$index = array_search($img, $images);
			if($index !== false){
				unset($images[$index]);
			}
			$img_string = implode(',', $images);
			$ajax->update_data2($table, array('clinic_images'=>$img_string), array('id'=>$id));
		}
				
	}
	//code to remove clinic image and update table
	if($action == 'removeserviceimages'){
		
		//print_r($_FILES);
		$path 	="../services/";
		$table 	= 'treatmentservices';
		$id 	= $ajax->escape_string($_POST['dr_id']);
		$img 	= $ajax->escape_string($_POST['image']);
		$row 	= $ajax->custom_query("SELECT service_images FROM $table WHERE id=$id");
		if($row[0]['service_images'] != ''){
			$images 	= explode(',', $row[0]['service_images']);
			if(file_exists($path.$img)) :
				unlink($path.$img);
			endif;
			$index = array_search($img, $images);
			if($index !== false){
				unset($images[$index]);
			}
			$img_string = implode(',', $images);
			$ajax->update_data2($table, array('service_images'=>$img_string), array('id'=>$id));
		}
				
	}
	//code to show category in modal box
	if($action == 'actionshowcat'){
		$id = $ajax->escape_string($_POST['id']);
		$data = $ajax->query_databy('treatment_category', 'id', $id);
		echo json_encode($data);
	}
	
	
	
	if($action == 'actionaddspe'){
		//print_r($_FILES);
		$path ="../photos/";
		$name = $_POST['spec'];
		$photo = $_FILES['photo'];
		$upload = $ajax->image_upload($photo, $path);
		if($upload[0] == 1){
			$table 	= 'specialities';
			$field 	= array('name', 'photo');
			$values	= array($name, $upload[1]);
			$ins 	= $ajax->insert_data($table, $field, $values);
			if($ins==1)
				echo 'Insert successful';
			else
				echo 'Insert Error';
		}else{
			echo 'Error, Please check the name and photo';
		}
	}
	
	
	//code to delete specialities
	if($action == 'actiondeletespe'){
		//print_r($_FILES);
		$path 	="../photos/";
		$table 	= 'specialities';
		$id 	= $ajax->escape_string($_POST['id']);
		$row 	= $ajax->query_databy($table, 'id', $id);
		if($row[0]['photo'] != ''){
			if(file_exists($path.$row[0]['photo'])) :
				unlink($path.$row[0]['photo']);
			endif;			
		}
		$ins = $ajax->delete_data($table, $id);
			if($ins==1)
				echo 'Delete successful';
			else
				echo 'Delete Error';
		
	}
	
	//code to show specialities in modal box
	if($action == 'actionshowspe'){
		$id = $ajax->escape_string($_POST['id']);
		$data = $ajax->query_databy('specialities', 'id', $id);
		echo json_encode($data);
	}
	
	
	if($action == 'checkavail'){
		if(!empty($_POST["username"])) {
			$check = $ajax->number_rows('doctors', 'username', $_POST['username']);
		 
		  if($check>0) {
			  echo 0;
		  }else{
			  echo 1;
		  }
		}
	}
	
	//manage services page
	//services
	//code to add specialities
	if($action == 'addservice'){
		
		$name = $_POST['spec'];
		
		
			$table 	= 'services';
			$field 	= array('name');
			$values	= array($name);
			$ins 	= $ajax->insert_data($table, $field, $values);
			if($ins==1)
				echo 'Insert successful';
			else
				echo 'Insert Error';
		
	}
	
	//code to edit services
	if($action == 'editservice'){
		//print_r($_FILES);
		
		$name 	= $_POST['spec'];
		
		$id 	= $ajax->escape_string($_POST['sid']);		
		
			$table 	= 'services';
			$field 	= array('name');
			$values	= array($name);
			$ins 	= $ajax->update_data($table, $field, $values, $id);
			if($ins==1)
				echo 'Update successful';
			else
				echo 'Update Error';
		
	}
	//code to delete services
	if($action == 'deleteservice'){
		
		$table 	= 'services';
		$id 	= $ajax->escape_string($_POST['id']);
		
		$ins = $ajax->delete_data($table, $id);
			if($ins==1)
				echo 'Delete successful';
			else
				echo 'Delete Error';
		
	}
	//code to show services in modal box
	if($action == 'showservice'){
		$id = $ajax->escape_string($_POST['id']);
		$data = $ajax->query_databy('services', 'id', $id);
		echo json_encode($data);
	}
	
	//manage insurance  page
	//
	//code to add insurance
	if($action == 'addinsurance'){
		
		$name = $_POST['spec'];
		
		
			$table 	= 'insurance_provider';
			$field 	= array('name');
			$values	= array($name);
			$ins 	= $ajax->insert_data($table, $field, $values);
			if($ins==1)
				echo 'Insert successful';
			else
				echo 'Insert Error';
		
	}
	
	//code to edit insurance_provider
	if($action == 'editinsurance'){
		//print_r($_FILES);
		
		$name 	= $_POST['spec'];
		
		$id 	= $ajax->escape_string($_POST['sid']);		
		
			$table 	= 'insurance_provider';
			$field 	= array('name');
			$values	= array($name);
			$ins 	= $ajax->update_data($table, $field, $values, $id);
			if($ins==1)
				echo 'Update successful';
			else
				echo 'Update Error';
		
	}
	//code to delete insurance_provider
	if($action == 'deleteinsurance'){
		
		$table 	= 'insurance_provider';
		$id 	= $ajax->escape_string($_POST['id']);
		
		$ins = $ajax->delete_data($table, $id);
			if($ins==1)
				echo 'Delete successful';
			else
				echo 'Delete Error';
		
	}
	//code to show insurance_provider in modal box
	if($action == 'showinsurance'){
		$id = $ajax->escape_string($_POST['id']);
		$data = $ajax->query_databy('insurance_provider', 'id', $id);
		echo json_encode($data);
	}
	
	
	//update account status of doctors
	if($action == 'status_update'){
		$id 	= $ajax->escape_string($_POST['id']);
		$status = $ajax->escape_string($_POST['status']);
		$data 	= $ajax->update_data2('doctors', array('account_status'=>$status), array('id'=>$id));
		//echo json_encode($data);
	}
		
	//code to remove clinic image and update table
	if($action == 'remove_clinic_image'){
		
		//print_r($_FILES);
		$path 	="../profile/";
		$table 	= 'doctors';
		$id 	= $ajax->escape_string($_POST['dr_id']);
		$img 	= $ajax->escape_string($_POST['image']);
		$row 	= $ajax->custom_query("SELECT clinic_images FROM $table WHERE id=$id");
		if($row[0]['clinic_images'] != ''){
			$images 	= explode(',', $row[0]['clinic_images']);
			if(file_exists($path.$img)) :
				unlink($path.$img);
			endif;
			$index = array_search($img, $images);
			if($index !== false){
				unset($images[$index]);
			}
			$img_string = implode(',', $images);
			$ajax->update_data2($table, array('clinic_images'=>$img_string), array('id'=>$id));
		}
				
	}
	
	
	
	//code to show timing in modal box
	if($action == 'showtiming'){
		$dr_id = $ajax->escape_string($_POST['dr_id']);
		$day = $ajax->escape_string($_POST['day']);
		$duration = $ajax->escape_string($_POST['duration']);
		$data = $ajax->custom_query("SELECT * FROM schedule_timing WHERE dr_id=$dr_id AND day='$day' AND active_status=1");
		$message1 = "<input type='hidden' value='$day' name='day'/><input type='hidden' name='dr_id' value='$dr_id'/><input type='hidden' name='duration' value='$duration'/>";
		$message ='';
		if(empty($data)){
			
			
		$message .='<div class="row form-row hours-cont"><div class="col-12 col-md-10"><div class="row form-row"><div class="col-12 col-md-6"><div class="form-group"><label>Start Time</label>';
		$message .='<select class="form-control" name="start_time[]">';
		$message .= get_times(0.0); // <!--return from functions.php -->
		$message .= '</select>';
		$message .= '</div></div><div class="col-12 col-md-6"><div class="form-group"><label>End Time</label>';
		$message .= '<select class="form-control" name="end_time[]">';
		$message .= get_times(0.0); //<!--return from functions.php -->
		$message .= '</select>';
		$message .= '</div></div></div></div></div>';
	
		
	}else{
		$i=1;
		//print_r($data);
		foreach($data as $d){

		 $message .= '<div class="row form-row hours-cont"><div class="col-12 col-md-10"><div class="row form-row"><div class="col-12 col-md-6"><div class="form-group"><label>Start Time</label>';
		$message .= '<select class="form-control" name="start_time[]">';
		$message .= get_times(date('H:i',strtotime($d['start_time']))); // <!--return from functions.php -->
		$message .= '</select>';
		$message .= '</div></div><div class="col-12 col-md-6"><div class="form-group"><label>End Time</label>';
		$message .=	'<select class="form-control" name="end_time[]">';
		$message .= get_times(date('H:i',strtotime($d['end_time'])));// <!--return from functions.php -->
		$message .= '</select>';
		$message .= '</div></div></div></div>';
								if($i>1){ 
									$message .= '<div class="col-12 col-md-2"><label class="d-md-block d-sm-none d-none">&nbsp;</label><a href="#" class="btn btn-danger trash"><i class="far fa-trash-alt"></i></a></div>';
								 } $i++; 
				$message .='</div>';
	
			
		}//endforeach
		
	}//end if
	echo $message1.$message;
	}//end function		
	


	//code to add timing
	if($action == 'addtiming'){		
			$table 			= 'schedule_timing';
			$dr_id 			= $ajax->escape_string($_POST['dr_id']);
			$day 			= $ajax->escape_string($_POST['day']);
			$duration 		= $ajax->escape_string($_POST['duration']);
			$start_time 	= $_POST['start_time'];
			$end_time 		= $_POST['end_time'];			

			$length = count($start_time);
			if($length>0){
				$ajax->delete_data($table, array('dr_id'=>$dr_id, 'day'=>$day));
			}
			for($i=0;$i<$length;$i++){
				$stime = $start_time[$i];
				$etime = $end_time[$i];
				$data1 = array(
								'dr_id'		=> $dr_id,	
								'day'		=> $day,	
								'start_time'=> $stime,
								'end_time'	=> $etime,	
								'duration'	=> $duration
							);				
				$last = $ajax->insert_data2($table, $data1);				

			}			
		echo 1;		
	}


	//change timing status
	if($action == 'changestatustiming'){		
			$table 			= 'schedule_timing';
			$id 			= $ajax->escape_string($_POST['id']);
			$status 		= $ajax->escape_string($_POST['status']);
			$ajax->update_data2($table, array('active_status'=>$status), array('id'=>$id));	
			echo $id;
		
	}
	
	
	//code to show timing in modal box clinic
	if($action == 'showtimingclinic'){
		$clinic_id = $ajax->escape_string($_POST['clinic_id']);
		$day = $ajax->escape_string($_POST['day']);
		$duration = $ajax->escape_string($_POST['duration']);
		$data = $ajax->custom_query("SELECT * FROM clinic_timing WHERE clinic_id=$clinic_id AND day='$day' AND active_status=1");
		$message1 = "<input type='hidden' value='$day' name='day'/><input type='hidden' name='clinic_id' value='$clinic_id'/><input type='hidden' name='duration' value='$duration'/>";
		$message ='';
		if(empty($data)){
			
			
		$message .='<div class="row form-row hours-cont"><div class="col-12 col-md-10"><div class="row form-row"><div class="col-12 col-md-6"><div class="form-group"><label>Start Time</label>';
		$message .='<select class="form-control" name="start_time[]">';
		$message .= get_times(0.0); // <!--return from functions.php -->
		$message .= '</select>';
		$message .= '</div></div><div class="col-12 col-md-6"><div class="form-group"><label>End Time</label>';
		$message .= '<select class="form-control" name="end_time[]">';
		$message .= get_times(0.0); //<!--return from functions.php -->
		$message .= '</select>';
		$message .= '</div></div></div></div></div>';
	
		
	}else{
		$i=1;
		//print_r($data);
		foreach($data as $d){

		 $message .= '<div class="row form-row hours-cont"><div class="col-12 col-md-10"><div class="row form-row"><div class="col-12 col-md-6"><div class="form-group"><label>Start Time</label>';
		$message .= '<select class="form-control" name="start_time[]">';
		$message .= get_times(date('H:i',strtotime($d['start_time']))); // <!--return from functions.php -->
		$message .= '</select>';
		$message .= '</div></div><div class="col-12 col-md-6"><div class="form-group"><label>End Time</label>';
		$message .=	'<select class="form-control" name="end_time[]">';
		$message .= get_times(date('H:i',strtotime($d['end_time'])));// <!--return from functions.php -->
		$message .= '</select>';
		$message .= '</div></div></div></div>';
								if($i>1){ 
									$message .= '<div class="col-12 col-md-2"><label class="d-md-block d-sm-none d-none">&nbsp;</label><a href="#" class="btn btn-danger trash"><i class="far fa-trash-alt"></i></a></div>';
								 } $i++; 
				$message .='</div>';
	
			
		}//endforeach
		
	}//end if
	echo $message1.$message;
	}//end function	
	
	
	
	
	//code to add timing clinic
	if($action == 'addtimingclinic'){		
			$table 			= 'clinic_timing';
			$clinic_id 			= $ajax->escape_string($_POST['clinic_id']);
			$day 			= $ajax->escape_string($_POST['day']);
			$duration 		= $ajax->escape_string($_POST['duration']);
			$start_time 	= $_POST['start_time'];
			$end_time 		= $_POST['end_time'];			

			$length = count($start_time);
			if($length>0){
				$ajax->delete_data($table, array('clinic_id'=>$clinic_id, 'day'=>$day));
			}
			for($i=0;$i<$length;$i++){
				$stime = $start_time[$i];
				$etime = $end_time[$i];
				$data1 = array(
								'clinic_id'		=> $clinic_id,	
								'day'		=> $day,
								'duration' => $duration,
								'start_time'=> $stime,
								'end_time'	=> $etime
								
							);				
				$last = $ajax->insert_data2($table, $data1);				

			}			
		echo 1;		
	}


	//change timing status clinic
	if($action == 'changestatustimingclinic'){		
			$table 			= 'clinic_timing';
			$id 			= $ajax->escape_string($_POST['id']);
			$status 		= $ajax->escape_string($_POST['status']);
			//$ajax->update_data2($table, array('active_status'=>$status), array('id'=>$id));
			$ajax->delete_data($table, $id);
			echo $id;
		
	}
	
	
	
	//change review status
	if($action == 'changereviewstatus'){
		$id 			= $ajax->escape_string($_POST['id']);
		$status 		= $ajax->escape_string($_POST['sts']);
		$ajax->update_data2('review', array('active_status'=>$status), array('id'=>$id));
	}
	
	//change reply status
	if($action == 'changereplystatus'){
		$id 			= $ajax->escape_string($_POST['id']);
		$status 		= $ajax->escape_string($_POST['sts']);
		$ajax->update_data2('reply', array('active_status'=>$status), array('id'=>$id));
	}
	//change CLINIC review status
	if($action == 'changeclinicreviewstatus'){
		$id 			= $ajax->escape_string($_POST['id']);
		$status 		= $ajax->escape_string($_POST['sts']);
		$ajax->update_data2('clinic_review', array('active_status'=>$status), array('id'=>$id));
	}
	
	//change reply status
	if($action == 'changeclinicreplystatus'){
		$id 			= $ajax->escape_string($_POST['id']);
		$status 		= $ajax->escape_string($_POST['sts']);
		$ajax->update_data2('clinic_reply', array('active_status'=>$status), array('id'=>$id));
	}
	//change SERVICES review status
	if($action == 'changeservicereviewstatus'){
		$id 			= $ajax->escape_string($_POST['id']);
		$status 		= $ajax->escape_string($_POST['sts']);
		$ajax->update_data2('service_review', array('active_status'=>$status), array('id'=>$id));
	}
	
	//change reply status
	if($action == 'changeservicereplystatus'){
		$id 			= $ajax->escape_string($_POST['id']);
		$status 		= $ajax->escape_string($_POST['sts']);
		$ajax->update_data2('service_reply', array('active_status'=>$status), array('id'=>$id));
	}
	
	/*

		change booking status 
		send email to patient

	*/

	//change booking status
	if($action == 'chagebookingstatus'){		
			$table 			= 'booking';
			$id 			= $ajax->escape_string($_POST['id']);
			$status 		= $ajax->escape_string($_POST['sts']);
			$ajax->update_data2($table, array('process_status'=>$status), array('id'=>$id));	

			$q = "SELECT t1.booking_date, t1.booking_time, t1.duration, t2.email, t2.first_name, t3.first_name as drfirst_name, t3.last_name as drlast_name from booking as t1 JOIN patients as t2 on t1.patient_id=t2.id join doctors as t3 on t1.dr_id=t3.id WHERE t1.id=$id";
			
			$r = $ajax->custom_query($q);
			
			$recepient = $r[0]['email'];
			$first_name= $r[0]['first_name'];			
			$drfirst_name=$r[0]['drfirst_name'];
			$drlast_name=$r[0]['drlast_name'];
			$duration = $r[0]['duration'];
			$book_date = $r[0]['booking_date'];
			$book_time=$r[0]['booking_time'];

					$message = '';

					ob_start();
					//html template start
?>


					<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<meta charset="utf-8">
<!-- utf-8 works for most cases -->
<meta name="viewport" content="width=device-width">
<!-- Forcing initial-scale shouldn't be necessary -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Use the latest (edge) version of IE rendering engine -->
<meta name="x-apple-disable-message-reformatting">
<!-- Disable auto-scale in iOS 10 Mail entirely -->
<title></title>
<!-- The title tag shows in email notifications, like Android 4.4. -->

<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:200,300,400,600,700,800,900" rel="stylesheet">

<!-- CSS Reset : BEGIN -->
<style>
html, body {
	margin: 0 auto !important;
	padding: 0 !important;
	height: 100% !important;
	width: 100% !important;
	background: #f1f1f1;
}
* {
	-ms-text-size-adjust: 100%;
	-webkit-text-size-adjust: 100%;
}
div[style*="margin: 16px 0"] {
	margin: 0 !important;
}
table, td {
	mso-table-lspace: 0pt !important;
	mso-table-rspace: 0pt !important;
}
table {
	border-spacing: 0 !important;
	border-collapse: collapse !important;
	table-layout: fixed !important;
	margin: 0 auto !important;
}
img {
	-ms-interpolation-mode: bicubic;
}
a {
	text-decoration: none;
}
.unstyle-auto-detected-links *, .aBn {
	border-bottom: 0 !important;
	cursor: default !important;
	color: inherit !important;
	text-decoration: none !important;
	font-size: inherit !important;
	font-family: inherit !important;
	font-weight: inherit !important;
	line-height: inherit !important;
}
.a6S {
	display: none !important;
	opacity: 0.01 !important;
}
.im {
	color: inherit !important;
}
img.g-img + div {
	display: none !important;
}
@media only screen and (min-device-width: 320px) and (max-device-width: 374px) {
u ~ div .email-container {
	min-width: 320px !important;
}
}
@media only screen and (min-device-width: 375px) and (max-device-width: 413px) {
u ~ div .email-container {
	min-width: 375px !important;
}
}
@media only screen and (min-device-width: 414px) {
u ~ div .email-container {
	min-width: 414px !important;
}
}
</style>

<!-- CSS Reset : END -->

<!-- Progressive Enhancements : BEGIN -->
<style>
body {
	font-family: 'Nunito Sans', sans-serif;
	font-weight: 400;
	font-size: 15px;
	line-height: 1.8;
	color: rgba(0,0,0,.4);
}
h1, h2, h3, h4, h5, h6 {
	font-family: 'Nunito Sans', sans-serif;
	color: #000000;
	margin-top: 0;
}
a {
	color: #cf1b15;
}
.bg_white {
	background: #ffffff;
}
.bg-red{
	background: #cf1b15;
}
.email-section {
	padding: 2.5em;
}
.footer{
	padding: 5px 2.5em;
}

.btn {
	padding: 5px 15px;
	display: inline-block;
}
.btn.btn-primary {
	border-radius: 5px;
	background: #f5564e;
	color: #ffffff;
}



.logo {
	margin: 0;
}



.heading-section h2 {
	color: #cf1b15;
	font-size: 24px;
	margin-top: 0;
	line-height: 1.4;
	font-weight: 700;
}



</style>
</head>

<body width="100%" style="margin: 0; padding: 0 !important; mso-line-height-rule: exactly; background-color: #222222;">
<center style="width: 100%; background-color: #f1f1f1;">
   <div style="max-width: 600px; margin: 0 auto;"> 
    <!-- BEGIN BODY -->
    <table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="margin: auto;">
      <tr>
        <td valign="top" class="bg_white" style="padding:1em 2.5em .5em 2.5em;"><table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%">
            <tr>
              <td width="40%" class="logo" style="text-align: left;"><a href="#"><img src="<?php echo $site_url;?>assets/img/logo.png"></a></td>
              <td width="60%" style="text-align: right;"></td>
            </tr>
          </table></td>
      </tr>
      <!-- end tr -->
      <tr>
        <td valign="top" class="bg_white" style="line-height:0px;"><img src="<?php echo $site_url;?>assets/img/blog-2.jpg" style="width:100%"></td>
      </tr>
      <!-- end tr -->
      <tr>
        <td class="bg_white email-section" ><div class="heading-section">
            <h2 style="text-align:center;">Welcome To Canadian Medical Center</h2>
            <p>Dear <?php echo $first_name;?></p>
            
			<p>Your appointment approved with <strong>Dr. <?php echo $drfirst_name.' '.$drlast_name;?></strong> on <br>
					
						<strong><?php echo date('d-M-Y', strtotime($book_date)).' '. date('h:i A', strtotime($book_time));?> to 
						<?php echo date('h:i A', strtotime($book_time." +{$duration} minutes"));?></strong><br>
												
					
			</p>
          </div></td>
      </tr>
    </table>
    <table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="margin: auto;">
      <tr>
        <td valign="middle" class="bg-red footer"><table>
            <tr>
              <td valign="top" width="33.333%"><table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
                  <tr>
                    <td style="text-align: left; padding-right: 10px;"><p style="color:#fff;">&copy; 2020 CMC. All Rights Reserved</p></td>
                  </tr>
                </table></td>
              <td valign="top" width="33.333%"><table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
                  <tr>
                    <td style="text-align: right; padding-left: 5px; padding-right: 5px;">&nbsp;</td>
                  </tr>
                </table></td>
            </tr>
          </table></td>
      </tr>
    </table>
  </div>
</center>
</body>
</html>
	<?php 

			$message = ob_get_clean();

			if($status == 'approve'){
					include('class.Email.php');	//class to send email
				
				  	// Mail portion to send details to customer. 
				  	$Sender 		= $cmc_email;			  
				  	$Recipiant 		= $recepient;

				  	//** !!!! SEND AN HTML EMAIL w/ATTACHMENT !!!!
				  	//** create the new message using the to, from, and email subject.
				  	$msg = new Email($Recipiant, $Sender, "Appointment approved form CMC"); 

				  	//** set the message to be text only and set the email content.
				  	$htmlVersion="$message";
				  	$msg->TextOnly = false;
				  	$msg->Content = $htmlVersion;
				  
				  	//** send the email message.			
				  	$SendSuccess = $msg->Send();
			}
			//print_r($r);
			echo 1;
		
	}
	//change booking status
	if($action == 'changeclinicbookingstatus'){		
			$table 			= 'clinic_booking';
			$id 			= $ajax->escape_string($_POST['id']);
			$status 		= $ajax->escape_string($_POST['sts']);
			$ajax->update_data2($table, array('process_status'=>$status), array('id'=>$id));	

			$q = "SELECT t1.booking_date, t1.booking_time, t1.duration, t2.email, t2.first_name, t3.clinics_name, t4.service_name from clinic_booking as t1 JOIN patients as t2 on t1.patient_id=t2.id join clinics as t3 on t1.cid=t3.id join treatmentservices as t4 on t1.sid=t4.id WHERE t1.id=$id";
			
			$r = $ajax->custom_query($q);
			
			$recepient = $r[0]['email'];
			$first_name= $r[0]['first_name'];			
			$clinics_name=$r[0]['clinics_name'];
			$service_name=$r[0]['service_name'];
			$duration = $r[0]['duration'];
			$book_date = $r[0]['booking_date'];
			$book_time=$r[0]['booking_time'];

					$message = '';

					ob_start();
					//html template start
?>


					<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<meta charset="utf-8">
<!-- utf-8 works for most cases -->
<meta name="viewport" content="width=device-width">
<!-- Forcing initial-scale shouldn't be necessary -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Use the latest (edge) version of IE rendering engine -->
<meta name="x-apple-disable-message-reformatting">
<!-- Disable auto-scale in iOS 10 Mail entirely -->
<title></title>
<!-- The title tag shows in email notifications, like Android 4.4. -->

<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:200,300,400,600,700,800,900" rel="stylesheet">

<!-- CSS Reset : BEGIN -->
<style>
html, body {
	margin: 0 auto !important;
	padding: 0 !important;
	height: 100% !important;
	width: 100% !important;
	background: #f1f1f1;
}
* {
	-ms-text-size-adjust: 100%;
	-webkit-text-size-adjust: 100%;
}
div[style*="margin: 16px 0"] {
	margin: 0 !important;
}
table, td {
	mso-table-lspace: 0pt !important;
	mso-table-rspace: 0pt !important;
}
table {
	border-spacing: 0 !important;
	border-collapse: collapse !important;
	table-layout: fixed !important;
	margin: 0 auto !important;
}
img {
	-ms-interpolation-mode: bicubic;
}
a {
	text-decoration: none;
}
.unstyle-auto-detected-links *, .aBn {
	border-bottom: 0 !important;
	cursor: default !important;
	color: inherit !important;
	text-decoration: none !important;
	font-size: inherit !important;
	font-family: inherit !important;
	font-weight: inherit !important;
	line-height: inherit !important;
}
.a6S {
	display: none !important;
	opacity: 0.01 !important;
}
.im {
	color: inherit !important;
}
img.g-img + div {
	display: none !important;
}
@media only screen and (min-device-width: 320px) and (max-device-width: 374px) {
u ~ div .email-container {
	min-width: 320px !important;
}
}
@media only screen and (min-device-width: 375px) and (max-device-width: 413px) {
u ~ div .email-container {
	min-width: 375px !important;
}
}
@media only screen and (min-device-width: 414px) {
u ~ div .email-container {
	min-width: 414px !important;
}
}
</style>

<!-- CSS Reset : END -->

<!-- Progressive Enhancements : BEGIN -->
<style>
body {
	font-family: 'Nunito Sans', sans-serif;
	font-weight: 400;
	font-size: 15px;
	line-height: 1.8;
	color: rgba(0,0,0,.4);
}
h1, h2, h3, h4, h5, h6 {
	font-family: 'Nunito Sans', sans-serif;
	color: #000000;
	margin-top: 0;
}
a {
	color: #cf1b15;
}
.bg_white {
	background: #ffffff;
}
.bg-red{
	background: #cf1b15;
}
.email-section {
	padding: 2.5em;
}
.footer{
	padding: 5px 2.5em;
}

.btn {
	padding: 5px 15px;
	display: inline-block;
}
.btn.btn-primary {
	border-radius: 5px;
	background: #f5564e;
	color: #ffffff;
}



.logo {
	margin: 0;
}



.heading-section h2 {
	color: #cf1b15;
	font-size: 24px;
	margin-top: 0;
	line-height: 1.4;
	font-weight: 700;
}



</style>
</head>

<body width="100%" style="margin: 0; padding: 0 !important; mso-line-height-rule: exactly; background-color: #222222;">
<center style="width: 100%; background-color: #f1f1f1;">
   <div style="max-width: 600px; margin: 0 auto;"> 
    <!-- BEGIN BODY -->
    <table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="margin: auto;">
      <tr>
        <td valign="top" class="bg_white" style="padding:1em 2.5em .5em 2.5em;"><table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%">
            <tr>
              <td width="40%" class="logo" style="text-align: left;"><a href="#"><img src="<?php echo $site_url;?>assets/img/logo.png"></a></td>
              <td width="60%" style="text-align: right;"></td>
            </tr>
          </table></td>
      </tr>
      <!-- end tr -->
      <tr>
        <td valign="top" class="bg_white" style="line-height:0px;"><img src="<?php echo $site_url;?>assets/img/blog-2.jpg" style="width:100%"></td>
      </tr>
      <!-- end tr -->
      <tr>
        <td class="bg_white email-section" ><div class="heading-section">
            <h2 style="text-align:center;">Welcome To Canadian Medical Center</h2>
            <p>Dear <?php echo $first_name;?></p>
            
			<p>Your booking approved in <strong><?php echo $clinics_name;?></strong> on <br>
					
						<strong><?php echo date('d-M-Y', strtotime($book_date)).' '. date('h:i A', strtotime($book_time));?> to 
						<?php echo date('h:i A', strtotime($book_time." +{$duration} minutes"));?></strong><br>
							for <br><strong><?php echo $service_name;?></strong>					<br>
					
			</p>
          </div></td>
      </tr>
    </table>
    <table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="margin: auto;">
      <tr>
        <td valign="middle" class="bg-red footer"><table>
            <tr>
              <td valign="top" width="33.333%"><table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
                  <tr>
                    <td style="text-align: left; padding-right: 10px;"><p style="color:#fff;">&copy; <?php echo date('Y'); ?> CMC. All Rights Reserved</p></td>
                  </tr>
                </table></td>
              <td valign="top" width="33.333%"><table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
                  <tr>
                    <td style="text-align: right; padding-left: 5px; padding-right: 5px;">&nbsp;</td>
                  </tr>
                </table></td>
            </tr>
          </table></td>
      </tr>
    </table>
  </div>
</center>
</body>
</html>
	<?php 

			$message = ob_get_clean();

			if($status == 'approve'){
					include('class.Email.php');	//class to send email
				
				  	// Mail portion to send details to customer. 
				  	$Sender 		= $cmc_email;			  
				  	$Recipiant 		= $recepient;

				  	//** !!!! SEND AN HTML EMAIL w/ATTACHMENT !!!!
				  	//** create the new message using the to, from, and email subject.
				  	$msg = new Email($Recipiant, $Sender, "Booking approved form CMC"); 

				  	//** set the message to be text only and set the email content.
				  	$htmlVersion="$message";
				  	$msg->TextOnly = false;
				  	$msg->Content = $htmlVersion;
				  
				  	//** send the email message.			
				  	$SendSuccess = $msg->Send();
			}
			//print_r($r);
			echo 1;
		
	}
?>
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY