Esempio n. 1
0
 public function doadd()
 {
     if ($_SESSION['authId'] != 1) {
         alert('无权操作!', 1);
     }
     $admin = M('admin');
     $data['username'] = $_POST['username'];
     if ($admin->where('username=\'' . $_POST['username'] . '\'')->find()) {
         alert('用户名已存在!', 1);
     }
     if (empty($_POST['password'])) {
         alert('密码不能为空!', 1);
     }
     $data['lastlogintime'] = time();
     Load('extend');
     $data['lastloginip'] = get_client_ip();
     $data['password'] = md5('wk' . $_POST['password'] . 'cms');
     $role = M('role_admin');
     if ($admin->add($data)) {
         $map['user_id'] = $admin->where('username=\'' . $_POST['username'] . '\'')->getField('id');
         $map['role_id'] = 1;
         $role->add($map);
         alert('操作成功!密码为:' . $_POST['password'], U('Admin/index'));
     }
     alert('操作失败!', 1);
 }
Esempio n. 2
0
 /**
  * 最新资讯
  */
 public function index()
 {
     // 渲染TDK
     $this->tdk(4);
     // 导航高亮
     $this->assign('highline', 4);
     // 渲染导航条
     $this->navigation();
     // 渲染右边悬浮框
     $this->right();
     // 资讯分类
     $category = M('NewsCategory')->order("add_time ASC")->select();
     if ($category) {
         $id = isset($_GET['category']) ? intval($_GET['category']) : $category[0]['id'];
         if (!M('NewsCategory')->where(array('id' => $id))->count()) {
             $this->redirect('/news/index?category=' . $category[0]['id']);
         }
         Load('extend');
         import('ORG.Util.Page');
         $news = M('News');
         $count = $news->where(array('category_id' => $id))->count();
         $page = new Page($count, 10);
         $page->setConfig('theme', "共  %totalRow%  %header%  %nowPage%/%totalPage%页  %upPage% %downPage% %first% %prePage% %linkPage% %nextPage%  %end%");
         $page->setConfig('header', '篇资讯');
         $show = $page->show();
         $newsLists = $news->where(array('category_id' => $id))->order("add_time DESC")->limit($page->firstRow, $page->listRows)->select();
         $this->assign('newsLists', $newsLists);
         $this->assign('count', ceil($count / 10));
         $this->assign('page', $show);
         $this->assign('category', $category);
     }
     $this->assign('id', $id);
     $this->display();
 }
Esempio n. 3
0
 /**
  * 系统初始化方法
  *
  * @access protected
  */
 protected function _initialize()
 {
     header("Content-type:text/html;charset=utf-8");
     Load('extend');
     $this->ajax = $this->IS_AJAX;
     $this->post = strtolower($_SERVER['REQUEST_METHOD']) == 'post';
     $this->ip = get_client_ip();
     $this->timestamp = time();
     $this->root_path = dirname($_SERVER['PHP_SELF']);
     $this->root_path = $this->root_path == '\\' || $this->root_path == '/' ? '' : $this->root_path;
     define('__ROOT_PATH__', $this->root_path);
     C('TMPL_PARSE_STRING.__ROOT_PATH__', __ROOT_PATH__);
     $this->site_cfg = F('site_cfg');
     $this->assign('site_cfg', $this->site_cfg);
     define('__TPL_PATH__', '/Application/Home/View');
     C('TMPL_PARSE_STRING.__TPL_PATH__', __TPL_PATH__);
     $this->upload_dir = $this->root_path . '/upload/';
     define('__UPLOAD_PATH__', $this->upload_dir);
     C('TMPL_PARSE_STRING.__UPLOAD_PATH__', __UPLOAD_PATH__);
     // 如果当前用户验证身份cookie有效则获取相用户信息
     $_SESSION['auth'] = isset($_SESSION['auth']) ? $_SESSION['auth'] : '';
     if ($_SESSION['auth'] != '' && $this->validAuthCookie()) {
         C('formtoken_extra', $this->user['mid'] . $this->user['password']);
     }
     if (method_exists($this, '_init')) {
         $this->_init();
     }
 }
 public function _initialize()
 {
     if (!isset($_COOKIE['username']) || !isset($_COOKIE['usernumber'])) {
         $this->redirect('Admin/Index/login');
     }
     Load('extend');
 }
