public function edit($ID)
 {
     if (!$this->session->userdata('LoggedIn') && $this->session->userdata('UserNum') <= 0) {
         redirect('/portal/login', 301);
         exit;
     }
     $survey = $this->portal_model->get_survey($ID);
     $this->smarty_data['surveys'] = $survey;
     //var_dump($survey);
     $tpl = getTPL('portal/edit');
     $this->smarty_tpl->displaytpl($tpl, @$this->smarty_data);
 }
 public function error()
 {
     if ($this->session->userdata('error')) {
         $this->smarty_data['Error'] = $this->session->userdata('error');
         $this->smarty_data['Errors'] = $this->session->userdata('errors');
         $this->smarty_data['Data'] = $this->session->userdata('data');
         $this->smarty_data['Message'] = $this->session->userdata('message');
         $this->session->unset_userdata('error');
         $this->session->unset_userdata('errors');
         $this->session->unset_userdata('data');
         $this->session->unset_userdata('message');
         $tpl = getTPL('error');
         $this->smarty_tpl->displaytpl($tpl, @$this->smarty_data);
     } else {
         $this->session->unset_userdata('error');
         $this->session->unset_userdata('errors');
         $this->session->unset_userdata('data');
         $this->session->unset_userdata('message');
         show_404();
     }
 }
 public function index()
 {
     ////// Check and get the template file ////////
     $tpl = getTPL('dashboard/index');
     $this->smarty_tpl->displaytpl($tpl, @$this->smarty_data);
 }
Example #4
0
<?php

include_once 'common.php';
#log
error_log(getDatetime() . " action->" . phpSelfname() . "\n", "3", getPath() . "console.log");
#check session
$user = !empty($_SESSION['user']) ? $_SESSION['user'] : header("Location:" . htaccess('admin/core/login.php?t=timeout'));
#main
include_once getTPL();
Example #5
0
    $id = @$_POST["id"];
    $catname = @$_POST["catname"];
    $status = @$_POST["status"];
    $template_list = @$_POST["template_list"];
    $template_show = @$_POST["template_show"];
    $pagesize = @$_POST["pagesize"];
    #if
    if (!empty($catname) && !empty($pagesize)) {
        if (empty($template_list)) {
            $template_list = "house_list.html";
        }
        if (empty($template_show)) {
            $template_show = "house_show.html";
        }
        #sql
        $sql = "insert into " . tablePrefix() . "house_category (catname,status,template_list,template_show,pagesize) values (?,?,?,?,?)";
        $sql_data = array($catname, $status, $template_list, $template_show, $pagesize);
        if (!empty($id)) {
            $sql = "update " . tablePrefix() . "house_category set catname=?,status=?,template_list=?,template_show=?,pagesize=? where id = ?";
            $sql_data[] = $id;
        }
        #execute
        _execute($sql, $sql_data);
        #tishi
        $error = "操作成功";
    } else {
        $error = "操作失败,缺少必要参数";
    }
    include_once getTPL("tishi");
    exit;
}
Example #6
0
//status
if (!empty($type) && $type == "status") {
    #param
    $status = @$_GET["status"];
    $id = @$_GET["id"];
    #update
    if (!empty($id)) {
        if ($status != null && $status == "0") {
            $status = 1;
        } else {
            $status = 0;
        }
        $sql = "update " . tablePrefix() . "house_village set status =? where id = ?";
        _execute($sql, array($status, $id));
        $error = "操作成功";
    } else {
        $error = "操作失败,缺少必要参数";
    }
    #tpl
    include_once getTPL("tishi");
    exit;
}
//edit
if (!empty($type) && $type == 'edit') {
    #地区
    $sql_dq = "select id,name,parent_id from " . tablePrefix() . "house_area where status= 0 order by id asc";
    $arr_dq = _select($sql_dq);
    #tpl
    include_once getTPL("house_village-edit");
    exit;
}