$vv ){ $mysqli->query( "UPDATE request_gallery SET status = '".$update_status."' WHERE gallery_id = '".$kk."'" ) ; if ( $update_status == 'rejected' ){ pushToUserCron( 'request_gallery', $kk, $vv, 'Request Gallery', 'Request gallery has been reject.' ) ; }else{ pushToUserCron( 'request_gallery', $kk, $vv, 'Request Gallery', 'Request gallery has been update.' ) ; } } header( "Refresh: 0;" ) ; exit ; } //query $search_query = '' ; $search_name = escapeString($_GET['search_name']) ; $search_idno = escapeString($_GET['search_idno']) ; $search_status = escapeString($_GET['search_status']) ; $search_date = ( $_GET['search_date'] != '' ? date('Y-m-d', strtotime($_GET['search_date'])) : '' ) ; $search_query = '' ; if ( $search_name != ''){ $search_query .= " AND b.staff_name LIKE '%".$search_name."%'" ; } if ( $search_idno != ''){ $search_query .= " AND b.staff_idno LIKE '%".$search_idno."%'" ; } if ( $search_status != ''){ $search_query .= " AND a.status = '".$search_status."'" ; } if ( $search_date != '' ){ $search_query .= " AND a.created_at LIKE '%".$search_date."%'" ; } // related staff // pagination if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) $start_from = ($product_page - 1) * LIMIT ; //end next and prev page // set search url $search_url = 'search_name='.$search_name.'&search_idno='.$search_idno.'&search_status='.$search_status.'&search_date='.$search_date ; // page query $mysqli_query = "SELECT a.gallery_id, a.title, a.file, a.status, a.created_at, a.updated_at, b.staff_id, b.staff_idno, b.staff_name FROM request_gallery a LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) WHERE a.deleted_at IS NULL " . $search_query ; $mysqli_list = $mysqli->query( $mysqli_query." ORDER BY a.gallery_id DESC LIMIT $start_from, " . LIMIT ) ; // load pagination $page_pagination = nextPrevious( $product_page, LIMIT, $search_url, $mysqli_query ) ; // start header here include 'requires/page_header.php'; include 'requires/page_top.php'; ?>