ok

Mini Shell

Direktori : /proc/self/root/home2/selectio/www/thedentalpark.com/admin/data-tables/
Upload File :
Current File : //proc/self/root/home2/selectio/www/thedentalpark.com/admin/data-tables/patient_list.php

<?php 
include"../config/config.php";

$requestData = $_REQUEST;

        $columns = array( 
            0 =>'id', 
            1 =>'id', 
            2 =>'id',
            3 =>'id',
            4 =>'id',
            5 =>'id',
            6 =>'id',
            7 =>'id',
            8 =>'id',
            9 =>'id'
           
        );
        
$conditions="";

$patient_number1 = $_POST['patient_number1'];
$patient_name = $_POST['patient_name'];

if($patient_number1!=""){
    $conditions.=" and patient_number1=".$patient_number1;
}
if($patient_name!=""){
    $conditions.=" and patient_name="."'$patient_name'";
}


$sql_query = "SELECT * from tbl_appointment_booking";
        
/*Fetch All Data Start*/        
        $statement = $pdo->prepare("$sql_query WHERE 1=1  ".$conditions." ORDER BY date desc");
		$statement->execute();
		$query = $statement->fetchAll(PDO::FETCH_ASSOC);
		$totalData = $statement->rowCount();
        $totalFiltered = $totalData;
/*Fetch All Data End*/       
        
/*Fetch Filter Data Start*/    
         $sql = "$sql_query WHERE 1=1  ".$conditions;
         
        if( !empty($_REQUEST['search'])){   
        	$sql.=" AND (patient_name LIKE '%".$_REQUEST['search']."%' 
        	            OR patient_number1 LIKE '%".$_REQUEST['search']."%'
        	            OR patient_number2 LIKE '%".$_REQUEST['search']."%' ) ";    
        }
        
/*Fetch Filter Data End*/       
        


         $sql.=" ORDER BY ". $columns[$requestData['order'][0]['column']]."   ".$requestData['order'][0]['dir']."  LIMIT ".$requestData['start']." ,".$requestData['length']."   ";
       	
        $statement = $pdo->prepare($sql);
        $statement->execute();
		$query = $statement->fetchAll(PDO::FETCH_ASSOC);

$data = array();
// error_log($sql);
$i=1;
foreach($query as $row){ 
	$nestedData = array();
	
	$nestedData[] = "<div class='text-center'>".$i."</div>";
	$nestedData[] = "<div class='text-center'>".$row["patient_name"]."</div>";
	$nestedData[] = "<div class='text-center'>".$row["patient_number1"]."</div>";
	$nestedData[] = "<div class='text-center'>".$row['patient_number2']."</div>";
	$nestedData[] = "<div class='text-center'>".$row['address']."</div>";
        	
	$data[] = $nestedData;
	$i++;
	

}

$json_data = array(
			"draw"            => intval($requestData['draw']),  
			"recordsTotal"    => intval($totalData),  
			"recordsFiltered" => intval($totalFiltered), 
			"data"            => $data   
			);

echo json_encode($json_data); 




?>

Zerion Mini Shell 1.0