示例#1
0
 /**
  * 视频列表
  */
 public function index()
 {
     parent::_initalize();
     $this->assign("systemConfig", $this->systemConfig);
     $is_qx = $this->getqx($_SESSION['my_info']['role']);
     $where = "1";
     if ($is_qx == 1) {
         $where .= " and p_id=" . $_SESSION['my_info']['proid'];
         $where .= " and c_id=" . $_SESSION['my_info']['cityid'];
     } else {
         $citymod = new CityModel();
         $plist = $citymod->getprovince(1);
         $this->assign("plist", $plist);
         $p_id = $_GET['p_id'];
         $c_id = $_GET['c_id'];
         if (!empty($p_id)) {
             $where .= " and p_id=" . $p_id;
         }
         if (!empty($c_id)) {
             $where .= " and c_id=" . $c_id;
         }
         $this->assign("p_id", $p_id);
         $this->assign("c_id", $c_id);
         $this->assign("cname", $citymod->getname($c_id));
     }
     $this->assign("is_qx", $is_qx);
     $keys = $_GET['keys'];
     $keys = $keys == "请输入关键字" ? "" : $keys;
     $uid = $_GET['uid'];
     if (!empty($keys)) {
         $where .= " and title like '%" . $keys . "%'";
     }
     if (!empty($uid)) {
         $where .= " and uid=" . $uid;
     }
     $this->assign("uid", $uid);
     $this->assign("keys", $keys);
     $M = M("Shipin");
     $cou = $M->where($where)->count();
     import("ORG.Util.Page");
     $p = new Page($cou, 10);
     $list = $M->where($where)->limit($p->firstRow . "," . $p->listRows)->order("addtime desc")->select();
     $arr = array("未审核", "已审核");
     foreach ($list as $k => $v) {
         $list[$k]['status_f'] = $arr[$v['status']];
     }
     $this->assign("list", $list);
     $this->assign("page", $p->show());
     $conf = (include './Common/config2.php');
     $memtype = $conf['memtp'];
     $this->assign("tplist", $memtype);
     $this->display();
 }
示例#2
0
 /**
  * 加盟列表
  */
 public function index()
 {
     parent::_initalize();
     $this->assign("systemConfig", $this->systemConfig);
     $citymod = new CityModel();
     $province = $_GET['province'];
     $city = $_GET['city'];
     $where = "1";
     if ($this->getqx($_SESSION['my_info']['role']) == 0) {
         //非地区管理员
         $pro_list = $citymod->getprovince(1);
         $this->assign("pro_list", $pro_list);
         if (!empty($province)) {
             $where .= " and Zixun.p_id=" . $province;
         }
         if (!empty($city)) {
             $where .= " and Zixun.c_id=" . $city;
         }
         $this->assign("is_qx", $this->getqx($_SESSION['my_info']['role']));
         $this->assign("province", $province);
         $this->assign("city", $city);
         $cityname = $citymod->getname($city);
         $this->assign("cityname", $cityname);
     } else {
         $where .= " and p_id=" . $_SESSION['my_info']['proid'];
         $where .= " and c_id=" . $_SESSION['my_info']['cityid'];
         $this->assign("is_qx", $this->getqx($_SESSION['my_info']['role']));
     }
     $keys = $_GET['keys'];
     $keys = $keys == "请输入关键字" ? "" : $keys;
     $uid = $_GET['uid'];
     if (!empty($keys)) {
         $where .= " and Zixun.name like '%" . $keys . "%'";
     }
     $this->assign("keys", $keys);
     $M = D("ZixunView");
     $cou = $M->where($where)->count();
     import("ORG.Util.Page");
     $p = new Page($cou, 10);
     $list = $M->where($where)->limit($p->firstRow . "," . $p->listRows)->order("Zixun.addtime desc")->select();
     $arr = array("未审核", "已审核");
     foreach ($list as $k => $v) {
         $list[$k]['status_f'] = $arr[$v['status']];
         $list[$k]['addtime_f'] = date("Y-m-d", $v['addtime']);
     }
     $this->assign("list", $list);
     $this->assign("page", $p->show());
     $this->display();
 }
