Example #1
0
 /**
  * 设计师案例
  */
 public function index()
 {
     parent::_initalize();
     $this->assign("systemConfig", $this->systemConfig);
     $this->assign("gzlist", $this->getgzh());
     #设计师
     $cmod = new CityModel();
     $pro_list = $cmod->getcity(1);
     $this->assign("pro_list", $pro_list);
     $is_qx = $this->getqx($_SESSION['my_info']['role']);
     $this->assign("is_qx", $is_qx);
     if ($is_qx == 0) {
         $p_id = $_GET['province'];
         $c_id = $_GET['city'];
     } else {
         $p_id = $_SESSION['my_info']['proid'];
         $c_id = $_SESSION['my_info']['cityid'];
     }
     $keys = $_GET['keys'];
     $keys = $keys == "请输入关键字" ? "" : $keys;
     $uid = $_GET['uid'];
     $this->assign("keys", $keys);
     $this->assign("uid", $uid);
     $this->assign("p_id", $p_id);
     $this->assign("c_id", $c_id);
     $this->assign("cityname", $cmod->getname($c_id));
     import("ORG.Util.Page");
     $where = "cases.type=2 ";
     if (!empty($p_id)) {
         $where .= " and cases.p_id=" . $p_id;
     }
     if (!empty($c_id)) {
         $where .= " and cases.c_id=" . $c_id;
     }
     if (!empty($keys)) {
         $where .= " and cases.title like '%" . $keys . "%'";
     }
     if (!empty($uid)) {
         $where .= " and cases.uid=" . $uid;
     }
     $M = D("SjcaseView");
     $totalRows = $M->where($where)->count();
     $p = new Page($totalRows, 10);
     $list = $M->where($where)->order("cases.addtime desc")->limit($p->firstRow . "," . $p->listRows)->select();
     $this->assign("page", $p->show());
     $inf = (include_once './Common/config2.php');
     foreach ($list as $k => $v) {
         $list[$k]['is_jds'] = $v['is_jd'] == 1 ? "经典" : "普通";
         $list[$k]['status_f'] = $v['status'] == 1 ? "已审核" : "未审核";
     }
     $this->assign("list", $list);
     $this->assign("jd", $inf['zxjd']);
     $this->display();
 }
Example #2
0
 /**
  * 列表小区
  */
 public function listxq()
 {
     parent::_initalize();
     $this->assign("systemConfig", $this->systemConfig);
     $where = "1";
     $cmod = new CityModel();
     if ($this->getqx($_SESSION['my_info']['role']) == 1) {
         //地区管理员
         $p_id = $_SESSION['my_info']['proid'];
         $c_id = $_SESSION['my_info']['cityid'];
         $qlist = $cmod->getcity($c_id);
         $this->assign("qlist", $qlist);
         $this->assign("p_id", $p_id);
         $this->assign("c_id", $c_id);
         $this->assign("is_qx", 1);
     } else {
         $p_id = $_GET['p_id'];
         $c_id = $_GET['c_id'];
         $plist = $cmod->getcity(1);
         $this->assign("plist", $plist);
         $this->assign("p_id", $p_id);
         $this->assign("c_id", $c_id);
         $this->assign("c_name", $cmod->getname($c_id));
         $this->assign("is_qx", 0);
     }
     $q_id = $_GET['q_id'];
     $this->assign("q_id", $q_id);
     $this->assign("q_name", $cmod->getname($q_id));
     $keys = $_GET['keys'];
     $keys = $keys == "请输入关键字" ? "" : $keys;
     $this->assign("keys", $keys);
     @import("ORG.Util.Page");
     $mod = D("XqView");
     if (!empty($p_id)) {
         $where .= " and Xq.p_id=" . $p_id;
     }
     if (!empty($c_id)) {
         $where .= " and Xq.c_id=" . $c_id;
     }
     if (!empty($q_id)) {
         $where .= " and Xq.q_id=" . $q_id;
     }
     if (!empty($keys)) {
         $where .= " and Xq.name like '%" . $keys . "%'";
     }
     $totalRows = $mod->where($where)->count();
     $page = new Page($totalRows, 10);
     $list = $mod->where($where)->limit($page->firstRow . "," . $page->listRows)->order("Xq.addtime desc ")->select();
     foreach ($list as $k => $v) {
         $list[$k]['addtimef'] = date("Y-m-d H:i:s", $v['addtime']);
     }
     $this->assign("list", $list);
     $this->assign("page", $page->show());
     $this->display();
 }
Example #3
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");
 }
