Example #1
0
 private function showUserList()
 {
     /*获得Amazon message本地用户列表*/
     extract($this->generateInfo());
     $currentDep = $defaultDep;
     $dep = isset($_GET['depname']) ? trim($_GET['depname']) : FALSE;
     //部门名称
     if (!empty($dep)) {
         $currentDep = $dep;
     }
     $dep_obj = new GetDeptInfoModel();
     $dep_info = $dep_obj->getDepartName($currentDep, 1);
     //获取部门信息
     if (empty($dep_info)) {
         //不存在的部门
         $promptdata = array('data' => array('使用了不存在的部门信息!'), 'link' => $gobackurl);
         goErrMsgPage($promptdata);
         exit;
     }
     $sys_obj = new PowerSystemModel();
     $msgsysinfo = $sys_obj->getSysInfoByName('Message');
     $localuser_obj = new GetLoacalUserModel();
     $userlist = $localuser_obj->getAllMessageUserList($msgsysinfo['system_id'], $dep_info['dept_id']);
     $Lp_obj = new LocalPowerAmazonModel();
     $cat_obj = new amazonmessagecategoryModel();
     //这里只是根据power_user中的user_name和user_company来在global_user_name中获得用户的真实姓名
     foreach ($userlist as &$usrval) {
         $userinfo = $localuser_obj->getGlobalUserInfoByName(array('global_user_name'), $usrval['user_name'], $usrval['user_company']);
         $usrval['realname'] = empty($userinfo) ? '' : $userinfo['global_user_name'];
         //print_r($userlist);
         /* 文件夹列表   */
         //通过power_user中的系统为message,部门为Amazon的用户的user_id来获得其能浏览的所有分类。
         $fieldid = $Lp_obj->getUserInfo($usrval['user_id']);
         // print_r($fieldid);
         if (empty($fieldid) || empty($fieldid['power'])) {
             $usrval['localpower'] = '';
         } else {
             $powerlist = $cat_obj->getFieldInfoByIds($fieldid['power']);
             $str = '';
             foreach ($powerlist as $pval) {
                 $str .= '【' . $pval['category_name'] . '】';
             }
             $usrval['localpower'] = $str;
         }
     }
     /*----- 获得公司部门列表 -----*/
     $dept_obj = DeptModel::getInstance();
     $department_list = $dept_obj->getDeptLists('*', ' where dept_isdelete=0 and dept_company_id=1');
     // print_r($department_list);exit;
     $this->smarty->assign('sec_menue', $sec_menue);
     $this->smarty->assign('editUrl', $editUrl);
     $this->smarty->assign('currentDep', $currentDep);
     $this->smarty->assign('skipurl', $gobackurl);
     $this->smarty->assign('deptlist', $department_list);
     $this->smarty->assign('userlist', $userlist);
     $this->smarty->assign('toplevel', 5);
     $this->smarty->assign('toptitle', '用户列表');
     $this->smarty->display('localuserlistAmazon.htm');
 }
 /**
  * 部门管理页面
  * 
  */
 public function index()
 {
     //$role_id = I('role_id');
     $dName = I('dName');
     $type = I('type');
     $dept = new DeptModel();
     $data = $dept->get_dept_list($dName);
     if ('searchDeptList' == $type) {
         $data = json_encode($data);
         echo $data;
         exit;
     }
     $deptinfodata = $data['data'];
     $this->assign('deptinfolist', $deptinfodata);
     $this->assign('dName', $dName);
     $this->assign('page', $show);
     $this->display();
 }
Example #3
0
    public function getDeptLists($filed, $where, $order = '', $limit = '')
    {
        self::initDB();
        $sql = 'SELECT ' . $filed . ' FROM ' . self::$table_dept_info . '
				LEFT JOIN ' . self::$table_company_info . ' ON dept_company_id=company_id 
				' . $where . ' ' . $order . ' ' . $limit;
        $query = self::$dbConn->query($sql);
        if (!$query) {
            self::$errCode = '1803';
            self::$errMsg = "[{$sql}] is error";
            return false;
        }
        if ($this->is_count === true) {
            $this->is_count = false;
            return self::$dbConn->num_rows($query);
        }
        return self::$dbConn->fetch_array_all($query);
    }
Example #4
0
 /**
  * 检查用户密码是否正确
  * 检查是否存在此机构号
  *
  * @param string $head
  * @return boolean
  */
 private function check($head, &$result)
 {
     try {
         //检查用户/密码
         if ($head["user"] != "webbusiness" & $head["pass"] != "web4321") {
             $result = $this->createResult($head["type"], -2);
             return false;
         }
         //检查是否有此机构号
         if (!trim($head["organid"])) {
             $result = $this->createResult($head["type"], -3);
             return false;
         }
         if ($head["organid"] == 'super') {
             return true;
         }
         $model = new DeptModel();
         $rs = $model->find("organid = '" . $head["organid"] . "' and type = 'organ'");
         if (!$rs) {
             $result = $this->createResult($head["type"], -3);
             return false;
         } else {
             $this->company = $rs["DeptNo"];
         }
         //$this->company = '000003';
         return true;
     } catch (Exception $e) {
         $this->addLog("NotException error from checkUser:"******"type"]);
         return false;
     }
 }