示例#3
0
 /**
  * 意见反馈列表
  */
 public function index()
 {
     parent::_initalize();
     $this->assign("systemConfig", $this->systemConfig);
     @import("ORG.Util.Page");
     $where = "1";
     if ($is_qx == 0) {
         //非地区管理员
         $p_id = $_GET['p_id'];
         $c_id = $_GET['c_id'];
         //省
         $mcity = new CityModel();
         $plist = $mcity->getprovince(1);
         $this->assign("plist", $plist);
         $this->assign("p_id", $p_id);
         $this->assign("c_id", $c_id);
         $this->assign("c_name", $mcity->getname($c_id));
     } else {
         $p_id = $_SESSION['my_info']['proid'];
         $c_id = $_SESSION['my_info']['cityid'];
     }
     if (!empty($p_id)) {
         $where .= " and Yijian.p_id=" . $p_id;
     }
     if (!empty($c_id)) {
         $where .= " and Yijian.c_id=" . $c_id;
     }
     $keys = trim($_GET['keys']);
     $keys = $keys == "请输入关键字" ? "" : $keys;
     $where .= " and Yijian.content like '%" . $keys . "%'";
     $this->assign("keys", $keys);
     $yjv = D("YijianView");
     $totalRows = $yjv->where($where)->count();
     $pm = new Page($totalRows, 10);
     $list = $yjv->where($where)->order("Yijian.addtime desc")->limit($pm->firstRow . "," . $pm->listRows)->select();
     $islx = array("0" => "未联系", "1" => "已联系");
     foreach ($list as $k => $v) {
         $list[$k]['addtimef'] = date("Y-m-d H:i:s", $v['addtime']);
         $list[$k]['islxf'] = $islx[$v['is_lx']];
     }
     $this->assign("list", $list);
     $this->assign("page", $pm->show());
     #echo $yjv->getLastSql();
     #省
     $this->display();
 }
示例#4
0
 /**
  * 设计师 预约列表
  */
 public function gzyy()
 {
     parent::_initalize();
     $this->assign("systemConfig", $this->systemConfig);
     $Mod = D("YuyueView");
     import("ORG.Util.Page");
     $where = "Yuyue.ytype=2";
     $citymod = new CityModel();
     if ($this->getqx($_SESSION['my_info']['role']) == 1) {
         $where .= " and Yuyue.p_id=" . $_SESSION['my_info']['proid'];
         $where .= " and Yuyue.c_id=" . $_SESSION['my_info']['cityid'];
     } else {
         $p_list = $citymod->getprovince(1);
         $this->assign("p_list", $p_list);
         $p_id = $_GET['p_id'];
         $c_id = $_GET['c_id'];
         if (!empty($p_id)) {
             $where .= " and Yuyue.p_id=" . $p_id;
         }
         if (!empty($c_id)) {
             $where .= " and Yuyue.c_id=" . $c_id;
         }
         $this->assign("c_id", $c_id);
         $this->assign("c_name", $citymod->getname($c_id));
         $this->assign("p_id", $p_id);
     }
     $keys = $_GET['keys'];
     $keys = $keys == "请输入关键字" ? "" : $keys;
     if (!empty($keys)) {
         $where .= " and Yuyue.name like '%" . $keys . "%'";
     }
     $this->assign("keys", $keys);
     $totalRows = $Mod->where($where)->count();
     $p = new Page($totalRows, 10);
     $list = $Mod->where($where)->order("Yuyue.addtime desc")->limit($p->firstRow . "," . $p->listRows)->select();
     $arr = array("未审核", "已审核");
     foreach ($list as $k => $v) {
         $list[$k]['status_f'] = $arr[$v['status']];
     }
     $this->assign("list", $list);
     $this->assign("page", $p->show());
     $this->display();
 }