Example #4
0
 /**
  * 套餐列表
  */
 public function taocan()
 {
     parent::_initalize();
     $this->assign("systemConfig", $this->systemConfig);
     import("ORG.Util.Page");
     $is_qx = $this->getqx($_SESSION['my_info']['role']);
     $citymod = new CityModel();
     if ($is_qx) {
         $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);
         $p_id = $_GET['p_id'];
         $c_id = $_GET['c_id'];
     }
     $q_id = $_GET['q_id'];
     $where = "1";
     if (!empty($p_id)) {
         $where .= " and p_id=" . $p_id;
     }
     if (!empty($c_id)) {
         $where .= " and c_id=" . $c_id;
     }
     if (!empty($q_id)) {
         $where .= " and q_id=" . $q_id;
     }
     $this->assign("p_id", $p_id);
     $this->assign("c_id", $c_id);
     $this->assign("c_name", $citymod->getname($c_id));
     $this->assign("q_id", $q_id);
     $this->assign("q_name", $citymod->getname($q_id));
     $u_id = $_GET['uid'];
     if (!empty($u_id)) {
         $where .= " and uid=" . $u_id;
     }
     $this->assign("uid", $u_id);
     $keys = $_GET['keys'];
     $keys = $keys == "请输入关键字" ? "" : $keys;
     if (!empty($keys)) {
         $where .= " and tcname like '%" . $keys . "%'";
     }
     $this->assign("keys", $keys);
     $M = M("Taocanview");
     $totalRows = $M->where($where)->count();
     $p = new Page($totalRows, 10);
     $this->assign("page", $p->show());
     $list = $M->where($where)->order("id desc")->limit($p->firstRow . "," . $p->listRows)->select();
     $this->assign("list", $list);
     #商城列表
     $splist = $this->getgzh();
     $this->assign("sclist", $splist);
     $this->display();
 }
Example #5
0
 /**
  * 修改工人
  */
 public function editgr()
 {
     parent::_initalize();
     $this->assign("systemConfig", $this->systemConfig);
     $aid = $_GET['aid'];
     $m = M("Gongrenview");
     $info = $m->where("a_id=" . $aid)->find();
     $this->assign("info", $info);
     $cmod = new CityModel();
     $is_qx = $this->getqx($_SESSION['my_info']['role']);
     if ($is_qx == 1) {
         #地区管理员
         $c_id = $_SESSION['my_info']['cityid'];
         $p_id = $_SESSION['my_info']['proid'];
         $qlist = $cmod->getcity($c_id);
         $this->assign("qlist", $qlist);
         $this->assign("c_id", $c_id);
         $this->assign("p_id", $p_id);
     } else {
         #省
         $p_id = $_GET['p_id'];
         $c_id = $_GET['c_id'];
         $plist = $cmod->getprovince(1);
         $this->assign("plist", $plist);
         $this->assign("province", $p_id);
     }
     $this->assign("is_qx", $is_qx);
     if (IS_POST) {
         $pwd = trim($_POST['pwd']);
         $confirm_pwd = trim($_POST['confirm_pwd']);
         $a_name = trim($_POST['a_name']);
         $status = trim($_POST['status']);
         //附加表------------start
         $picName = $_POST['picName'];
         //头像修改
         $truename = trim($_POST['truename']);
         $ruzhitime = trim($_POST['ruzhitime']);
         $sfz_img = $_FILES['sfz_img']['name'];
         //身份证
         $content = trim($_POST['content']);
         $movphone = trim($_POST['movphone']);
         $sex = $_POST['sex'];
         $email = trim($_POST['email']);
         $gongling = trim($_POST['gongling']);
         $qq = trim($_POST['qq']);
         $orders = trim($_POST['orders']);
         $is_tj = trim($_POST['is_tj']);
         $p_id = $_POST['p_id'];
         $c_id = $_POST['c_id'];
         $q_id = $_POST['q_id'];
         $address = $_POST['address'];
         $jingdu = $_POST['jingdu'];
         $weidu = $_POST['weidu'];
         //附加表-------------end
         $data = array();
         if (!empty($pwd) && !empty($confirm_pwd)) {
             //修改密码
             if ($pwd != $confirm_pwd) {
                 $this->error("两次输入的密码必须一致!");
                 exit;
             }
             $data['a_pwd'] = encrypt($pwd);
         }
         if (empty($a_name)) {
             $this->error("登录名称不能为空!");
             exit;
         }
         if ($a_name != $info['a_name']) {
             $data['a_name'] = $a_name;
         }
         if ($status != $info['status']) {
             $data['status'] = $status;
         }
         if (!empty($picName)) {
             unlink("./avatar/" . $info['logo']);
         }
         if (!empty($sfz_img)) {
             $path = "/Uploads/shangjia/";
             $imginfo = $this->upload("." . $path);
             if (!empty($imginfo[0]['savename'])) {
                 $sfzimg = $imginfo[0]['savename'];
                 unlink("." . $path . $info['sfz_img']);
             }
         }
         $datafj = array();
         if (!empty($sfzimg)) {
             $datafj['sfz_img'] = $sfzimg;
         }
         if ($truename != $info['truename']) {
             $datafj['truename'] = $truename;
         }
         if ($ruzhitime != $info['ruzhitime']) {
             $datafj['ruzhitime'] = $ruzhitime;
         }
         if (!empty($picName)) {
             $datafj['logo'] = $picName;
         }
         if ($content != $info['content']) {
             $datafj['content'] = $content;
         }
         if ($movphone != $info['movphone']) {
             $datafj['movphone'] = $movphone;
         }
         if ($sex != $info['sex']) {
             $datafj['sex'] = $sex;
         }
         if ($email != $info['email']) {
             $datafj['email'] = $email;
         }
         if ($gongling != $info['gongling']) {
             $datafj['gongling'] = $gongling;
         }
         if ($address != $info['address']) {
             $datafj['address'] = $address;
         }
         if ($qq != $info['qq']) {
             $datafj['qq'] = $qq;
         }
         if ($orders != $info['orders']) {
             $datafj['orders'] = $orders;
         }
         if ($is_tj != $info['is_tj']) {
             $datafj['is_tj'] = $is_tj;
         }
         if ($p_id != $info['p_id']) {
             $datafj['p_id'] = $p_id;
         }
         if ($c_id != $info['c_id']) {
             $datafj['c_id'] = $c_id;
         }
         if ($q_id != $info['q_id']) {
             $datafj['q_id'] = $q_id;
         }
         if ($jingdu != $info['jingdu']) {
             $datafj['jingdu'] = $jingdu;
         }
         if ($weidu != $info['weidu']) {
             $datafj['weidu'] = $weidu;
         }
         $m1 = M("Member");
         $m2 = M("Gongren");
         if (!empty($data)) {
             $res1 = $m1->where("a_id=" . $aid)->save($data);
         } else {
             $res1 = 1;
         }
         if (!empty($datafj)) {
             $res2 = $m2->where("a_id=" . $aid)->save($datafj);
         } else {
             $res2 = 1;
         }
         if (!$res1 && !$res2) {
             $this->error("操作失败!");
         } else {
             $this->success("操作成功!", U("Member/grlist"));
         }
         exit;
     }
     $this->display("addgr");
 }
