public function index()
 {
     // 记录当前列表页的cookie
     Cookie('__forward__', $_SERVER['REQUEST_URI']);
     $this->meta_title = '栏目管理';
     $this->display('Profile/Category/index');
 }
Exemplo n.º 2
0
 public function edit($id = null)
 {
     if (IS_POST) {
         $SeoRule = D('SeoRule');
         $data = $SeoRule->create();
         if ($data) {
             if ($SeoRule->save()) {
                 $cacheKey = "qt_seo_meta_" . $data['app'] . "_" . $data['controller'] . "_" . $data['action'];
                 S($cacheKey, null);
                 $this->success('更新成功', Cookie('__forward__'));
             } else {
                 $this->error('更新失败');
             }
         } else {
             $this->error($SeoRule->getError());
         }
     } else {
         $info = array();
         $info = M('SeoRule')->field(true)->find($id);
         if (false === $info) {
             $this->error('获取配置信息错误');
         }
         $this->assign('info', $info);
         $this->display();
     }
 }
Exemplo n.º 3
0
 /**
  * 登陆
  */
 public function login()
 {
     if (IS_POST) {
         $username = I('username');
         $password = I('password');
         $remenber = I('remenber');
         if (!$username) {
             $this->error('请输入姓名!');
         }
         if (!$password) {
             $this->error('请输入身份证!');
         }
         $user_object = D('Student');
         $uid = $user_object->login($username, $password);
         if (0 < $uid) {
             $this->success('登录成功!', Cookie('__forward__') ?: C('HOME_PAGE'));
         } else {
             $this->error($user_object->getError());
         }
     } else {
         if (is_login()) {
             $this->error("您已登陆系统", Cookie('__forward__') ?: C('HOME_PAGE'));
         }
         $this->display();
     }
 }
 public function index()
 {
     $banner = $this->getBanner($this->PageFeature['ControllerName']);
     $this->assign('banner', $banner);
     $tab = $this->getTab();
     $this->assign('tabs', $tab);
     $tabVideo = NULL;
     //获得tabVideo
     foreach ($tab as $key => $value) {
         $tabVideo[$key] = $this->getTabVideo($value['id']);
         //转换数据
         foreach ($tabVideo[$key] as $key1 => $value1) {
             $tabVideo[$key][$key1]['create_time'] = date('Y-m-d', $value1['create_time']);
             $tabVideo[$key][$key1]['update_time'] = date('Y-m-d', $value1['update_time']);
             //获得教师信息
             $teach = $this->getInfo($value1['authority']);
             $tabVideo[$key][$key1]['name'] = $teach[0]['name'];
             $tabVideo[$key][$key1]['company'] = $teach[0]['company'];
             //var_dump( $value1);
         }
     }
     Cookie('__forward__', $_SERVER['REQUEST_URI']);
     $this->assign('tabVideo', $tabVideo);
     $this->display();
 }
 /**
  * 编辑订单
  * @author 烟消云散 <*****@*****.**>
  */
 public function edit($id = 0)
 {
     if (IS_POST) {
         $Form = D('change');
         if ($_POST["id"]) {
             $id = $_POST["id"];
             $Form->create();
             $result = $Form->where("id='{$id}'")->save();
             if ($result) {
                 //记录行为
                 action_log('update_change', 'change', $data['id'], UID);
                 $this->success('更新成功', Cookie('__forward__'));
             } else {
                 $this->error('更新失败,换货单' . $id);
             }
         } else {
             $this->error($Config->getError());
         }
     } else {
         $info = array();
         /* 获取数据 */
         $info = M('change')->find($id);
         $list = M('change')->where("shopid='{$id}'")->select();
         if (false === $info) {
             $this->error('获取订单信息错误');
         }
         $this->assign('list', $list);
         $this->assign('info', $info);
         $this->meta_title = '编辑订单';
         $this->display();
     }
 }
 /**
  * 编辑
  * @author 烟消云散 <*****@*****.**>
  */
 public function edit($id = 0)
 {
     if (IS_POST) {
         $Form = D('records');
         if ($_POST["id"]) {
             $id = $_POST["id"];
             /*更新时间*/
             $Form->time = NOW_TIME;
             /* 编辑后新增系统反馈信息*/
             $Form->info = $_POST["info"];
             $result = $Form->where("id='{$id}'")->save();
             if ($result) {
                 //记录行为
                 action_log('update_backlist', 'backlist', $data['id'], UID);
                 $this->success('更新成功', Cookie('__forward__'));
             } else {
                 $this->error('更新失败' . $id);
             }
         } else {
             $this->error($Config->getError());
         }
     } else {
         $info = array();
         /* 获取数据 */
         $info = M('records')->find($id);
         $list = M('records')->where("id='{$id}'")->select();
         if (false === $info) {
             $this->error('获取订单信息错误');
         }
         $this->assign('list', $list);
         $this->assign('info', $info);
         $this->meta_title = '编辑订单';
         $this->display();
     }
 }
 /**
  * 编辑配置
  * @author 麦当苗儿 <*****@*****.**>
  */
 public function edit($id = 0)
 {
     $DataModel = D('Friendlink');
     if (IS_POST) {
         $data = $DataModel->create();
         if ($data) {
             if ($DataModel->save($data)) {
                 S('DB_CONFIG_DATA', null);
                 //设置缓存
                 //记录行为
                 action_log('update_config', 'Friendlink', $data['id'], UID);
                 $this->success('更新成功', Cookie('__forward__'));
             } else {
                 $this->error('更新失败');
             }
         } else {
             $this->error($DataModel->getError());
         }
     } else {
         $info = array();
         /* 获取数据 */
         $info = $DataModel->field(true)->find($id);
         if (false === $info) {
             $this->error('获取配置信息错误');
         }
         $this->assign('info', $info);
         $this->meta_title = '编辑配置';
         $this->display();
     }
 }