Esempio n. 5
0
 public function index()
 {
     $news = M("news")->select();
     $this->assign('news', $news);
     // $type=M("type")->select();
     // $this->assign('type',Tool::tree($type));
     Load('extend');
     //加载扩展方法
     $type = D('type');
     // $data['type'] = 'type';
     $list = $type->order('id asc')->select();
     //实现同级节点排序
     $list = list_to_tree($list, 'id', 'tid');
     //详细参数见手册
     // dump($list);
     $this->assign('type', $list);
     $data['typeid'] = $_GET["_URL_"][3];
     // dump($data);
     if (is_null($data['typeid'])) {
         # code...
         $this->assign('new', $news[0]);
         //dump($news[0]);
     } else {
         $new = M('news')->where($data)->select();
         $this->assign('new', $new[0]);
         // dump($new);
     }
     $this->display();
 }
Esempio n. 6
0
 public function index()
 {
     Load('extend');
     //加载扩展函数,模板里需要使用
     $pl = M('pl');
     import('@.ORG.Page');
     if (isset($_GET['status'])) {
         $count = $pl->where('status=' . $_GET['status'])->order('ptime desc')->count();
         $p = new Page($count, 20);
         $list = $pl->where('status=' . $_GET['status'])->order('ptime desc')->limit($p->firstRow . ',' . $p->listRows)->select();
     } elseif (isset($_GET['keyword'])) {
         $map['content'] = array('like', '%' . $_GET['keyword'] . '%');
         $count = $pl->where($map)->order('ptime desc')->count();
         $p = new Page($count, 20);
         $list = $pl->where($map)->order('ptime desc')->limit($p->firstRow . ',' . $p->listRows)->select();
     } else {
         $count = $pl->order('ptime desc')->count();
         $p = new Page($count, 20);
         $list = $pl->order('ptime desc')->limit($p->firstRow . ',' . $p->listRows)->select();
     }
     $p->setConfig('prev', '上一页');
     $p->setConfig('header', '条评论');
     $p->setConfig('first', '首 页');
     $p->setConfig('last', '末 页');
     $p->setConfig('next', '下一页');
     $p->setConfig('theme', "%first%%upPage%%linkPage%%downPage%%end%\r\n\t\t<li><span><select name='select' onChange='javascript:window.location.href=(this.options[this.selectedIndex].value);'>%allPage%</select></span></li>\n<li><span>共<font color='#009900'><b>%totalRow%</b></font>条评论 20条/每页</span></li>");
     $this->assign('page', $p->show());
     $this->assign('list', $list);
     $this->display();
 }
Esempio n. 7
0
function System_Load($Name)
{
    /****************************************************************************/
    $__args_types = array('string');
    #-----------------------------------------------------------------------------
    $__args__ = Func_Get_Args();
    eval(FUNCTION_INIT);
    /****************************************************************************/
    $Paths = Func_Get_Args();
    if (!Count($Paths)) {
        return ERROR | @Trigger_Error('[System_Load]: не передан ни один путь к системному компоненту');
    }
    #-----------------------------------------------------------------------------
    $Loaded =& Link_Get('System', 'array');
    #-----------------------------------------------------------------------------
    foreach ($Paths as $Path) {
        #---------------------------------------------------------------------------
        if (System_IsLoaded($Path)) {
            continue;
        }
        #---------------------------------------------------------------------------
        $Loaded[] = $Path;
        #---------------------------------------------------------------------------
        $Path = System_Element(SPrintF('system/%s', $Path));
        if (Is_Error($Path)) {
            return ERROR | @Trigger_Error('[System_Load]: включение не найдено');
        }
        #---------------------------------------------------------------------------
        if (Is_Error(Load($Path))) {
            return ERROR | @Trigger_Error('[System_Load]: не удалось загрузить включение');
        }
        #---------------------------------------------------------------------------
        Debug(SPrintF('[System_Load]: компонент системы (%s) был загружен', $Path));
    }
}
Esempio n. 8
0
 function index()
 {
     Load('extend');
     $condition['user_id'] = Cookie::get('user_id');
     $data = $this->indexModel->getIndexData($condition);
     $this->assign('data', $data);
     $this->display();
 }
