sanitize($_GET['keyword']); $bind_keyword = "%".$keyword."%"; } else { $keyword = ""; $bind_keyword = $keyword; } if (empty($keyword)) { $sql_query = "SELECT id, title, message, image, link FROM tbl_fcm_template ORDER BY id DESC"; } else { $sql_query = "SELECT id, title, message, image, link FROM tbl_fcm_template WHERE title LIKE ? ORDER BY id DESC"; } $stmt = $connect->stmt_init(); if ($stmt->prepare($sql_query)) { // Bind your variables to replace the ?s if (!empty($keyword)) { $stmt->bind_param('s', $bind_keyword); } // Execute query $stmt->execute(); // store result $stmt->store_result(); $stmt->bind_result( $data['id'], $data['title'], $data['message'], $data['image'], $data['link'] ); // get total records $total_records = $stmt->num_rows; } // check page parameter if (isset($_GET['page'])) { $page = $_GET['page']; } else { $page = 1; } // number of data that will be display per page $offset = 10; //lets calculate the LIMIT for SQL, and save it $from if ($page) { $from = ($page * $offset) - $offset; } else { //if nothing was given in page request, lets load the first page $from = 0; } if (empty($keyword)) { $sql_query = "SELECT id, title, message, image, link FROM tbl_fcm_template ORDER BY id DESC LIMIT ?, ?"; } else { $sql_query = "SELECT id, title, message, image, link FROM tbl_fcm_template WHERE title LIKE ? ORDER BY id DESC LIMIT ?, ?"; } $stmt_paging = $connect->stmt_init(); if ($stmt_paging ->prepare($sql_query)) { // Bind your variables to replace the ?s if (empty($keyword)) { $stmt_paging ->bind_param('ss', $from, $offset); } else { $stmt_paging ->bind_param('sss', $bind_keyword, $from, $offset); } // Execute query $stmt_paging ->execute(); // store result $stmt_paging ->store_result(); $stmt_paging->bind_result( $data['id'], $data['title'], $data['message'], $data['image'], $data['link'] ); // for paging purpose $total_records_paging = $total_records; } // if no data on database show "No Reservation is Available" if ($total_records_paging == 0) { ?>

MANAGE NOTIFICATION


Title Message Url Action
Wopps! No data found with the keyword you entered.

MANAGE NOTIFICATION


fetch()) { ?>
Title Image Message Url Action
no_url 50) $value = substr($value, 0, 47) . '...'; echo $value; ?> notifications_active mode_edit delete

doPages($offset, 'push-notification.php', '', $total_records, $keyword); ?>