Exemplo n.º 8
0
 /**
  * 管理员登录
  */
 public function login()
 {
     if (IS_POST) {
         $adm_id = I('adm_id');
         $adm_pw = I('adm_pw');
         # 图片验证码校验
         if (!$this->check_verify(I('post.verify'))) {
             $this->error('验证码输入错误!');
         }
         if (!$adm_id) {
             $this->error('请输入管理员!');
         }
         if (!$adm_pw) {
             $this->error('请输入密码!');
         }
         $ADM = D('Admin');
         $uid = $ADM->login($adm_id, $adm_pw);
         if (0 < $uid) {
             $this->redirect('Index/index');
         } else {
             $this->error($ADM->getError());
         }
     } else {
         if (is_login('Admin')) {
             $this->error("您已登陆系统", Cookie('__forward__') ?: C('HOME_PAGE'));
         }
         $this->meta_title = '管理员登录';
         $this->display();
     }
 }
Exemplo n.º 9
0
 /**
  * 编辑配置
  * @author yangweijie <*****@*****.**>
  */
 public function edit($id = 0)
 {
     if (IS_POST) {
         $Menu = D('Menu');
         $data = $Menu->create();
         if ($data) {
             if ($Menu->save() !== false) {
                 // S('DB_CONFIG_DATA',null);
                 //记录行为
                 action_log('update_menu', 'Menu', $data['id'], UID);
                 $this->success('更新成功', Cookie('__forward__'));
             } else {
                 $this->error('更新失败');
             }
         } else {
             $this->error($Menu->getError());
         }
     } else {
         $info = array();
         /* 获取数据 */
         $info = M('Menu')->field(true)->find($id);
         $menus = M('Menu')->field(true)->select();
         $menus = D('Common/Tree')->toFormatTree($menus);
         $menus = array_merge(array(0 => array('id' => 0, 'title_show' => '顶级菜单')), $menus);
         $this->assign('Menus', $menus);
         if (false === $info) {
             $this->error('获取后台菜单信息错误');
         }
         $this->assign('info', $info);
         $this->meta_title = '编辑后台菜单';
         $this->display();
     }
 }
 /**
  * 编辑业务
  * @author 温开元<wenkaiyuan.6@163.com 594164084@qq.com>
  */
 public function edit($id = 0)
 {
     if (IS_POST) {
         $Business = D('Business');
         $data = $Business->create();
         if ($data) {
             if ($Business->save()) {
                 //记录行为
                 // action_log('update_business', 'Business', $data['id'], UID);
                 $this->success('更新成功', Cookie('__forward__'));
             } else {
                 $this->error('更新失败');
             }
         } else {
             $this->error($Business->getError());
         }
     } else {
         $info = array();
         /* 获取数据 */
         $info = M('Business')->field(true)->find($id);
         if (false === $info) {
             $this->error('获取业务信息错误');
         }
         $this->assign('info', $info);
         $this->meta_title = '编辑业务';
         $this->display();
     }
 }