示例#5
0
 /**
  +----------------------------------------------------------
 * 添加管理员
  +----------------------------------------------------------
 */
 public function editAdmin()
 {
     parent::_initalize();
     $systemConfig = $this->systemConfig;
     $this->assign("systemConfig", $systemConfig);
     if (IS_POST) {
         $this->checkToken();
         header('Content-Type:application/json; charset=utf-8');
         $msginfo = D("Access")->editAdmin();
         if ($msginfo['status']) {
             $this->success($msginfo['info'], U('Access/index'));
         } else {
             $this->error($msginfo['info']);
         }
     } else {
         //省市
         $cmod = new CityModel();
         #$city_list=$cmod->citylist();
         #print_r($city_list);exit;
         $city_list = $cmod->getprovince(1);
         $this->assign("pro_list", $city_list);
         $M = M("Admin");
         $aid = (int) $_GET['aid'];
         $pre = C("DB_PREFIX");
         $info = $M->where("`a_id`=" . $aid)->join($pre . "role_user ON " . $pre . "admin.a_id = " . $pre . "role_user.user_id")->find();
         if (empty($info['a_id'])) {
             #echo $M->getLastSql();exit;
             $this->error("不存在该管理员ID", U('Access/index'));
         }
         if ($info['a_name'] == C('ADMIN_AUTH_KEY')) {
             $this->error("超级管理员信息不允许操作", U("Access/index"));
             exit;
         }
         $this->assign("info", $this->getRoleListOption($info));
         $aimod = new Admininfo1Model();
         $ainfo = $aimod->getinfo($aid, 0);
         $this->assign("ainfo", $ainfo);
         //如果市不为空获取市的名称
         if ($ainfo['cityid'] != '') {
             $cityname = $cmod->getname($ainfo['cityid']);
             $this->assign("cityname", $cityname);
             $this->assign("cityid", $ainfo['cityid']);
         }
         //如果区不为空获取区的名称
         if ($ainfo['quid'] != '') {
             $quname = $cmod->getname($ainfo['quid']);
             $this->assign("quname", $quname);
             $this->assign("quid", $ainfo['quid']);
         }
         $this->display("addadmin");
     }
 }
示例#6
0
 /**
  * 编辑广告
  */
 public function editad()
 {
     if (IS_POST) {
         $id = $_POST['id'];
         $M = M("Adview");
         $info = $M->where("id=" . $id)->find();
         $title = trim($_POST['title']);
         $link = trim($_POST['link']);
         $weizhi = $_POST['weizhi'];
         $p_id = $_POST['p_id'];
         $c_id = $_POST['c_id'];
         if (empty($title)) {
             $this->error("名称不能为空!");
             exit;
         }
         if (empty($weizhi)) {
             $this->error("请选择位置!");
             exit;
         }
         if ($this->getqx($_SESSION['my_info']['role']) == 0) {
             //非地区管理员
             if (empty($p_id)) {
                 $this->error("请选省!");
                 exit;
             }
             if (empty($c_id)) {
                 $this->error("请选市!");
                 exit;
             }
         } else {
             $p_id = $_SESSION['my_info']['proid'];
             $c_id = $_SESSION['my_info']['cityid'];
             if (empty($p_id)) {
                 $this->error("该管理员没有选择省!");
                 exit;
             }
             if (empty($c_id)) {
                 $this->error("该管理员没有选择市!");
                 exit;
             }
         }
         if (!empty($_FILES['img']['name'])) {
             $imgsrc = $this->upload("./Uploads/ad/");
             if (empty($imgsrc[0]['savename'])) {
                 $img = "";
             } else {
                 $img = "/Uploads/ad/" . $imgsrc[0]['savename'];
             }
             if (!empty($info['img'])) {
                 unlink($info['img']);
             }
         }
         $data = array();
         if (!empty($img)) {
             $data['img'] = $img;
         }
         if (!empty($link)) {
             $data['link'] = $link;
         }
         if (!empty($title)) {
             $data['title'] = $title;
         }
         if (!empty($weizhi)) {
             $data['weizhi'] = $weizhi;
         }
         if (!empty($p_id)) {
             $data['p_id'] = $p_id;
         }
         if (!empty($c_id)) {
             $data['c_id'] = $c_id;
         }
         $data['addtime'] = time();
         $data['adduid'] = $_SESSION['my_info']['a_id'];
         $res = M("Ad")->where("id=" . $id)->save($data);
         if ($res) {
             $this->success("操作成功", U("Ad/adlist"));
         } else {
             $this->error("操作失败");
         }
         exit;
     }
     parent::_initalize();
     $this->assign("systemConfig", $this->systemConfig);
     $id = $_GET['id'];
     $M = M("Adview");
     $info = $M->where("id=" . $id)->find();
     //位置
     $wzm = M("Adweizhi");
     $wzlist = $wzm->where("1")->order("addtime desc")->select();
     $this->assign("wzlist", $wzlist);
     //省
     if ($this->getqx($_SESSION['my_info']['role']) == 0) {
         //非地区管理员
         $mcity = new CityModel();
         $plist = $mcity->getprovince(1);
         $this->assign("plist", $plist);
         $this->assign("c_id", $info['c_id']);
         $this->assign("c_name", $info['c_name']);
     }
     $this->assign("info", $info);
     $is_qx = $this->getqx($_SESSION['my_info']['role']);
     $this->assign("is_qx", $is_qx);
     $this->display("addad");
 }
