$personnel_category = new PersonnelCategory(null, $personnel_category_name, $permission_name); $personnel_category_service = new PersonnelCategoryService(); $personnel_category_service->addPersonnelCategory($personnel_category); $_SESSION['operation'] = true; $_SESSION['operation_msg'] = "添加人员类别:" . $personnel_category_name . "成功"; $log_service->addLog("insert", "用户", null); header("Location: ./index.php?mod=personnel_category&action=ls"); break; case 'edit_get': if (isset($_GET['eid'])) { $id = $_GET['eid']; if (is_numeric($id)) { require_once './class/personnel_category_service.class.php'; require_once 'class/personnel_category.class.php'; $personnel_category_service = new PersonnelCategoryService(); $personnel_category = $personnel_category_service->getPersonnelCategoryById($id); $personnel_category = serialize($personnel_category); $_SESSION['personnel_category'] = $personnel_category; require_once './personnel_category_view_edit_form.php'; } else { header("Location: ./index.php?mod=personnel_category&action=ls"); } } else { header("Location: ./index.php?mod=personnel_category&action=ls"); } break; case 'edit_post': if (isset($_SESSION["id"])) { require_once './class/personnel_category_service.class.php'; require_once 'class/personnel_category.class.php'; $id = $_SESSION["id"];
if (strstr($state, CodeNames::$user_state_disable)) { $url = "./login.php"; $_SESSION['disable'] = true; header("Location: {$url}"); } else { if (!$rs) { $url = "./login.php"; $_SESSION['error'] = true; } else { $url = "./index.php"; $_SESSION['username'] = $username; $_SESSION['logined_user'] = serialize($user); require_once 'class/personnel_category_service.class.php'; require_once 'class/personnel_category.class.php'; $personnel_category_service = new PersonnelCategoryService(); $personnel_category = $personnel_category_service->getPersonnelCategoryById($user->category_name_id); $user_permission_name = $personnel_category->permission_name; $_SESSION['user_permission_name'] = $user_permission_name; if (isset($_POST['auto_login'])) { $auto_login = $_POST['auto_login']; setcookie("username", $username, time() + 36000); setcookie("pwd", $pwd, time() + 36000); } } } header("Location: {$url}"); } break; case 'user_register': require_once 'class/user.class.php'; require_once 'class/user_service.class.php';
public function listAllByKeywords($pageCurrent, $PageSize, $keywords, $sql = "select * from t_user,t_personnel_category where t_personnel_category.id=t_user.category_name_id and concat ( t_user.username ,t_personnel_category.personnel_category_name , t_user.name , t_user.telephone , t_user.email , t_user.state ) like ") { $keywords = strtr($keywords, CodeNames::$user_search_replace); $sql = sprintf($sql . " '%s' ", "%" . $keywords . "%"); $sql = $sql . " order by t_user.id desc "; $array_user = $this->g_db->getAll($sql, $pageCurrent, $PageSize); foreach ($array_user as $user) { $category_name_id = $user->category_name_id; $personnel_category_service = new PersonnelCategoryService(); $personnel_category = $personnel_category_service->getPersonnelCategoryById($category_name_id); $category_name = $personnel_category->personnel_category_name; $user->category_name = $category_name; } return $array_user; }