Esempio n. 9
0
 function index()
 {
     Load('extend');
     $id = intval($_GET['id']);
     $data = $this->goodslistModel->getGoodslistIndexData($id);
     $this->assign('data', $data);
     $this->display();
 }
 function _initialize()
 {
     Load('extend');
     import("ORG.Util.Page");
     $nav_list = D('Category')->relation(true)->where('pid=0 AND status=1')->order('sort DESC')->select();
     $this->assign('link', D('Link')->where('status=1')->order('sort DESC')->limit(7)->select());
     $this->assign('nav_list', $nav_list);
 }
Esempio n. 11
0
 public function index()
 {
     Load('extend');
     $Data = M('Article');
     $list = $Data->order('publish_time DESC')->select();
     $this->assign('list', $list);
     $this->display();
 }
 public function _initialize()
 {
     /*
      * 载入各种扩展
      */
     //import("ORG.Util.Image");	//图像操作类库
     Load('extend');
     //Think扩展函数库
 }
Esempio n. 13
0
function Editing($va)
{
    $vaLevel = scSys::GetKeterangan("Kode,Keterangan,Isi", "Kode = '{$va['cKode']}'", "username_level");
    Load($va['cKode']);
    echo '
				$("#cKeterangan").val("' . $vaLevel['Keterangan'] . '") ; 
				$("#nLevel").val("' . $vaLevel['Kode'] . '") ; 
			';
}
 public function _initialize()
 {
     /* 导航菜单 */
     $menuModel = M('Menu');
     $menuwhere['type'] = "1";
     $menuresult = $menuModel->where($menuwhere)->order('sort')->limit(6)->select();
     $this->assign('menu', $menuresult);
     /* //seo
     		$systemConfig = include WEB_ROOT . 'Common/systemConfig.php';
     		F("systemConfig", $systemConfig, WEB_ROOT . "Common/");
     		$this->assign("site", $systemConfig); */
     //网站配置
     $this->assign('webset', M('Setting')->select());
     Load('extend');
     //导航数据组装
     $nav_list = D('Category')->where('pid=0 AND status=1')->order('sort DESC')->select();
     if (is_array($nav_list)) {
         foreach ($nav_list as $key => $val) {
             $nav_list[$key] = $this->changurl($val);
             $nav_list[$key]['sub_nav'] = D('Category')->where('pid=' . $val['id'] . ' AND status=1')->select();
             foreach ($nav_list[$key]['sub_nav'] as $key2 => $val2) {
                 $nav_list[$key]['sub_nav'][$key2] = $this->changurl($val2);
             }
         }
     }
     //最热文章数据组装
     $hot_art = D('Article')->where('status=1')->order('apv DESC')->limit(8)->select();
     if (is_array($hot_art)) {
         foreach ($hot_art as $key => $val) {
             $hot_art[$key] = $this->changurl($val);
         }
     }
     $this->assign('hot_art', $hot_art);
     //最热文章数据组装
     $new_art = D('Article')->where('status=1')->order('add_time DESC')->limit(8)->select();
     if (is_array($new_art)) {
         foreach ($new_art as $key => $val) {
             $new_art[$key] = $this->changurl($val);
         }
     }
     $this->assign('new_art', $new_art);
     //最新留言
     $new_leave = D('Message')->where('status=1 AND pid=0 AND aid=0')->order('add_time DESC')->limit(5)->select();
     foreach ($new_leave as $key => $val) {
         $new_leave[$key] = $this->msgmodify($val);
     }
     $this->assign('new_leave', $new_leave);
     //最新评论
     $new_comment = D('Message')->where('status=1 AND pid=0 AND aid!=0')->order('add_time DESC')->limit(5)->select();
     foreach ($new_comment as $key => $val) {
         $new_comment[$key] = $this->msgmodify($val);
     }
     $this->assign('new_comment', $new_comment);
     $this->assign('link', D('Link')->where('status=1')->order('sort DESC')->limit(8)->select());
     $this->assign('nav_list', $nav_list);
 }