Exemplo n.º 11
0
 public function edit($id = null)
 {
     if (IS_POST) {
         $Config = D('SystemConfig');
         $data = $Config->create();
         if ($data) {
             if ($Config->save()) {
                 S('DB_CONFIG_DATA', null);
                 $this->success('更新成功', Cookie('__forward__'));
             } else {
                 $this->error('更新失败');
             }
         } else {
             $this->error($Config->getError());
         }
     } else {
         $info = array();
         $info = M('SystemConfig')->field(true)->find($id);
         if (false === $info) {
             $this->error('获取配置信息错误');
         }
         $this->assign('info', $info);
         $this->display();
     }
 }
Exemplo n.º 12
0
 function save()
 {
     $Brand = D('Brand');
     $data = $Brand->create();
     if ($data) {
         $id = $Brand->add();
         if ($id) {
             // S('DB_CONFIG_DATA',null);
             //记录行为
             action_log('update_menu', 'Menu', $id, UID);
             $this->success('新增成功', Cookie('__forward__'));
         } else {
             $this->error('新增失败');
         }
     } else {
         $this->error($Brand->getError());
     }
     //        if(IS_POST){
     //
     //        } else {
     //            $this->assign('info',array('pid'=>I('pid')));
     //            $menus = M('Menu')->field(true)->select();
     //            $menus = D('Common/Tree')->toFormatTree($menus);
     //            $menus = array_merge(array(0=>array('id'=>0,'title_show'=>'顶级菜单')), $menus);
     //            $this->assign('Menus', $menus);
     //            $this->meta_title = '新增菜单';
     //            $this->display('edit');
     //        }
 }
Exemplo n.º 13
0
 /**
  * 编辑配置
  * @author 麦当苗儿 <*****@*****.**>
  */
 public function edit($id = 0)
 {
     $DataModel = D('ResourceTab');
     if (IS_POST) {
         //$Config = D('Config');
         $data = $DataModel->create();
         if ($data) {
             if ($DataModel->updateData(null, $data)) {
                 S('DB_TAB_DATA', null);
                 //记录行为
                 action_log('update_config', 'ResourceTab', $data['id'], UID);
                 $this->success('更新成功', Cookie('__forward__'));
                 //$this->success('更新成功', U('index'));
             } else {
                 $this->error('更新失败');
             }
         } else {
             $this->error($DataModel->getError());
         }
     } else {
         $info = array();
         /* 获取数据 */
         $info = $DataModel->getValue($id);
         if (false === $info) {
             $this->error('获取配置信息错误');
         }
         $this->assign('info', $info);
         $this->meta_title = '编辑配置';
         $this->display();
     }
 }
Exemplo n.º 14
0
 /**
  * 订单管理
  * author 烟消云散 <*****@*****.**>
  */
 public function index()
 {
     /* 查询条件初始化 */
     $status = $_GET['status'];
     if (isset($_GET['status'])) {
         switch ($status) {
             case '1':
                 $map['status'] = $status;
                 $meta_title = "未使用快递管理";
                 break;
             case '2':
                 $map['status'] = $status;
                 $meta_title = "已使用快递管理";
                 break;
         }
     } else {
         $status = '';
         $meta_title = "快递管理";
     }
     if (isset($_GET['time-start'])) {
         $map['update_time'][] = array('egt', strtotime(I('time-start')));
     }
     if (isset($_GET['time-end'])) {
         $map['update_time'][] = array('elt', 24 * 60 * 60 + strtotime(I('time-end')));
     }
     $this->assign('status', $status);
     $this->meta_title = $meta_title;
     $list = $this->lists('Express', $map, 'id desc');
     $this->assign('list', $list);
     // 记录当前列表页的cookie
     Cookie('__forward__', $_SERVER['REQUEST_URI']);
     $this->display();
 }