示例#7
0
 /**
  * 编辑单页面
  */
 public function edit_webpage()
 {
     if (IS_POST) {
         $name = trim($_POST['name']);
         $ywname = trim($_POST['ywname']);
         $p_id = trim($_POST['p_id']);
         $c_id = trim($_POST['c_id']);
         $contents = trim($_POST['contents']);
         $id = $_POST['id'];
         $M = M("Webpages");
         $data = array("name" => $name, "contents" => $contents, "ywname" => $ywname, "p_id" => $p_id, "c_id" => $c_id);
         $rs = $M->where("id=" . $id)->save($data);
         if ($rs) {
             $this->success("操作成功!", U("Webpages/index"));
         } else {
             $this->error("操作失败!");
         }
         exit;
     }
     parent::_initalize();
     $this->assign("systemConfig", $this->systemConfig);
     $id = $_GET['id'];
     $wmod = M("Webpages");
     $info = $wmod->where("id=" . $id)->find();
     $this->assign("info", $info);
     #-------------------------------------------------------------省start
     $is_qx = $this->getqx($_SESSION['my_info']['role']);
     if ($is_qx == 0) {
         #省
         $citymod = new CityModel();
         $plist = $citymod->getprovince(1);
         $this->assign("plist", $plist);
     } else {
         $p_id = $_SESSION['my_info']['proid'];
         $c_id = $_SESSION['my_info']['cityid'];
     }
     $p_id = $info['p_id'];
     $c_id = $info['c_id'];
     $c_name = $citymod->getname($c_id);
     $this->assign("p_id", $p_id);
     $this->assign("c_id", $c_id);
     $this->assign("c_name", $c_name);
     #-------------------------------------------------------------省end
     $this->display("add_webpage");
 }
 /**
  * 编辑友情链接
  */
 public function editfirendlink()
 {
     $m = M("Firendlink");
     if (IS_POST) {
         $id = $_POST['id'];
         $name = trim($_POST['name']);
         if (empty($name)) {
             $this->error("名称不能为空!");
             exit;
         }
         if ($_FILES['logo']['name'] != '') {
             $imginfo = $this->upload('./Uploads/fl/');
             if (!empty($imginfo[0]['savename'])) {
                 $logo = "/Uploads/fl/" . $imginfo[0]['savename'];
             } else {
                 $logo = "";
             }
         }
         $link = trim($_POST['link']);
         $orders = trim($_POST['orders']);
         $is_tj = $_POST['is_tj'];
         $p_id = $_POST['p_id'];
         $c_id = $_POST['c_id'];
         $data = array();
         if (!empty($name)) {
             $data['name'] = $name;
         }
         if (!empty($logo)) {
             $data['logo'] = $logo;
         }
         if (!empty($link)) {
             $data['link'] = $link;
         }
         if (!empty($orders)) {
             $data['orders'] = $orders;
         }
         if (!empty($is_tj)) {
             $data['is_tj'] = $is_tj;
         }
         if (!empty($p_id)) {
             $data['p_id'] = $p_id;
         }
         if (!empty($c_id)) {
             $data['c_id'] = $c_id;
         }
         $res = $m->where("id=" . $id)->save($data);
         if ($res) {
             $this->success("操作成功!", U("Firendlink/index"));
         } else {
             $this->error("操作失败!");
         }
         exit;
     }
     parent::_initalize();
     $this->assign("systemConfig", $this->systemConfig);
     $id = $_GET['id'];
     $info = $m->where("id=" . $id)->find();
     $this->assign("info", $info);
     if ($this->getqx($_SESSION['my_info']['role']) == 0) {
         #读取省
         $mcity = new CityModel();
         $plist = $mcity->getprovince(1);
         $this->assign("plist", $plist);
         $this->assign("c_id", $info['c_id']);
         $this->assign("c_name", $mcity->getname($info['c_id']));
     }
     $this->assign("is_qx", $this->getqx($_SESSION['my_info']['role']));
     $this->display("addfriendlink");
 }
