This commit is contained in:
Suvodip
2024-05-29 12:14:29 +05:30
parent 4be0d0963e
commit d195bc0607
4 changed files with 78 additions and 13 deletions

View File

@@ -221,9 +221,13 @@
try {
$searchTerm =isset($_GET['search']) ? $_GET['search'] : "%";
$businessVertical =isset($_GET['bv']) ? $_GET['bv'] : "%";
$dateForFilter = date('Y-m-d');
// Add one day to the current date
$new_date = date('Y-m-d', strtotime($dateForFilter . ' +1 day'));
// echo $businessVertical;
$start_date = isset($_GET['start_date']) ? $_GET['start_date'] : '2014-05-05';
$end_date = isset($_GET['end_date']) ? $_GET['end_date'] : date('Y-m-d');
$end_date = isset($_GET['end_date']) ? $_GET['end_date'] : $new_date;
$start_time = microtime(true);
$resultsPerPage = 200;
$page =isset($_GET['page']) ? $_GET['page'] : 1;
@@ -233,12 +237,14 @@
$placeholderString = implode(',', array_fill(0, count($accessArray), '?'));
//first query to get the total number for pagination
$sql= "SELECT COUNT(*) FROM cleads WHERE (name LIKE :searchTerm OR phone LIKE :searchTerm OR id LIKE :searchTerm OR email LIKE :searchTerm ) AND time BETWEEN :start_date AND :end_date ";
// WHERE (name LIKE :searchTerm OR phone LIKE :searchTerm OR id LIKE :searchTerm OR email LIKE :searchTerm ) AND time BETWEEN :start_date AND :end_date
$sql= "SELECT COUNT(*) FROM cleads ";
$stmt = $conn->prepare($sql);
// $stmt->bindValue(':businessVertical', "%".$businessVertical."%");
$stmt->bindValue(':searchTerm', "%".$searchTerm."%");
$stmt->bindValue(':start_date', $start_date);
$stmt->bindValue(':end_date', $end_date);
// $stmt->bindValue(':searchTerm', "%".$searchTerm."%");
// $stmt->bindValue(':start_date', $start_date);
// $stmt->bindValue(':end_date', $end_date);
$stmt->execute();
$totalRows = $stmt->fetchColumn();