Esempio n. 15
0
 function checkLogin()
 {
     if (empty($_POST['username'])) {
         alert("帐号错误", 1);
     } elseif (empty($_POST['password'])) {
         alert("密码必须!", 1);
     } elseif (empty($_POST['verify'])) {
         alert('验证码必须!', 1);
     }
     if (md5($_POST['verify']) != $_SESSION['verify']) {
         alert('验证码错误!', 1);
     }
     //生成认证条件
     $map = array();
     // 支持使用绑定帐号登录
     $map['username'] = $_POST['username'];
     $map["status"] = array('gt', 0);
     import('ORG.Util.RBAC');
     $authInfo = RBAC::authenticate($map);
     //使用用户名、密码和状态的方式进行认证
     if (false === $authInfo) {
         alert('帐号不存在!', 1);
     }
     if (empty($authInfo)) {
         alert('帐号不存在或已禁用!', 1);
     }
     $pwdinfo = strcmp($authInfo['password'], md5('wk' . $_POST['password'] . 'cms'));
     if ($pwdinfo != 0) {
         alert('密码错误!', 1);
     }
     $_SESSION[C('USER_AUTH_KEY')] = $authInfo['id'];
     $_SESSION['username'] = $_POST['username'];
     $role = M('role_admin');
     $authInfo['role_id'] = $role->where('user_id=' . $authInfo['id'])->getField('role_id');
     if ($authInfo['role_id'] == '1') {
         $_SESSION['administrator'] = true;
     }
     //保存登录信息
     $admin = M('admin');
     Load('extend');
     $ip = get_client_ip();
     $time = time();
     $data = array();
     $data['id'] = $authInfo['id'];
     $data['lastlogintime'] = $time;
     $data['lastloginip'] = $ip;
     $admin->save($data);
     // 缓存访问权限
     RBAC::saveAccessList();
     //保存cookie信息
     Cookie::set('waikucms', '1', 60 * 60 * 3);
     //dump($authInfo);
     $this->index();
 }
 public function index()
 {
     Load('extend');
     $Data = M('art');
     // 实例化Data数据模型
     $this->data = $Data->where('stat !=100 and fzclass=1')->order('id')->limit(4)->select();
     $menu = M('class');
     $this->list = $menu->select();
     $Data = M('art');
     // 实例化Data数据模型
     $this->data2 = $Data->where('stat !=100 and fzclass=2')->order('id')->limit(12)->select();
     $this->display();
 }
