Example #1
0
 public function action_index()
 {
     $d = $this->verify_criteria($this->get_criteria_form());
     if ($d) {
         $d = $this->get_criteria($d, ['status' => [St::VALID, St::INVALID], 'order' => 'id']);
         $count = Model_Db_User::count_by($d);
         $page = Page::get_page('admin/user', $d, $count, Config::get('site.admin.page_limit.user'));
         $list = Model_Db_User::by($d, $page);
     }
     $d['count'] = $count ?: 0;
     $d['list'] = $list ?: [];
     $d['order_list'] = Model_Db_User::$order;
     $d['offset'] = $page->offset;
     $d['per_page'] = $page->per_page;
     $this->template->content = View_Smarty::forge('admin/user/index', $d)->set_safe('pagination', $page);
 }
Example #2
0
<?php

include 'includes/inc.php';
include "includes/classes/class.page.php";
$page = new Page();
$arr = NULL;
$data = NULL;
if (isset($_GET['act']) && $_GET['act'] == 'edit' && isset($_GET['id'])) {
    $id = $_GET['id'];
    $data = $page->get_page($id);
}
if (isset($_POST['addpage']) && $_POST['addpage'] == 'addpage') {
    if (isset($_POST['id']) && $_POST['id'] != '') {
        $arr['id'] = $_POST['id'];
        $arr['page_title'] = $_POST['page_title'];
        $arr['page_content'] = $_POST['page_content'];
        $arr['status'] = $_POST['status'];
        if ($page->update_page($arr)) {
            header('Location: http://wmlmusicguide.com/site/admin/master_admin/viewpages.php?act=updated');
            exit;
        } else {
            header('Location: http://wmlmusicguide.com/site/admin/master_admin/addpage.php?success=fail');
            exit;
        }
    } else {
        $arr['page_title'] = $_POST['page_title'];
        $arr['page_content'] = $_POST['page_content'];
        $arr['status'] = $_POST['status'];
        if ($page->add_page($arr)) {
            header('Location: http://wmlmusicguide.com/site/admin/master_admin/viewpages.php?act=added');
            exit;