示例#9
0
 /**
  * 编辑
  * 团购活动
  */
 public function edit_group()
 {
     if (IS_POST) {
         $title = trim($_POST['title']);
         $is_tj = $_POST['is_tj'];
         $p_id = $_POST['p_id'];
         $c_id = $_POST['c_id'];
         $q_id = $_POST['q_id'];
         $status = $_POST['status'];
         $starthdtime = $_POST['starthdtime'];
         $endhdtime = $_POST['endhdtime'];
         $address = trim($_POST['address']);
         $shuoming = trim($_POST['shuoming']);
         $chengchelx = str_replace("\n", ",", $chengchelx);
         $bmnum = trim($_POST['bmnum']);
         $id = $_POST['id'];
         if (!empty($starthdtime)) {
             $starthdtime1 = strtotime($starthdtime);
         }
         if (!empty($endhdtime)) {
             $endhdtime1 = strtotime($endhdtime);
         }
         if ($starthdtime1 > $endhdtime1) {
             $this->error("开始时间不能大于结束时间!");
             exit;
         }
         $M = D("GroupView");
         $info1 = $M->where("id=" . $id)->find();
         $img = $this->upload();
         if (!empty($img)) {
             foreach ($img as $k => $v) {
                 if ($v['key'] == "mapimg") {
                     unlink("." . $info1['mapimg']);
                     $mapimg = "/Uploads/product/" . $v['savename'];
                 } else {
                     unlink("." . $info1['hdimg']);
                     $hdimg = "/Uploads/product/" . $v['savename'];
                 }
             }
         }
         $data = array();
         if (!empty($title) && $title != $info1['title']) {
             $data['title'] = $title;
         }
         if ($is_tj != $info1['is_tj']) {
             $data['is_tj'] = $is_tj;
         }
         if ($p_id != $info1['p_id']) {
             $data['p_id'] = $p_id;
         }
         if ($c_id != $info1['c_id']) {
             $data['c_id'] = $c_id;
         }
         if ($q_id != $info1['q_id']) {
             $data['q_id'] = $q_id;
         }
         if ($starthdtime1 != $info1['starthdtime']) {
             $data['starthdtime'] = $starthdtime1;
         }
         if ($endhdtime1 != $info1['endhdtime']) {
             $data['endhdtime'] = $endhdtime1;
         }
         if ($address != $info1['address']) {
             $data['address'] = $address;
         }
         if ($shuoming != $info1['shuoming']) {
             $data['shuoming'] = $shuoming;
         }
         if ($chengchelx != $info1['chengchelx']) {
             $data['chengchelx'] = $chengchelx;
         }
         if (!empty($mapimg)) {
             $data['mapimg'] = $mapimg;
         }
         if (!empty($hdimg)) {
             $data['hdimg'] = $hdimg;
         }
         if (!empty($bmnum) && $bmnum != $info1['bmnum']) {
             $data['bmnum'] = $bmnum;
         }
         $data['addtime'] = time();
         if ($status != $info1['status']) {
             $data['status'] = $status;
         }
         $rs = $M->where("id=" . $id)->save($data);
         if ($rs) {
             $this->success("操作成功!", U("Group/index"));
         } else {
             $this->error("操作失败!");
         }
         exit;
     }
     parent::_initalize();
     $this->assign("systemConfig", $this->systemConfig);
     $id = $_GET['id'];
     $M = D("GroupView");
     $info = $M->where("Group1.id=" . $id)->find();
     $info['chengchelx'] = str_replace(",", "\n", $info['chengchelx']);
     $is_qx = $this->getqx($_SESSION['my_info']['role']);
     $citymod = new CityModel();
     if ($is_qx == 1) {
         #区管理员
         $p_id = $_SESSION['my_info']['proid'];
         $c_id = $_SESSION['my_info']['cityid'];
         $qlist = $citymod->getcity($c_id);
         $this->assign("qlist", $qlist);
     } else {
         #省
         $plist = $citymod->getprovince(1);
         $this->assign("plist", $plist);
         $this->assign("c_name", $info['c_name']);
         $this->assign("q_name", $info['q_name']);
     }
     $this->assign("starthdtime", date("Y-m-d H:i", $info['starthdtime']));
     $this->assign("endhdtime", date("Y-m-d H:i", $info['endhdtime']));
     $this->assign("info", $info);
     $this->assign("is_edit", 1);
     $this->assign("comname", $this->getgzh_ins($info['uid']));
     $this->display("add_group");
 }
