public function acinfoAction() { $SysClass = new ctrlSystem(); $SysClass->initialization(null, true); try { //-----BI開始----- $action = array(); $action["status"] = false; // $start_time = microtime(true); if (!empty($_SESSION["uuid"])) { $action["uuid"] = $_SESSION["uuid"]; $action["userName"] = $_SESSION["userName"]; $action["isAdmin"] = $_SESSION["isAdmin"]; $action["sysCode"] = $_SESSION["sysCode"]; $action["userID"] = $_SESSION["userID"]; $action["sysList"] = $_SESSION["sysList"]; $action["orgid"] = $_SESSION["orgid"]; $action["posid"] = $_SESSION["posid"]; $action["isSuperiors"] = $_SESSION["isSuperiors"]; $action["sc"] = $_SESSION["sc"]; if ($_SESSION["isAdmin"]) { // 是管理者就找看看是不是已經有新增過組織 $strSQL = "select count(*) as total from ass_org "; $strSQL .= "where sys_code_id = " . $_SESSION["sysCode"]; $data = $SysClass->QueryData($strSQL); // 代表有新增過 if ($data[0]["total"] > 1) { $_SESSION["haveOrgs"] = true; } else { $_SESSION["haveOrgs"] = false; } // 是否有新增過部門組織 $strSQL = "select count(*) as total from ass_type_office "; $strSQL .= "where sys_code_id = " . $_SESSION["sysCode"]; $data = $SysClass->QueryData($strSQL); // 代表有新增過 if ($data[0]["total"] > 0) { $_SESSION["haveOrgUnit"] = true; } else { $_SESSION["haveOrgUnit"] = false; } $action["haveOrgs"] = $_SESSION["haveOrgs"]; $action["haveOrgUnit"] = $_SESSION["haveOrgUnit"]; } // $action["menuPosition"] = $_SESSION["menuPosition"]; $action["status"] = true; } else { $action["msg"] = 'Please Login Again!'; } // $end_time = microtime(true); // $action["times"] = $end_time - $start_time; $pageContent = json_encode($action); //-----BI結束----- } catch (Exception $error) { //依據Controller, Action補上對應位置, $error->getMessage()為固定部份 $VTs->WriteLog("PageactionController", "acinfoAction", $error->getMessage()); } $this->viewContnet['pageContent'] = $pageContent; return new ViewModel($this->viewContnet); }
private function userName($userID) { $SysClass = new ctrlSystem(); // 預設不連資料庫 // $SysClass->initialization(); // 連線指定資料庫 // $SysClass->initialization("設定檔[名稱]",true); -> 即可連資料庫 // 連線預設資料庫 $SysClass->initialization(null, true); try { //-----BI開始----- $userName = ""; $strSQL = "select t2.name from ass_user t1 "; $strSQL .= "left join ass_common t2 on t1.cmid = t2.uid "; $strSQL .= "where t1.uid = '" . $userID . "' "; $data = $SysClass->QueryData($strSQL); if (!empty($data)) { $userName = $data[0]["name"]; } return $userName; //----BI結束---- } catch (Exception $error) { //依據Controller, Action補上對應位置, $error->getMessage()為固定部份 // $SysClass->WriteLog("MenterController", "setloginAction", $error->getMessage()); } }