tabalinas / jsgrid

Lightweight Grid jQuery Plugin
http://js-grid.com
MIT License
1.52k stars 352 forks source link

JS grid load data above 5000 #1425

Open PankajaRajput opened 1 year ago

PankajaRajput commented 1 year ago

notification.php

fetch_data.php

$method = $_SERVER['REQUEST_METHOD'];

if($method == 'GET') { $data = array( ':first_name' => "%" . $_GET['first_name'] . "%", ':last_name' => "%" . $_GET['last_name'] . "%", ':client_phone' => "%" . $_GET['client_phone'] . "%", ':txtmessage' => "%" . $_GET['txtmessage'] . "%", ':direction' => "%" . $_GET['direction'] . "%", ':message_status' => "%" . $_GET['message_status'] . "%", ':created_at' => "%" . $_GET['created_at'] . "%", );

$query = "select *,c.first_name,c.last_name,c.txtphone,p.project_name from crm_notifications as n left JOIN crm_clients as c ON c.client_id=n.client_id left JOIN crm_projects as p ON p.project_id=n.project_id WHERE c.first_name LIKE :first_name AND c.last_name LIKE :last_name AND n.client_phone LIKE :client_phone AND n.txtmessage LIKE :txtmessage AND n.direction LIKE :direction AND n.message_status LIKE :message_status AND n.created_at LIKE :created_at ORDER BY created_at DESC";

$statement = $connect->prepare($query); $statement->execute($data); $result = $statement->fetchAll();

foreach($result as $row) { if($row['message_status']=='Delivered'){ $ststusclass="text-success"; } elseif($row['message_status']=='Failed' || $row['message_status']=='Invalid'){ $ststusclass="text-danger"; } elseif ($row['message_status']=='Reply') { $ststusclass="text-warning"; } elseif ($row['message_status']=='Received') { $ststusclass="text-primary"; } else{ $ststusclass=""; }

$directionclass= ($row['direction']=='Incoming')?'text-warning':'text-success';

$direction= "".$row['direction'].""; $status = "".$row['message_status']."";

$output[] = array( 'first_name' => $row['first_name'], 'last_name' => $row['last_name'], 'client_phone' => $row['client_phone'], 'txtmessage' => $row['txtmessage'], 'direction' => $direction, 'message_status' => $status, 'created_at' => date("Y-m-d",strtotime($row['created_at'])), ); } //till here getting 4000 records but not proceeding with json encode

header("Content-Type: application/json"); echo json_encode($output); }

'll return no data to jsgrid