Exemplo n.º 15
0
 /**
  * 短信管理列表
  * @author 麦当苗儿 <*****@*****.**>
  */
 public function index()
 {
     $status = $_GET['status'];
     if (isset($_GET['status'])) {
         switch ($status) {
             case '1':
                 $map['status'] = $status;
                 $meta_title = "日志管理";
                 break;
         }
     } else {
         $status = 1;
         $map = array('status' => 1);
         $meta_title = "日志管理";
     }
     if (isset($_GET['title'])) {
         $map['title'] = array('like', '%' . (string) I('title') . '%');
     }
     if (isset($_GET['time-start'])) {
         $map['update_time'][] = array('egt', strtotime(I('time-start')));
     }
     if (isset($_GET['time-end'])) {
         $map['update_time'][] = array('elt', 24 * 60 * 60 + strtotime(I('time-end')));
     }
     if (isset($_GET['nickname'])) {
         $map['uid'] = M('Member')->where(array('nickname' => I('nickname')))->getField('uid');
     }
     $this->meta_title = $meta_title;
     $this->assign('status', $status);
     $list = $this->lists('UserLog', $map, 'id desc');
     $this->assign('list', $list);
     // 记录当前列表页的cookie
     Cookie('__forward__', $_SERVER['REQUEST_URI']);
     $this->display();
 }
 /**
  * 编辑尺寸
  * @author 温开元<wenkaiyuan.6@163.com 594164084@qq.com>
  */
 public function edit($id = 0)
 {
     if (IS_POST) {
         $BusinessSize = D('BusinessSize');
         $data = $BusinessSize->create();
         if ($data) {
             //拼接宽高为显示头
             if (empty($BusinessSize->title)) {
                 $BusinessSize->title = $BusinessSize->width . 'x' . $BusinessSize->height;
             }
             if ($BusinessSize->save()) {
                 //记录行为
                 // action_log('update_business_size', 'BusinessSize', $data['id'], UID);
                 $this->success('更新成功', Cookie('__forward__'));
             } else {
                 $this->error('更新失败');
             }
         } else {
             $this->error($BusinessSize->getError());
         }
     } else {
         $info = array();
         /* 获取数据 */
         $info = M('BusinessSize')->field(true)->find($id);
         if (false === $info) {
             $this->error('获取尺寸信息错误');
         }
         $this->assign('info', $info);
         $this->meta_title = '编辑尺寸';
         $this->display();
     }
 }
 /**
  * 编辑素材
  * @author 温开元<wenkaiyuan.6@163.com 594164084@qq.com>
  */
 public function edit($id = 0)
 {
     if (IS_POST) {
         $Material = D('Material');
         $data = $Material->create();
         if ($data) {
             if ($Material->save()) {
                 // 记录行为
                 // action_log('update_material', 'Material', $data['id'], UID);
                 $this->success('更新成功', Cookie('__forward__'));
             } else {
                 $this->error('更新失败');
             }
         } else {
             $this->error($Material->getError());
         }
     } else {
         $info = array();
         /* 获取数据 */
         $info = M('Material')->field(true)->find($id);
         if (false === $info) {
             $this->error('获取素材信息错误');
         }
         /* 对属性的处理 */
         # TODO
         if (isset($this->saveFun[$info['material_type']])) {
             $fun = $this->saveFun[$info['material_type']];
             $this->{$fun}($info);
         }
         $this->assign('info', $info);
         $this->meta_title = '编辑素材';
         $this->display();
     }
 }
Exemplo n.º 18
0
function GetID($type)
{
    $option = Session($type);
    if ($option == "") {
        $option = Cookie($type);
    }
    return $option;
}
Exemplo n.º 19
0
 public function index()
 {
     $info = M("Info")->order('level DESC,id DESC')->select();
     // 记录当前列表页的cookie
     Cookie('__forward__', $_SERVER['REQUEST_URI']);
     $this->assign('info', $info);
     $this->meta_title = '固定信息';
     $this->display();
 }
 /**
  * 更新一条数据
  * @author huajie <*****@*****.**>
  */
 public function update()
 {
     $res = D('ShopShipping')->update(I('post.'));
     if (!$res) {
         $this->error(D('ShopShipping')->getError());
     } else {
         $this->success($res['id'] ? '更新成功' : '新增成功', Cookie('__forward__'));
     }
 }
Exemplo n.º 21
0
 /**
  * 更新一条数据
  *
  * @author huajie <*****@*****.**>
  */
 public function update()
 {
     $res = D('Attribute')->update();
     if (!$res) {
         $this->error(D('Attribute')->getError());
     } else {
         $this->success($res['id'] ? '更新成功' : '新增成功', Cookie('__forward__'));
     }
 }
Exemplo n.º 22
0
 /**
  * 订单管理
  * author 烟消云散 <*****@*****.**>
  */
 public function index()
 {
     /* 查询条件初始化 */
     $list = $this->lists('Ad', $map, 'id desc');
     $this->assign('list', $list);
     // 记录当前列表页的cookie
     Cookie('__forward__', $_SERVER['REQUEST_URI']);
     $this->meta_title = '广告管理';
     $this->display();
 }
 public function update()
 {
     $model = D('Record');
     $res = $model->update($_POST);
     if (!$res) {
         $this->error($model->getError());
     } else {
         $this->success($res['id'] ? '更新成功' : '新增成功', Cookie('__forward__'));
     }
 }
