query("INSERT INTO system_post (post_type, post_categories, post_date, post_modified) VALUES ('page-notification', 'page-notification', '".TODAYDATE."', '".TODAYDATE."')") ; $page = $mysqli->insert_id ; } // check query exsits $mysqli_page = $mysqli->query("SELECT * FROM system_post WHERE post_id = '".$page."' AND post_type = 'page-notification' LIMIT 1"); if ($mysqli_page->num_rows > 0){ // update database if (isset($type) && $type == 'edit' && $_POST['hide'] == 1){ // keep value in variable $page_title = escapeString($_POST['title']) ; $page_title = ($page_title != '' ? $page_title : 'No Title') ; // check if name already exists. $check_status = checkTitle($page_title, $page) ; $title = $check_status['title'] ; $status = $check_status['status'] ; // set image in variable $image = $_FILES["image"]["name"] ; // remove photo $remove_photo = $_POST['remove_photo'] ; if ($remove_photo == 1){ $image = '' ; $image_query = "post_file = ''," ; } // update database $mysqli->query("UPDATE system_post SET post_title = '".$page_title."', post_status = '".$status."', post_link = '".$title."', ".$image_query." post_modified = '".TODAYDATE."', post_trash = '0' WHERE post_id = '".$page."'") ; // resize image $create_image = reCreateImage('Product', $page, $page, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; // Image uploads when exists if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ $resizeObj = new resize($create_image['original']) ; // Initialise load image foreach($create_image['crop'] as $value){ // Resize image (options: exact, portrait, landscape, auto, crop) $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; $resizeObj -> saveImage($value['source'], 70) ; // Save image } // update database $mysqli->query("UPDATE system_post SET post_file = '".$create_image['image']."' WHERE post_id = '".$page."'"); } // refresh page header("Location:page-notification.php?page_mode=edit&page=".$page."&success=1") ; $_SESSION['system_result'] = 'success-updated' ; exit ; } // start header here include 'requires/page_header.php' ; include 'requires/page_top.php' ; // keep query value in array $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; ?>
'. $lang['thank_you_your_notification_has_been_updated'].'
' ; break ; } unset($_SESSION['system_result']) ; } ?>
0){ foreach($sortable as $key => $value){ $mysqli->query("UPDATE system_post SET post_order = '".$value."' WHERE post_id = '".$key."'") ; } } // trash item switch($_POST['page_action']){ case 'trash': $mysqli_query = "UPDATE " . system_post . " SET post_trash = '1' WHERE post_id = " ; $trash_page = trashPage('post', $mysqli, $mysqli_query, $_POST['multiple_trash']) ; break; } } // 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='.$search.'&search_title='.$search_title.'&search_date='.$search_date.'&page_mode='.$page_mode ; // page query $mysqli_query = "SELECT * FROM system_post WHERE post_title != '' AND post_type = 'page-notification' AND post_trash = '0'".$search_query ; $mysqli_page = $mysqli->query($mysqli_query." ORDER BY post_order 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' ; ?>
num_rows > 0){ while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ // title $title = dataFilter($row_page['post_title']) ; echo ' '; } }else{ echo ' ' ; } ?>
'.$title.' '.resetDateFormat($row_page['post_date']).'
'.$lang['no_data'].'