Example #5
0
 /**
  * 添加员工
  *
  * @param array $data
  * @return int $id
  */
 private function memberAdd($info)
 {
     $data["UserNo"] = $info["EmployeeId"];
     $data["UserName"] = $info["Name"];
     $data["LoginName"] = $info["LoginName"];
     $data["Password"] = "******";
     $data["Verify"] = "%";
     $data["Mobil"] = $info["Mobile"];
     $data["Nodetype"] = "x";
     $data["OrganId"] = $info["OrganId"];
     $data["DeptId"] = $info["DeptId"];
     $data["UserId"] = $info["UserId"];
     $model = new DeptModel();
     if ($info["DeptId"]) {
         $result = $model->find("DeptId = '" . $info["DeptId"] . "' and Type ='Department'");
         if (!$result) {
             $this->addLog("member-no parent dept:" . $info["DeptId"]);
             return false;
         }
     } else {
         $result = $model->find("OrganId = '" . $info["OrganId"] . "' and Type ='Organ'");
         if (!$result) {
             $this->addLog("member-no organ organ:" . $info["OrganId"]);
             return false;
         }
     }
     $data["Upnode"] = $result["DeptNo"];
     $model = new MemberModel();
     //添加
     $result = $model->add($data);
     return $result;
 }
Example #6
0
 /**
  * 计算可用现金
  *
  * @param string $company
  * @param string $group
  * @param string $dept
  * @param string $year
  * @param stirng $month
  */
 private function calCash($company, $group, $dept, $year, $month, &$total, &$used, &$balance)
 {
     $model = new DeptModel();
     $sql = "select liquidity from dept where deptno = '{$group}'";
     $result = $model->query($sql);
     $total = $result[0]["liquidity"] ? $result[0]["liquidity"] : 0;
     $sql = "select sum(geted  - payed) as used from cashbook,dept where cashbook.deptno = dept.deptno and dept.groups = '{$group}'";
     $result = $model->query($sql);
     $used = $result[0]["used"] ? $result[0]["used"] : 0;
     $balance = $total + $used;
 }
Example #7
0
 private function showUserList($platform)
 {
     /*获得message本地用户列表*/
     extract($this->generateInfo($platform));
     $currentDep = $defaultDep;
     $dep = isset($_GET['depname']) ? trim($_GET['depname']) : FALSE;
     //部门名称
     if (!empty($dep)) {
         $currentDep = $dep;
     } else {
         $currentDep = 'eBay客服一部';
     }
     $dep_obj = new GetDeptInfoModel();
     $dep_info = $dep_obj->getDepartmentInfoByName($currentDep, 1);
     //获取部门信息
     if (empty($dep_info)) {
         //不存在的部门
         $promptdata = array('data' => array('使用了不存在的部门信息!'), 'link' => $gobackurl);
         goErrMsgPage($promptdata);
         exit;
     }
     $sys_obj = new PowerSystemModel();
     $msginfo = $sys_obj->getSysInfoByName('Message');
     //获取message系统信息
     $localuser_obj = new GetLoacalUserModel();
     $dept = "(16,95)";
     //eBay客服一部、二部部门编号
     $deptNew = "(" . $dep_info['dept_id'] . ")";
     $userlist = $localuser_obj->getAllMessageUserInfo($msginfo['system_id'], $deptNew);
     //$dept);
     $Lp_obj = new LocalPowerModel();
     $cat_obj = new messagecategoryModel();
     foreach ($userlist as $key => &$usrval) {
         $userinfo = $localuser_obj->getGlobalUserInfoByName(array('global_user_name', 'global_user_status'), $usrval['user_name'], $usrval['user_company']);
         if ($userinfo['global_user_status'] == 0) {
             //去除离职人员
             unset($userlist[$key]);
             continue;
         }
         $usrval['realname'] = empty($userinfo) ? '' : $userinfo['global_user_name'];
         $fieldid = $Lp_obj->{$getpowerfunc}($usrval['user_id']);
         if (empty($fieldid['field'])) {
             $usrval['localpower'] = '';
         } else {
             $powerlist = $cat_obj->getFieldInfoByIds($fieldid['field']);
             $str = '';
             foreach ($powerlist as $pval) {
                 $str .= '【' . $pval['category_name'] . '】';
             }
             $usrval['localpower'] = $str;
         }
     }
     $dept_obj = DeptModel::getInstance();
     $department_list = $dept_obj->getDeptLists('*', ' where dept_isdelete=0 and dept_company_id=1');
     $this->smarty->assign('sec_menue', $sec_menue);
     $this->smarty->assign('editUrl', $editUrl);
     $this->smarty->assign('currentDep', $currentDep);
     $this->smarty->assign('skipurl', $gobackurl);
     $this->smarty->assign('deptlist', $department_list);
     $this->smarty->assign('userlist', $userlist);
     $this->smarty->assign('toplevel', 5);
     $this->smarty->assign('toptitle', '用户列表');
     $this->smarty->display('localuserlist.htm');
 }
Example #8
0
 /**
  * DeptAct::act_delete()
  * 删除部门act
  * @return string 
  */
 public function act_delete()
 {
     $deptId = intval($_POST['deptId']);
     if (!$deptId) {
         return false;
         exit;
     }
     $result = DeptModel::deptDelete($deptId);
     return $result;
 }