Exemplo n.º 24
0
 public function del()
 {
     $this->meta_title = '删除友情链接';
     $id = I('get.id', '');
     if (D('Addons://SuperLinks/SuperLinks')->del($id)) {
         $this->mtReturn(200, '删除友情链接成功', '', 'forward', Cookie('_currentUrl_'));
     } else {
         $this->mtReturn(300, D('Addons://SuperLinks/SuperLinks')->getError());
     }
 }
Exemplo n.º 25
0
 /**
  * 表管理
  */
 public function index()
 {
     $this->meta_title = '系统设置';
     /* 查询条件初始化 */
     $list = $this->lists('Db', 's_', 'tid');
     // 记录当前列表页的cookie
     Cookie('__forward__', $_SERVER['REQUEST_URI']);
     $this->assign('list', $list);
     $this->display();
 }
Exemplo n.º 26
0
 /**
  * 分类详情
  * @author jry <*****@*****.**>
  */
 public function detail($id)
 {
     $info = D('Category')->find($id);
     $template = $info['detail_template'] ? 'Document/' . $info['detail_template'] : 'Document/detail_page_default';
     $this->assign('info', $info);
     $this->assign('__CURRENT_CATEGORY__', $info['id']);
     $this->assign('meta_title', $info['title']);
     Cookie('__forward__', $_SERVER['REQUEST_URI']);
     $this->display($template);
 }
 public function login($username = '', $password = '', $verify = '')
 {
     if (IS_POST) {
         // 登录验证
         /* 检测验证码 */
         if (C('WEB_SITE_VERIFY') && !check_verify($verify)) {
             //ALEX[[[
             // $this->error ( '验证码输入错误!' );
             //]]]ALEX
         }
         /* 调用UC登录接口登录 */
         $user = new UserApi();
         $uid = $user->login($username, $password);
         if (0 < $uid) {
             // UC登录成功
             /* 登录用户 */
             $Member = D('Member');
             if ($Member->login($uid)) {
                 // 登录用户
                 $url = Cookie('__forward__');
                 if ($url) {
                     Cookie('__forward__', null);
                 } else {
                     $url = U('Home/Index/main');
                 }
                 session('is_follow_login', null);
                 $this->success('登录成功!', $url);
             } else {
                 $this->error($Member->getError());
             }
         } else {
             // 登录失败
             switch ($uid) {
                 case -1:
                     $error = '用户不存在或被禁用!';
                     break;
                     // 系统级别禁用
                 // 系统级别禁用
                 case -2:
                     $error = '密码错误!';
                     break;
                 default:
                     $error = '未知错误!';
                     break;
                     // 0-接口参数错误(调试阶段使用)
             }
             $this->error($error);
         }
     } else {
         // 显示登录表单
         $html = 'login';
         $_GET['from'] == 'store' && ($html = 'simple_login');
         $this->display($html);
     }
 }
 /**
  * 文章信息
  * @author jry <*****@*****.**>
  */
 public function detail($id)
 {
     $info = D('Notice')->find($id);
     if ($info['status'] !== '1') {
         $this->error('该公告不存在或已禁用');
     }
     $this->assign('info', $info);
     $this->assign('meta_title', $info['title']);
     Cookie('__forward__', $_SERVER['REQUEST_URI']);
     $this->display();
 }
Exemplo n.º 29
0
 /**
  * 订单管理
  * author 烟消云散 <*****@*****.**>
  */
 public function index()
 {
     /* 查询条件初始化 */
     $map = array('status' => 1);
     $list = $this->lists('fcoupon', $map, 'id');
     $this->assign('list', $list);
     // 记录当前列表页的cookie
     Cookie('__forward__', $_SERVER['REQUEST_URI']);
     $this->meta_title = '优惠券管理';
     $this->display();
 }
Exemplo n.º 30
0
 /**
  * 广告管理
  * @author 蜉尘 <*****@*****.**>
  */
 public function index($p = '1')
 {
     /* 查询条件初始化 */
     $map = array();
     $map = array('status' => 1);
     // 记录当前列表页的cookie
     Cookie('__forward__', $_SERVER['REQUEST_URI']);
     $list = $this->lists('Message', $map, 'create_time desc');
     $this->assign('list', $list);
     $this->display();
 }