示例#10
0
 /**
  * 优惠券列表
  */
 public function list_yhq()
 {
     parent::_initalize();
     $this->assign('systemConfig', $this->systemConfig);
     import("ORG.Util.Page");
     $M = M("Yhq");
     $where = '1';
     $is_qx = $this->getqx($_SESSION['my_info']['role']);
     if ($is_qx == 1) {
         $p_id = $_SESSION['my_info']['proid'];
         $c_id = $_SESSION['my_info']['cityid'];
     } else {
         $p_id = $_GET['p_id'];
         $c_id = $_GET['c_id'];
         $this->assign("p_id", $p_id);
         $this->assign("c_id", $c_id);
         $citymod = new CityModel();
         $plist = $citymod->getprovince(1);
         $this->assign("plist", $plist);
         $this->assign("cname", $citymod->getname($c_id));
     }
     $this->assign("is_qx", $is_qx);
     $startdate = $_GET['startdate'];
     $startdate1 = $_GET['startdate1'];
     $enddate = $_GET['enddate'];
     $enddate1 = $_GET['enddate1'];
     $this->assign("startdate", $startdate);
     $this->assign("startdate1", $startdate1);
     $this->assign("enddate", $enddate);
     $this->assign("enddate1", $enddate1);
     if (!empty($startdate)) {
         $starttime = strtotime($startdate);
     }
     if (!empty($startdate1)) {
         $starttime1 = strtotime($startdate1);
     }
     if (!empty($enddate)) {
         $endtime = strtotime($enddate);
     }
     if (!empty($enddate1)) {
         $endtime1 = strtotime($enddate1);
     }
     if ($starttime > $starttime1) {
         $this->error("开始时间第一个不能大于第二个");
         exit;
     }
     if ($endtime > $endtime1) {
         $this->error("结束时间第一个不能大于第二个");
         exit;
     }
     if (!empty($p_id)) {
         $where .= " and p_id=" . $p_id;
     }
     if (!empty($c_id)) {
         $where .= " and c_id=" . $c_id;
     }
     if (!empty($starttime) && !empty($starttime1)) {
         $where .= " and (startdate between '" . $starttime . "' and '" . $starttime1 . "' )";
     }
     if (!empty($endtime) && !empty($endtime1)) {
         $where .= " and (enddate between '" . $endtime . "' and '" . $endtime1 . "' )";
     }
     $totalRows = $M->where($where)->count();
     $p = new Page($totalRows, 10);
     $list = $M->where($where)->order(" addtime desc ")->limit($p->firstRow . "," . $p->listRows)->select();
     $arr = array("普通", '推荐');
     $arr1 = array("未审核", "已审核");
     foreach ($list as $k => $v) {
         $list[$k]['is_tj_f'] = $arr[$v['is_tj']];
         $list[$k]['status_f'] = $arr1[$v['status']];
         $list[$k]['startdate'] = date("Y-m-d H:i", $v['startdate']);
         $list[$k]['enddate'] = date("Y-m-d H:i", $v['enddate']);
     }
     $this->assign("list", $list);
     $this->assign("page", $p->show());
     $this->display();
 }
示例#11
0
 /**
  * 获取城市
  */
 public function getcity()
 {
     header('Content-Type:application/json; charset=utf-8');
     $pid = $_POST['fid'];
     $citymod = new CityModel();
     $pro_list = $citymod->getprovince($pid);
     if ($pro_list) {
         echo json_encode(array("status" => 1, "data" => $pro_list));
     } else {
         echo json_encode(array("status" => 0, "data" => array()));
     }
 }