Example #6
0
 /**
  * 列表
  * 实体店幻灯片
  */
 public function liststhdp()
 {
     parent::_initalize();
     $this->assign("systemConfig", $this->systemConfig);
     $hdM = D("ShitihdpView");
     @import("ORG.Util.Page");
     $where = "1";
     $cmod = new CityModel();
     if ($this->getqx($_SESSION['my_info']['role']) == 1) {
         //地区管理员
         $p_id = $_SESSION['my_info']['proid'];
         $c_id = $_SESSION['my_info']['cityid'];
         $qlist = $cmod->getcity($c_id);
         //区
         $this->assign("qlist", $qlist);
         $this->assign("is_qx", 1);
     } else {
         //非地区管理员
         $plist = $cmod->getcity(1);
         //省
         $this->assign("plist", $plist);
         $p_id = $_GET['p_id'];
         $c_id = $_GET['c_id'];
         $this->assign("is_qx", 0);
     }
     $q_id = $_GET['q_id'];
     $stid = $_GET['stid'];
     $stlist = M("Shiti")->field("id,name")->order("addtime desc")->select();
     $this->assign("stlist", $stlist);
     if (!empty($p_id)) {
         $where .= " and Shiti.p_id=" . $p_id;
     }
     if (!empty($c_id)) {
         $where .= " and Shiti.c_id=" . $c_id;
     }
     if (!empty($q_id)) {
         $where .= " and Shiti.q_id=" . $q_id;
     }
     if (!empty($stid)) {
         $where .= " and Shitihdp.stid=" . $stid;
     }
     $cou = $hdM->where($where)->count();
     $page = new Page($cou, 10);
     $list = $hdM->where($where)->order("Shitihdp.addtime desc")->limit($page->firstRow . "," . $page->listRows)->select();
     $zt = array("0" => "隐藏", "1" => "显示");
     foreach ($list as $k => $v) {
         $list[$k]['addtimef'] = date("Y-m-d H:i:s", $v['addtime']);
         $list[$k]['isdis'] = $zt[$v['is_display']];
     }
     $this->assign("list", $list);
     $this->assign("p_id", $p_id);
     $this->assign("c_id", $c_id);
     $this->assign("c_name", $cmod->getname($c_id));
     $this->assign("q_id", $q_id);
     $this->assign("q_name", $cmod->getname($q_id));
     $this->assign("stid", $stid);
     $this->assign("page", $page->show());
     $this->display();
 }