/** * 城市管理 */ public function city() { parent::_initalize(); $systemConfig = $this->systemConfig; $this->assign("systemConfig", $systemConfig); $id = $_GET['id']; $cmod = new CityModel(); $list = $cmod->citylist($id); $this->assign("list", $list); $sjid = $cmod->getprovinceid($id); if (!empty($sjid)) { $this->assign("shilieb", "<a href='" . U('Index/city', array('id' => $sjid)) . "' class='a1'>返回上级</a>"); } $this->assign("c_id", $id); $this->display(); }
/** * 添加店铺管理员 */ public function adddianpu() { if (IS_POST) { $a_name = trim($_POST['a_name']); $pwd = trim($_POST['pwd']); $confirm_pwd = trim($_POST['confirm_pwd']); $status = $_POST['status']; if (empty($a_name)) { $this->error("登录名称不能为空!"); exit; } if (empty($pwd)) { $this->error("密码不能为空!"); exit; } if (empty($confirm_pwd)) { $this->error("确认密码不能为空!"); exit; } if ($pwd != $confirm_pwd) { $this->error("两次输入的密码必须一致"); exit; } //登录名称是否存在 $memmod = new MemberModel(); if ($memmod->check_name($a_name) > 0) { $this->error("登录名已经存在,请重新命名"); exit; } $maindata = array("a_name" => $a_name, "a_pwd" => encrypt($pwd), "a_type" => 3, "status" => $status); $dinfo = $_POST['dinfo']; $dinfo['company'] = trim($dinfo['company']); $dinfo['lxrname'] = trim($dinfo['lxrname']); $dinfo['telphone'] = trim($dinfo['telphone']); $dinfo['movphone'] = trim($dinfo['movphone']); $dinfo['jifen'] = trim($dinfo['jifen']); $dinfo['email'] = trim($dinfo['email']); $dinfo['yingyetime'] = trim($dinfo['yingyetime']); $dinfo['address'] = trim($dinfo['address']); $dinfo['fwzz'] = trim($dinfo['fwzz']); $dinfo['ztmj'] = trim($dinfo['ztmj']); $dinfo['fwcn'] = trim($dinfo['fwcn']); $dinfo['comjianjie'] = trim($_POST['comjianjie']); $dinfo['comcontent'] = trim($_POST['comcontent']); $dinfo['fdnum'] = trim($dinfo['fdnum']); $dinfo['orders'] = trim($dinfo['orders']); $dinfo['click'] = trim($dinfo['click']); if (!empty($_FILES['dhimg']['name'])) { $dhinfo = $this->upload("./Uploads/shangjia/"); if (!empty($dhinfo)) { $dinfo['dhimg'] = $dhinfo[0]['savename']; } } $dinfo['wxts'] = trim($_POST['wxts']); if (empty($dinfo['collect'])) { $dinfo['collect'] = 10; } if (empty($dinfo['koubei'])) { $dinfo['koubei'] = 10; } $dinfo['jibie'] = trim($dinfo[jibie]); $pro_id = trim($_POST['pro_id']); $city_id = trim($_POST['city_id']); $q_id = trim($_POST['q_id']); $dinfo[dizhi] = trim($dinfo[dizhi]); $logo = $_POST['picName']; if ($_SESSION['my_info']['role'] != 2) { if (empty($pro_id)) { $this->error("请选择省份!"); exit; } if (empty($city_id)) { $this->error("请选择市!"); exit; } } else { $mod = new CityModel(); $city_id = $_SESSION['my_info']['cityid']; $pro_id = $mod->getprovinceid($city_id); } $jingdu = $_POST['jingdu']; $weidu = $_POST['weidu']; $fjdata = array("logo" => $logo, "company" => $dinfo['company'], "yingyezhizhao" => $dinfo['yingyezhizhao'], "lxrname" => $dinfo['lxrname'], "telphone" => $dinfo['telphone'], "movphone" => $dinfo['movphone'], "jifen" => $dinfo['jifen'], "email" => $dinfo['email'], "yingyetime" => $dinfo['yingyetime'], "fwzz" => $dinfo[fwzz], "ztmj" => $dinfo['ztmj'], "comcontent" => $dinfo['comcontent'], "fwcn" => $dinfo['fwcn'], "comjianjie" => $dinfo['comjianjie'], "fdnum" => $dinfo['fdnum'], "orders" => $dinfo['orders'], "click" => $dinfo['click'], "is_tj" => $dinfo['is_tj'], "dhimg" => $dinfo['dhimg'], "wxts" => $dinfo['wxts'], "p_id" => $pro_id, "c_id" => $city_id, "q_id" => $q_id, "jingdu" => $jingdu, "weidu" => $weidu, "address" => $dinfo[address]); $res = $memmod->add_member($maindata, $fjdata); if ($res['status']) { $this->success($res['info'], U("Member/dianpu")); } else { $this->error($res['info']); } exit; } parent::_initalize(); $systemConfig = $this->systemConfig; $this->assign("systemConfig", $systemConfig); //省份 $citymod = new CityModel(); if ($this->getqx($_SESSION['my_info']['role']) == 1) { //地区管理员 $p_id = $_SESSION['my_info']['proid']; //省 $c_id = $_SESSION['my_info']['cityid']; //市 $this->assign("p_id", $p_id); $this->assign("c_id", $c_id); #区 $qulist = $citymod->getcity($c_id); $this->assign("qulist", $qulist); } else { //非地区管理员 $pro_list = $citymod->getcity(1); $this->assign("pro_list", $pro_list); } $this->assign("is_qx", $this->getqx($_SESSION['my_info']['role'])); $this->display(); }