Esempio n. 17
0
function MainFunc()
{
    echo date("Y-M-d H:i:s") . "=====================\n";
    global $tbl_gm_db;
    $dbinfo = $tbl_gm_db[0];
    $Conn = mysql_connect($dbinfo[2], $dbinfo[0], $dbinfo[1]);
    mysql_select_db($dbinfo[3], $Conn);
    $qs = "select rrs_uServerId from tbl_rush_role_servers";
    $rs = mysql_query($qs);
    while ($row = mysql_fetch_row($rs)) {
        Load($row[0]);
    }
    mysql_close($Conn);
}
Esempio n. 18
0
 public function head()
 {
     //读取数据库和缓存
     $type = M('type');
     $article = M('article');
     $config = F('basic', '', './Web/Conf/');
     Load('extend');
     //封装网站配置
     $this->assign('config', $config);
     //滚动公告
     $data['status'] = 1;
     $data['typeid'] = $config['noticeid'];
     $roll = $article->where($data)->field('aid,title')->order('addtime desc')->limit($config['rollnum'])->select();
     //处理标题:防止标题过长撑乱页面
     foreach ($roll as $k => $v) {
         $roll[$k]['title'] = msubstr($v['title'], 0, 20, 'utf-8');
     }
     $this->assign('roll', $roll);
     //网站导航
     $menu = $type->where('ismenu=1')->order('drank asc')->select();
     foreach ($menu as $k => $v) {
         $menuson[$k] = $type->where('fid=' . $v['typeid'] . ' AND drank <> 0')->order('drank asc')->select();
     }
     $this->assign('menuson', $menuson);
     $this->assign('menu', $menu);
     //位置导航
     $nav = '<a href="__APP__">首页</a>';
     if (isset($_GET['aid'])) {
         $typeid = $article->where('aid=' . $_GET['aid'])->getField('typeid');
     } else {
         $typeid = $_GET['typeid'];
     }
     $typename = $type->where('typeid=' . $typeid)->getField('typename');
     $path = $type->where('typeid=' . $typeid)->getField('path');
     $typelist = explode('-', $path);
     //拼装导航栏字符串
     foreach ($typelist as $v) {
         if ($v == 0) {
             continue;
         }
         $s = $type->where('typeid=' . $v)->getField('typename');
         $nav .= "&nbsp;&gt;&nbsp;<a href=\"" . U('lists/' . $v) . "\">{$s}</a>";
     }
     $nav .= "&nbsp;&gt;&nbsp;<a href=\"" . U('lists/' . $typeid) . "\">{$typename}</a>";
     $this->assign('nav', $nav);
     //释放内存
     unset($type, $article, $config);
 }
 public function delList()
 {
     Load('extend');
     import('ORG.Util.Page');
     $count = M('user')->where(array('del' => 1))->count();
     $page = new Page($count, C('PAGE_NUMS'));
     $limit = $page->firstRow . ',' . $page->listRows;
     // $field = array('$id, $time')  然后再查找的时候 加上 ->field($field),,,->field($field, true),第二个参数表示开启不想显示的字段
     $field = array('del');
     //不查找del字段
     $data = D('BlogRelation')->relation(true)->field($field, true)->where(array('del' => 1))->order('time DESC')->limit($limit)->select();
     // $data = M('user')->order('time DESC')->limit($limit)->select();
     $this->data = $data;
     $this->page = $page->show();
     $this->display('articalList');
 }
 public function index()
 {
     Load('extend');
     $this->assign("title", "用户管理");
     // 如果用户已经登录成功的话,直接转到用户管理界面
     if (Session::is_set(C('USER_AUTH_KEY'))) {
         $this->assign("dsp", "change");
         $uid = Session::get(C('USER_AUTH_KEY'));
         $userInfo = D("Member")->getByUid($uid);
         $GameData = D("Userdata")->getByUserid($uid);
         $this->assign($userInfo);
         $this->assign($GameData);
         $this->display("Public:Member");
     } else {
         $this->display("Public:Member");
     }
 }
 public function index()
 {
     Load('extend');
     import("ORG.Util.Page");
     $Userdata = D("Userdata");
     $count = $Userdata->count();
     $Page = new Page($count, 20);
     $show = $Page->show();
     $user = $Userdata->order('Money desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
     for ($i = 0; $i < count($user); $i++) {
         $user[$i]['rank'] = $i + 1;
         $Member = D("Member");
         $mdata = $Member->getByuid($user[$i]['UserId']);
         $user[$i]['rname'] = $mdata['username'];
     }
     $this->assign('pages', $show);
     $this->assign("rlist", $user);
     $this->assign("title", "玩家排行");
     $this->display("Public:Ranklist");
 }
Esempio n. 22
0
 public function update()
 {
     if (!isset($_POST['aid']) or !isset($_POST['author']) or !isset($_POST['content'])) {
         alert('非法操作!', 3);
     }
     //读取数据库和缓存
     $pl = M('pl');
     $config = F('basic', '', './Web/Conf/');
     //载入函数库
     Load('extend');
     $data['ip'] = get_client_ip();
     $data['author'] = htmlspecialchars($_POST['author']);
     $data['content'] = htmlspecialchars(trim($_POST['content']));
     $data['ptime'] = date('Y-m-d H:i:s');
     $data['aid'] = htmlspecialchars($_POST['aid']);
     if (Session::is_set('pltime')) {
         $temp = Session::get('pltime') + $config['postovertime'];
         if (time() < $temp) {
             echo "请不要连续发布!";
             exit;
         }
     }
     if ($config['pingoff'] == 0) {
         $data['status'] = 0;
     }
     if ($pl->add($data)) {
         Session::set('pltime', time());
         if ($config['pingoff'] == 0) {
             echo "发布成功,评论需要管理员审核!";
             exit;
         } else {
             echo "发布成功!";
             exit;
         }
     } else {
         echo "发布失败!";
         exit;
     }
 }
 function login_user()
 {
     Load('extend');
     $condition['account'] = array('eq', $_POST['username']);
     $condition['status'] = array('eq', 1);
     $condition['_logic'] = 'and';
     $userInfo = M('Admin')->where($condition)->find();
     $_SESSION['userInfo'] = $userInfo;
     $status = adminPwdEncryptVerify($_POST['password'], $userInfo['password']);
     if (!$status) {
         $this->ajaxReturn(array('status' => 0, 'msg' => '密码错误'));
     } else {
         $ip = get_client_ip();
         $time = time();
         $data['last_login_time'] = $time;
         $data['login_count'] = array('exp', 'login_count+1');
         $data['last_login_ip'] = $ip;
         M('Admin')->where(array('id' => $userInfo['id']))->save($data);
         cookie('Alogin', array('auth' => adminPwdEncrypt(C('ADMIN_AUTH_CODE')), 'userInfo' => serialize($userInfo)), 'expire=3600&prefix=WYmanage_');
         $this->ajaxReturn(array('status' => 1, 'msg' => '密码正确'));
     }
 }
Esempio n. 24
0
 function adv_search_sub()
 {
     Load('extend');
     // 导入中文字符扩展类
     if (!empty($_GET['keyword'])) {
         $keyword = $_GET['keyword'];
     }
     if (!empty($_GET['item_No'])) {
         $itemNo = $_GET['item_No'];
     }
     if (!empty($_GET['start'])) {
         $start = $_GET['start'];
     }
     if (!empty($_GET['end'])) {
         $end = $_GET['end'];
     }
     if (isset($keyword)) {
         $condition["title"] = array('like', '%' . $keyword . '%');
         $condition["title_info"] = array('like', '%' . $keyword . '%');
         $condition["item_No"] = array('like', '%' . $keyword . '%');
         $condition["sell_price"] = array('like', '%' . $keyword . '%');
     }
     if (isset($itemNo)) {
         $condition['item_No'] = array('eq', $itemNo);
     }
     $condition['sell_price'] = array();
     $condition['sell_price'] = array(isset($start) ? array('gt', intval($start)) : array('gt', 0), isset($end) ? array('lt', intval($end)) : '');
     for ($i = 0; $i <= count($condition['sell_price']); $i++) {
         if (empty($condition['sell_price'][$i])) {
             unset($condition['sell_price'][$i]);
         }
     }
     $condition['_logic'] = 'or';
     $conditionMap['_complex'] = $condition;
     $conditionMap['putaway'] = array('eq', 1);
     $data = $this->searchModel->getSearchData($conditionMap);
     $this->assign('data', $data);
     $this->display('index');
 }
Esempio n. 25
0
 function add()
 {
     Load('extend');
     if ($_POST['password'] != $_POST['repassword']) {
         $this->error('两次密码不一致');
     }
     $user = D('user');
     if ($vo = $user->create()) {
         //但是创建成功之后,你的密码是没有md5,你的ip是不正的.你的两次密码是否一致是没被验证的
         //你的注册时间是不存在
         $user->password = md5($user->password);
         $user->createtime = time();
         //$user->createip=$_SERVER[];
         $user->createip = get_client_ip();
         if ($user->add()) {
             $this->success('用户注册成功,返回上级页面');
         } else {
             $this->error('用户注册失败,返回上级页');
         }
     } else {
         $this->error($user->getError());
     }
 }
 public function submitmsg()
 {
     Load('extend');
     if ($_SESSION['verify'] != md5($_POST['verify'])) {
         $this->error('验证码错误!');
     } elseif (strlen_utf8($_POST['content']) > 200 || strlen_utf8($_POST['content']) < 10) {
         $this->error("留言内容不能少于10字,不能超过200字!");
     } else {
         $data = $_POST;
         $Message = D("Message");
         $data['clientip'] = get_client_ip();
         $data['postdate'] = time();
         if ($Message->Create()) {
             if ($Message->add($data)) {
                 $this->assign("jumpUrl", "__URL__");
                 $this->success("留言成功!");
             } else {
                 $this->error("留言失败!");
             }
         } else {
             $this->error($Message->getError());
         }
     }
 }
Esempio n. 27
0
 public function doadd()
 {
     //验证
     if (empty($_POST['title'])) {
         alert('标题不能为空!', 1);
     }
     if (isset($_POST['imgurl'])) {
         $data['imgurl'] = trim($_POST['imgurl']);
     }
     $data['status'] = 1;
     $data['content'] = $_POST['content'];
     $data['title'] = trim($_POST['title']);
     $data['hits'] = trim($_POST['hits']);
     Load('extend');
     //加载扩展函数库
     empty($_POST['keywords']) ? $data['keywords'] = '' : ($data['keywords'] = trim($_POST['keywords']));
     empty($_POST['description']) ? $data['description'] = '' : ($data['description'] = trim($_POST['description']));
     empty($_POST['isenglish']) ? $data['isenglish'] = '0' : ($data['isenglish'] = trim($_POST['isenglish']));
     $Pages = M('Pages');
     if ($Pages->data($data)->add()) {
         alert('操作成功!', U('Pages/index'));
     }
     alert('操作失败!', 1);
 }
Esempio n. 28
0
    session_start();
}
//pemanggil season bahasa
if (isset($_GET['bahasa']) && $_GET['bahasa'] != "") {
    $_SESSION['bhs'] = $_GET['bahasa'];
    header("Location: " . $_SERVER['HTTP_REFERER']);
}
//load data dari folder bahsa berdasarkan settingan default
if (isset($_SESSION['bhs']) && $_SESSION['bhs'] != "") {
    $bhs_on = $_SESSION['bhs'];
} else {
    $bhs_on = WEB_SETTING("bahasa", $conn);
}
$sql = "SELECT * FROM bahasa WHERE kode='{$bhs_on}'";
$set_bhs = TampilData($sql, $conn);
//load database
//load file bahasa
require_once DIR_BAHASA . $set_bhs['namafile'];
//load file di folder berdasarkan $route
//jika $route terisi dan nilai $route terdapat dalam array controller maka load file dalam controller
if (isset($route) && $route != "" && in_array($route . ".php", ArrayDir(DIR_BAHASA . $set_bhs['folder'] . "/"))) {
    Load(DIR_BAHASA . $set_bhs['folder'] . "/" . $route . ".php");
} else {
    //jika $route tidak di isi maka yang di load adalah home dan home harus ada di array controller
    Load(DIR_BAHASA . $set_bhs['folder'] . "/" . "home.php");
}
//Bahasa pada header
$sql = "SELECT * FROM bahasa WHERE status = '1'";
$array_bahasa = RowData($sql, $conn);
$text_bahasa = $set_bhs['nama'];
define("BHS_ON", $bhs_on);
                }
            }
        }
        return $a_new_files;
    }
    RegisterData($aAllRawValues, MergeFileArrays($aFileVars, IsSetSession("FormSavedFiles") ? GetSession("FormSavedFiles") : array()));
    //
    // parse all fmcompute fields
    //
    if (is_array($SPECIAL_VALUES["fmcompute"])) {
        $nCompute = count($SPECIAL_VALUES["fmcompute"]);
        for ($iCompute = 0; $iCompute < $nCompute; $iCompute++) {
            Load($SPECIAL_VALUES["fmcompute"][$iCompute]);
        }
    } else {
        Load($SPECIAL_VALUES["fmcompute"]);
    }
    //
    // run computations
    //
    Compute($aFieldOrder, $aCleanedValues, $aRawDataValues, $aAllRawValues);
    //
    // Hook system: after computations
    //
    if ($HOOK_DIR !== "") {
        if (!@(include "{$HOOK_DIR}/fmhookcompute.inc.php")) {
            @(include "{$HOOK_DIR}/fmhookcompute.inc");
        }
    }
}
$bGotGoBack = $bGotNextForm = $bGotGoodTemplate = $bGotGoodUrl = false;
Esempio n. 30
0
 public function __construct($setting, &$camera, $load)
 {
     $this->Setting = $setting;
     $this->Category = substr($setting, 0, strrpos($setting, '/'));
     $this->_camera =& $camera;
     if ($load) {
         Load();
     }
 }