| Current Path : /home2/wtmwscom/public_html/admin/report/ |
| Current File : /home2/wtmwscom/public_html/admin/report/closing_date_json.php |
<?php
session_start();
include "../../connection.php";
include '../../function_lib.php';
$data = array();
$query_select = " c.* ";
$query = " from closing_date AS c ";
//$query .=!empty($_REQUEST['income_type']) ? " AND i.income_type='" . $_REQUEST['income_type'] . "'" : '';
//$query .=!empty($_REQUEST['from_date']) && !empty($_REQUEST['to_date']) ? " AND (i.datetime BETWEEN '" . $_REQUEST['from_date'] . "' AND '" . $_REQUEST['to_date'] . "') " : '';
//$query .=!empty($_REQUEST['closing_date']) ? " AND c.closing_date='" . $_REQUEST['closing_date'] . "'" : '';
//$query .= " ORDER BY i.`datetime` DESC";
$totalRecordCount = mysqli_fetch_object(mysqli_query($connection, "SELECT COUNT(c.recid) as count " . $query))->count;
$query_limit = $_REQUEST['length'] == -1 ? '' : " LIMIT " . $_REQUEST['start'] . ", " . $_REQUEST['length'];
$query_final = "SELECT " . $query_select . $query . $query_limit;
//echo $query_final;
$result = mysqli_query($connection, $query_final);
$sno = $_REQUEST['start'] + 1;
while ($row = mysqli_fetch_assoc($result)) {
$row['sno'] = $sno;
// $row['income_type'] = $master_income_type_array[$row['income_type']];
// $row['datetime'] = date("d/m/Y", strtotime($row['datetime']));
// $row['payment_status'] = $row['payment_status'] == 1 ? "Paid" : "Unpaid";
// $row['payment_date'] = !empty($row['payment_date']) ? date("d/m/Y h:i A", strtotime($row['payment_date'])) : '';
$row['status'] = $row['status'] == 1 ? "Closed" : "Unclosed";
$row['closing_date'] = !empty($row['closing_date']) ? date("d/m/Y h:i A", strtotime($row['closing_date'])) : '';
$data[] = $row;
$sno++;
}
$json_array = array('data' => $data, 'recordsFiltered' => $totalRecordCount, 'recordsTotal' => $totalRecordCount);
echo json_encode($json_array);
?>