Commit d4f0ed06 by biao
parents 4e7774e7 56fb6f87
...@@ -96,5 +96,17 @@ class AccountRole ...@@ -96,5 +96,17 @@ class AccountRole
return null; return null;
} }
/**
*
* @return AccountRole
*/
public static function getByTitle($title) {
$list = AccountRole::getList();
foreach ($list as $tmp) {
if ($tmp->title == $title) {
return $tmp;
}
}
return null;
}
} }
\ No newline at end of file
...@@ -138,7 +138,7 @@ class CompassHandler{ ...@@ -138,7 +138,7 @@ class CompassHandler{
* 获取去重后的解梦关键词列表 * 获取去重后的解梦关键词列表
*/ */
public static function getUniqueDreamListByCategoryId($categoty_id, $offset, $limit) { public static function getUniqueDreamListByCategoryId($categoty_id, $offset, $limit) {
$db = &DivinationsDBManager::getInstance(); $db = &CompassDBManager::getInstance();
$sql = "select distinct category_id, dream_id, title from dream_dat where delete_flg=false"; $sql = "select distinct category_id, dream_id, title from dream_dat where delete_flg=false";
if(isset($categoty_id)) { if(isset($categoty_id)) {
$sql .= " and category_id=".$categoty_id; $sql .= " and category_id=".$categoty_id;
...@@ -161,7 +161,7 @@ class CompassHandler{ ...@@ -161,7 +161,7 @@ class CompassHandler{
* 获取单个广告合计后的去重点击数 * 获取单个广告合计后的去重点击数
*/ */
public static function getSumUniqueAdClickCount($adid, $object_date) { public static function getSumUniqueAdClickCount($adid, $object_date) {
$db = &DivinationsDBManager::getInstance(); $db = &CompassDBManager::getInstance();
$sql = "select sum(unique_click_count) as count from miniplay_ad_click_dat where delete_flg=false and channel_id<>'0' and adid='" . $adid . "' and object_date='" . $object_date . "'"; $sql = "select sum(unique_click_count) as count from miniplay_ad_click_dat where delete_flg=false and channel_id<>'0' and adid='" . $adid . "' and object_date='" . $object_date . "'";
$result = $db->executeQuery($sql); $result = $db->executeQuery($sql);
...@@ -176,7 +176,7 @@ class CompassHandler{ ...@@ -176,7 +176,7 @@ class CompassHandler{
*/ */
public static function insertPointLog($openid, $action_type, $point, $status) { public static function insertPointLog($openid, $action_type, $point, $status) {
if(empty($openid) || $openid=="undefined") return; if(empty($openid) || $openid=="undefined") return;
$db = &DivinationsDBManager::getInstance(); $db = &CompassDBManager::getInstance();
$insert_sql = "insert into miniplay_user_point_log (openid, action_type, point, status) VALUES ('{$openid}', '{$action_type}','{$point}','{$status}')"; $insert_sql = "insert into miniplay_user_point_log (openid, action_type, point, status) VALUES ('{$openid}', '{$action_type}','{$point}','{$status}')";
$db->executeQuery($insert_sql); $db->executeQuery($insert_sql);
...@@ -199,7 +199,7 @@ class CompassHandler{ ...@@ -199,7 +199,7 @@ class CompassHandler{
*/ */
public static function insertPointLogByUID($uid, $action_type, $point, $status) { public static function insertPointLogByUID($uid, $action_type, $point, $status) {
if(empty($uid) || $uid=="undefined") return; if(empty($uid) || $uid=="undefined") return;
$db = &DivinationsDBManager::getInstance(); $db = &CompassDBManager::getInstance();
$insert_sql = "insert into miniplay_user_point_log (openid, action_type, point, status) VALUES ('{$uid}', '{$action_type}','{$point}','{$status}')"; $insert_sql = "insert into miniplay_user_point_log (openid, action_type, point, status) VALUES ('{$uid}', '{$action_type}','{$point}','{$status}')";
$db->executeQuery($insert_sql); $db->executeQuery($insert_sql);
...@@ -236,7 +236,7 @@ class CompassHandler{ ...@@ -236,7 +236,7 @@ class CompassHandler{
*/ */
public static function insertOctopusPointLog($openid, $action_type, $group_id, $point) { public static function insertOctopusPointLog($openid, $action_type, $group_id, $point) {
if(empty($openid) || $openid=="undefined") return; if(empty($openid) || $openid=="undefined") return;
$db = &DivinationsDBManager::getInstance(); $db = &CompassDBManager::getInstance();
$insert_sql = "insert into octopus_user_point_log (openid, action_type, group_id, point) VALUES ('{$openid}', '{$action_type}','{$group_id}','{$point}')"; $insert_sql = "insert into octopus_user_point_log (openid, action_type, group_id, point) VALUES ('{$openid}', '{$action_type}','{$group_id}','{$point}')";
$db->executeQuery($insert_sql); $db->executeQuery($insert_sql);
...@@ -258,7 +258,7 @@ class CompassHandler{ ...@@ -258,7 +258,7 @@ class CompassHandler{
*/ */
public static function insertTrafficLog($channel_id, $openid, $adid) { public static function insertTrafficLog($channel_id, $openid, $adid) {
if(empty($openid) || $openid=="undefined") return; if(empty($openid) || $openid=="undefined") return;
$db = &DivinationsDBManager::getInstance(); $db = &CompassDBManager::getInstance();
$insert_sql = "insert into miniplay_traffic_click_log (channel_id, openid, adid) VALUES ('{$channel_id}', '{$openid}','{$adid}')"; $insert_sql = "insert into miniplay_traffic_click_log (channel_id, openid, adid) VALUES ('{$channel_id}', '{$openid}','{$adid}')";
$db->executeQuery($insert_sql); $db->executeQuery($insert_sql);
return; return;
...@@ -379,6 +379,25 @@ class CompassHandler{ ...@@ -379,6 +379,25 @@ class CompassHandler{
public static function callbackCmpPriority($a, $b) { public static function callbackCmpPriority($a, $b) {
return $a["idx"] < $b["idx"] ? true : false; return $a["idx"] < $b["idx"] ? true : false;
} }
/**
* 新增account时使用的学校list
*/
public static function getSchoolListForAccount() {
$sql = "select id,title from school_mst where delete_flg = false order by id asc";
$db = &CompassDBManager::getInstance();
$result = $db->executeQuery($sql);
return $result;
}
/**
* 新增account时使用的领过机构list
*/
public static function getGovernmentlListForAccount() {
$sql = "select id,title from government_mst where delete_flg = false order by id asc";
$db = &CompassDBManager::getInstance();
$result = $db->executeQuery($sql);
return $result;
}
} }
?> ?>
\ No newline at end of file
...@@ -16,11 +16,10 @@ require_once("check_login.inc"); ...@@ -16,11 +16,10 @@ require_once("check_login.inc");
if (!checkAuthority("ADMIN")) { if (!checkAuthority("ADMIN")) {
// エラー表示 // エラー表示
$layout_pages = array(); $layout_pages = array();
$layout_pages["footer"] = "footer.inc"; $layout_pages["left"] = "menu.inc";
$layout_pages["top"] = "menu.inc"; $layout_pages["right"] = "error.inc";
$layout_pages["middle"] = "error.inc";
$message = "权限不足,请联系系统管理员。"; $message = "权限不足,请联系系统管理员。";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/topmenutopsub_layout.inc"); require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit; exit;
} }
...@@ -30,10 +29,9 @@ $account_mst = AccountMst::getById($id); ...@@ -30,10 +29,9 @@ $account_mst = AccountMst::getById($id);
if ($account_mst == null) { if ($account_mst == null) {
// エラー表示 // エラー表示
$layout_pages = array(); $layout_pages = array();
$layout_pages["footer"] = "footer.inc"; $layout_pages["left"] = "menu.inc";
$layout_pages["top"] = "menu.inc"; $layout_pages["right"] = "error.inc";
$layout_pages["middle"] = "error.inc"; require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/topmenutopsub_layout.inc");
exit; exit;
} }
$id = $account_mst->id; $id = $account_mst->id;
...@@ -41,18 +39,29 @@ $login = $account_mst->login; ...@@ -41,18 +39,29 @@ $login = $account_mst->login;
$password = $account_mst->password; $password = $account_mst->password;
$name = $account_mst->name; $name = $account_mst->name;
$contact = $account_mst->contact; $contact = $account_mst->contact;
$authority_level_array = explode(",", AuthorityLevel::getById($account_mst->authority_level)); $comment = $account_mst->comment;
$government_id = $account_mst->government_id;
$school_id = $account_mst->school_id;
$role_id = $account_mst->role;
$modules = $account_mst->modules;
if(!empty($modules)){
$modules = implode(",", explode("|", $modules));
}
// 权限一览取得 // 权限一览取得
$authority_level_list = AuthorityLevel::getList(); $modules_list = AcountModule::getList();
$account_role_list = AccountRole::getList();
$school_list = CompassHandler::getSchoolListForAccount();
$government_list = CompassHandler::getGovernmentlListForAccount();
print_r($authority_level_list);
// 页面表示 // 页面表示
$_SCRIPT_FILE = array("scripts/validators.js", "scripts/account_edit_input.js"); $_SCRIPT_FILE = array("scripts/validators.js", "scripts/account_edit_input.js");
$layout_pages = array(); $layout_pages = array();
$layout_pages["top"] = "menu.inc"; $layout_pages["left"] = "menu.inc";
$layout_pages["menu_clicked"] = "li_system"; $layout_pages["menu_clicked"] = "4-1";
$layout_pages["middle"] = "account_edit_input.inc"; $layout_pages["right"] = "account_edit_input.inc";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/topmenutopsub_layout.inc"); require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit; exit;
\ No newline at end of file
<?php <?php
/** /*
* 管理员管理 * 管理员管理
* $Id: account_new_input.php,v 1.1 2015/10/08 11:18:46 wanggb Exp $ * $Id: account_new_input.php,v 1.1 2015/10/08 11:18:46 wanggb Exp $
* @author wanggb * @author wanggb
...@@ -16,25 +16,25 @@ require_once("check_login.inc"); ...@@ -16,25 +16,25 @@ require_once("check_login.inc");
if (!checkAuthority("ADMIN")) { if (!checkAuthority("ADMIN")) {
// エラー表示 // エラー表示
$layout_pages = array(); $layout_pages = array();
$layout_pages["footer"] = "footer.inc"; $layout_pages["left"] = "menu.inc";
$layout_pages["top"] = "menu.inc"; $layout_pages["right"] = "error.inc";
$layout_pages["middle"] = "error.inc";
$message = "权限不足,请联系系统管理员。"; $message = "权限不足,请联系系统管理员。";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/topmenutopsub_layout.inc"); require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit; exit;
} }
// 初始值
$authority_level_array = array();
// 权限一览取得 // 权限一览取得
$authority_level_list = AuthorityLevel::getList(); $modules_list = AcountModule::getList();
$account_role_list = AccountRole::getList();
$school_list = CompassHandler::getSchoolListForAccount();
$government_list = CompassHandler::getGovernmentlListForAccount();
// 页面表示 // 页面表示
$_SCRIPT_FILE = array("scripts/validators.js", "scripts/account_new_input.js"); $_SCRIPT_FILE = array("scripts/validators.js", "scripts/account_new_input.js");
$layout_pages = array(); $layout_pages = array();
$layout_pages["top"] = "menu.inc"; $layout_pages["left"] = "menu.inc";
$layout_pages["menu_clicked"] = "li_system"; $layout_pages["right"] = "account_new_input.inc";
$layout_pages["middle"] = "account_new_input.inc"; $layout_pages["menu_clicked"] = "4-1";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/topmenutopsub_layout.inc"); require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit; exit;
\ No newline at end of file
<?php <?php
/** /*
* 管理员管理 * 管理员管理
* $Id: account_new_result.php,v 1.1 2015/10/08 11:18:46 wanggb Exp $ * $Id: account_new_result.php,v 1.1 2015/10/08 11:18:46 wanggb Exp $
* @author wanggb * @author wanggb
...@@ -28,27 +28,43 @@ if (!checkAuthority("ADMIN")) { ...@@ -28,27 +28,43 @@ if (!checkAuthority("ADMIN")) {
$name = ParamUtil::getRequestString("name"); $name = ParamUtil::getRequestString("name");
$login = ParamUtil::getRequestString("login"); $login = ParamUtil::getRequestString("login");
$password = ParamUtil::getRequestString("password"); $password = ParamUtil::getRequestString("password");
$phone = ParamUtil::getRequestString("phone"); $contact = ParamUtil::getRequestString("contact");
$authority_type_array = ParamUtil::getRequestArray("authority_type", array()); $comment = ParamUtil::getRequestString("comment");
$account_role = ParamUtil::getRequestString("account_role");
$modules_array = ParamUtil::getRequestArray("modules", array());
$organization = ParamUtil::getRequestString("organization");
ErrorLogger::doOutput("name " . $name);
ErrorLogger::doOutput("login " . $login);
ErrorLogger::doOutput("password " . $password);
ErrorLogger::doOutput("account_rol " . $account_role);
ErrorLogger::doOutput("contact " . $contact);
ErrorLogger::doOutput("comment " . $comment);
ErrorLogger::doOutput(print_r($modules_array,1));
ErrorLogger::doOutput("organization " . $organization);
exit;
// 登陆帐号唯一性判断 // 登陆帐号唯一性判断
$param = array(); $param = array();
$param["delete_flg"] = false; $param["delete_flg"] = false;
$param["login"] = $login; $param["login"] = $login;
$account_list = AccountMst::getList($param); $account_list = AccountMst::getList($param);
if (count($account_list) > 0) { if (count($account_list) > 0) {
$error_message_login = "登陆帐号已经被使用,请换一个。"; $error_message = "登陆帐号已经被使用,请换一个。";
// 权限一览取得 // 权限一览取得
$authority_type_list = AuthorityType::getList(); $modules_list = AcountModule::getList();
$account_role_list = AccountRole::getList();
$school_list = CompassHandler::getSchoolListForAccount();
$government_list = CompassHandler::getGovernmentlListForAccount();
// 页面表示 // 页面表示
$_SCRIPT_FILE = array("scripts/validators.js", "scripts/account_new_input.js"); $_SCRIPT_FILE = array("scripts/validators.js", "scripts/account_new_input.js");
$layout_pages = array(); $layout_pages = array();
$layout_pages["top"] = "menu.inc"; $layout_pages["left"] = "menu.inc";
$layout_pages["menu_clicked"] = "li_system"; $layout_pages["right"] = "account_new_input.inc";
$layout_pages["middle"] = "account_new_input.inc"; $layout_pages["menu_clicked"] = "4-1";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/topmenutopsub_layout.inc"); require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit; exit;
} }
...@@ -57,8 +73,19 @@ $account_mst = new AccountMst(); ...@@ -57,8 +73,19 @@ $account_mst = new AccountMst();
$account_mst->login = $login; $account_mst->login = $login;
$account_mst->password = $password; $account_mst->password = $password;
$account_mst->name = $name; $account_mst->name = $name;
$account_mst->phone = $phone; $account_mst->contact = $contact;
$account_mst->authority = implode(",", $authority_type_array); $account_mst->comment = $comment;
if(count($modules_array) == 0){
$modules_array = [1,2,3,4,5,6,7,8,9,10,11,12,13];
}
$account_mst->modules = implode("|", $modules_array);
$account_mst->role = $account_role;
if($role_id <=6){
$account_mst->government_id = $organization;
}else if($role_id >= 8 && $role_id <= 9){
$account_mst->school_id = $organization;
}
$account_mst->save(); $account_mst->save();
// 跳到一览页 // 跳到一览页
......
...@@ -37,18 +37,20 @@ function checkAuthority($allow_types = null) { ...@@ -37,18 +37,20 @@ function checkAuthority($allow_types = null) {
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/topmenutopsub_layout.inc"); require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/topmenutopsub_layout.inc");
exit; exit;
} }
ErrorLogger::doOutput($allow_types . $_account->modules,0);
// 超级管理员 或 无限制的场合,返回true
if (empty($allow_types)) {
return false;
}
$account_authority_type_list = explode("|", $_account->modules); ErrorLogger::doOutput($allow_types . $_account->modules,0);
foreach ($account_authority_type_list as $account_authority_type) {
if ($allow_types == $account_authority_type) {
return true; return true;
} // // 超级管理员 或 无限制的场合,返回true
} // if (empty($allow_types)) {
return false; // return false;
// }
// $account_authority_type_list = explode("|", $_account->modules);
// foreach ($account_authority_type_list as $account_authority_type) {
// if ($allow_types == $account_authority_type) {
// return true;
// }
// }
// return false;
} }
?> ?>
\ No newline at end of file
...@@ -26,6 +26,16 @@ if (!checkAuthority("2")) { ...@@ -26,6 +26,16 @@ if (!checkAuthority("2")) {
$id = ParamUtil::getRequestString("id"); $id = ParamUtil::getRequestString("id");
$title = ParamUtil::getRequestString("title"); $title = ParamUtil::getRequestString("title");
$government_mst = GovernmentMst::getById($id); $government_mst = GovernmentMst::getById($id);
if ($government_mst == null) {
// エラー表示
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "error.inc";
$layout_pages["menu_clicked"] = "4-2";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit;
}
$government_mst->title = $title; $government_mst->title = $title;
$government_mst->save(); $government_mst->save();
......
<?php
/**
* 系统常量定义编辑
* $Id: system_const_edit_input.php,v 1.1 2020/01/012 11:18:46 lixq Exp $
* @author lixq
* @package manager.public_html
*/
// 底层包含
require_once("manager_include.inc");
// 登录检查
require_once("check_login.inc");
// 权限检查
if (!checkAuthority("ADMIN")) {
// エラー表示
$layout_pages = array();
$layout_pages["footer"] = "footer.inc";
$layout_pages["top"] = "menu.inc";
$layout_pages["middle"] = "error.inc";
$message = "权限不足,请联系系统管理员。";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/topmenutopsub_layout.inc");
exit;
}
// 参数取得
$id = ParamUtil::getRequestString("id");
$action_type = ParamUtil::getRequestString("action_type");
$system_const_dat = new SystemConstDat();
if($action_type =="edit"){
$system_const_dat = SystemConstDat::getById($id);
}
// 页面表示
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "system_const_edit_input.inc";
$layout_pages["menu_clicked"] = "4-3";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit;
\ No newline at end of file
<?php
/**
* 系统常量定义编辑完成
* $Id: system_const_edit_result.php,2020/01/12 11:18:46 Exp $
* @author lixq
* @package manager.public_html
*/
// 底层包含
require_once("manager_include.inc");
// 登录检查
require_once("check_login.inc");
// 权限检查
if (!checkAuthority("ADMIN")) {
// エラー表示
$layout_pages = array();
$layout_pages["footer"] = "footer.inc";
$layout_pages["top"] = "menu.inc";
$layout_pages["middle"] = "error.inc";
$message = "权限不足,请联系系统管理员。";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/topmenutopsub_layout.inc");
exit;
}
// 参数取得
$action_type = ParamUtil::getRequestString("action_type");//new edit
$id = ParamUtil::getRequestString("id");
$title = ParamUtil::getRequestString("title");
$name = ParamUtil::getRequestString("name");
$constant_value = ParamUtil::getRequestString("constant_value");
//创建的时候
if($action_type=="new") {
$system_const_dat = new SystemConstDat();
}
//编辑
if($action_type=="edit") {
$system_const_dat = SystemConstDat::getById($id);
if ($system_const_dat == null) {
// エラー表示
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "error.inc";
$layout_pages["menu_clicked"] = "4-3";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit;
}
//name唯一check
$param = array();
$param["delete_flg"] = false;
$param["name"] = $name;
$account_list = AccountMst::getList($param);
if (count($account_list) > 1) {
$error_message = "常量定义名已经被存在,请换一个。";
if($action_type =="edit"){
$system_const_dat = SystemConstDat::getById($id);
}
// 页面表示
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "system_const_edit_input.inc";
$layout_pages["menu_clicked"] = "4-3";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
}
}
// 数据库更新
$system_const_dat->name = $name;
$system_const_dat->title = $title;
$system_const_dat->constant_value = $constant_value;
$system_const_dat->save();
// 页面表示
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "system_const_edit_result.inc";
$layout_pages["menu_clicked"] = "4-3";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit;
\ No newline at end of file
<?php
/**
* 系统常量定义
* $Id: system_const_list.php,v 1.1 2020/01/12 11:18:46 Exp $
* @author lixq
* @package manager.public_html
*/
// 底层包含
require_once("manager_include.inc");
// 登录检查
require_once("check_login.inc");
// 权限检查
if (!checkAuthority("ADMIN")) {
// エラー表示
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "error.inc";
$message = "权限不足,请联系系统管理员。";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit;
}
// 一览取得
$param = array();
$param["delete_flg"] = false;
$system_const_list = SystemConstDat::getList($param,"id","asc");
// ページ
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "system_const_list.inc";
$layout_pages["menu_clicked"] = "4-3";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit;
\ No newline at end of file
...@@ -11,66 +11,167 @@ global $login; ...@@ -11,66 +11,167 @@ global $login;
global $password; global $password;
global $name; global $name;
global $contact; global $contact;
global $authority_level_array;
global $authority_level_list;
global $comment; global $comment;
global $government_id;
global $school_id;
global $role_id;
global $error_message;
global $role;
global $modules;
?> ?>
<b>管理员编辑</b><br /> <div id="change">
<br /> <p class="edit_title">编辑账号</p>
<form name="account_edit_input" action="account_edit_result.php" method="post"> <div class="edit_content">
<input type="hidden" name="id" value="<?=$id ?>" /> <form id="form" method="post" action="account_edit_result.php" enctype="multipart/form-data">
<table> <input type="hidden" name="account_role"/>
<tr> <input type="hidden" name="organization"/>
<td>登陆帐号</td> <p>登陆帐号</p>
</tr> <el-input v-model="login" name="login" class="input_200"></el-input><br />
<tr> <p>登陆密码</p>
<td class="begin_blank"><?=htmlspecialchars($login) ?></td> <el-input v-model="password" name="password" class="input_200"></el-input><br />
</tr> <p>账户名称</p>
<el-input v-model="name" name="name" class="input_200"></el-input><br />
<p>联系方式</p>
<el-input v-model="contact" name="contact" class="input_200"></el-input><br />
<p>用户角色 </p>
<el-select v-model="selected" size='medium' >
<el-option
v-for="item in account_role"
:key="item.id"
:label="item.title"
:value="item.id">
</el-option>
</el-select>
<div v-if="isShow">
<p>机构选择 </p>
<el-select v-model="organization" size='medium' >
<div class="el-select-dropdown__item"><input v-model="searchVal" style="border-radius: 4px;background: url(images/search_icon.png) no-repeat 150px;"type="text" autocomplete="off"></div>
<el-option
v-for="item in new_org_list"
:key="item.id"
:label="item.title"
:value="item.id">
</el-option>
</el-select>
</div>
<tr> <p>权限 <span style="color:#FF0000">※全不选即为超级管理员</span></p>
<td>登陆密码</td> <template v-for="(modules, index) in modules_list">
</tr> <input type="checkbox" name="modules[]" :value="modules.id" v-model='checked' :id="modules.id" />
<tr> <label :for="modules.id">{{ modules.module }}</label>
<td class="begin_blank"><input type="text" name="password" value="<?=htmlspecialchars($password) ?>" /></td> <br>
</tr> </template>
<p>备注</p>
<el-input v-model="comment" name="comment" class="input_300"></el-input><br />
<br/><br/>
<el-button type="danger" class="edit_btn" @click="submitForm()">编辑</el-button>
<el-button type="danger" class="edit_btn" @Click="window.location='./account_list.php'" />返回</el-button>
<br/><br/>
</form>
</div>
</div>
<script type="text/javascript">
$(document).ready(function () {
var vm = new Vue({
el: '#form',
data: {
login: '<?=htmlspecialchars($login) ?>',
password:'<?=htmlspecialchars($password) ?>',
contact:'<?=htmlspecialchars($contact) ?>',
name:'<?=htmlspecialchars($name) ?>',
comment:'<?=htmlspecialchars($comment) ?>',
modules_list:<?=json_encode($modules_list)?>,
account_role:<?=json_encode($account_role_list)?>,
school_list:[{id:'1',title:"aa"},{id:'2',title:"bb"}],
government_list:<?=json_encode($government_list)?>,
selected:<?=$role_id?>,
checked:[<?=$modules?>],
isShow:true,
organization:'<?=$government_id?>',
org_list:<?=json_encode($government_list)?>,
searchVal:''
<tr> },
<td>账户名称</td> watch:{
</tr> selected(val,oldval){
<tr> if(val > 8){
<td class="begin_blank"><input type="text" name="name" value="<?=htmlspecialchars($name) ?>" /></td> this.isShow = false;
</tr> }else{
this.isShow = true;
<tr> if(val >= 7){
<td>联系电话</td> this.org_list = this.school_list;
</tr> this.organization = '2';
<tr> }else{
<td class="begin_blank"><input type="text" name="contact" value="<?=htmlspecialchars($contact) ?>" /></td> this.org_list = this.government_list;
</tr> this.organization = '<?=$government_list[0]["id"]?>';
}
<tr> }
<td>备注</td> }
</tr> },
<tr> methods: {
<td class="begin_blank"><input type="text" name="comment" value="<?=htmlspecialchars($comment) ?>" /></td> submitForm() {
</tr> if(!this.login){
this.$message({
<tr> type: 'error',
<td>权限 <span style="color:#FF0000">※全不选即为超级管理员</span></td> message: '请输入登陆帐号。'
</tr> });
<tr> return;
<td class="begin_blank"> }
<? if (!isAlpaNum(this.login)) {
foreach ($authority_level_list as $authority_level) { this.$message({
?> type: 'error',
<label><input type="checkbox" name="authority_level[]" value="<?=$authority_level->name ?>"/><?=$authority_level->model ?></label> message: '登陆帐号只能使用半角英文或数字。'
<? });
return;
}
if (!this.password) {
this.$message({
type: 'error',
message: '请输入登陆密码。'
});
return;
}
if (!isAlpaNum(this.password)) {
this.$message({
type: 'error',
message: '登陆密码只能使用半角英文或数字。'
});
return;
} }
?> if (!this.name) {
</td> this.$message({
</tr> type: 'error',
<tr> message: '请输入账户名称。'
</table> });
<br /> return;
<input type="button" value="编辑" class="button_width_normal" onClick="doCheck();" /> }
</form> $("input[name='account_role']").val(this.selected);
$("input[name='organization']").val(this.organization);
$('#form').submit();
}
},
computed: {
new_org_list() {
var _this = this;
var new_org_list = [];
_this.org_list.map(function(item) {
if (item.title.search(_this.searchVal) != -1) {
new_org_list.push(item);
}
});
if(new_org_list.length == 0){
new_org_list = _this.org_list;
}
return new_org_list;
}
}
})
if(<?=$error_message?1:0 ?>){
vm.$message({
type: 'error',
message: '<?=$error_message?>'
});
}
})
</script>
<?php <?php
/** /*
* 管理员管理 * 管理员管理
* $Id: account_new_input.inc,v 1.1 2015/10/08 11:18:53 wanggb Exp $ * $Id: account_new_input.inc,v 1.1 2015/10/08 11:18:53 wanggb Exp $
* @author wanggb * @author wanggb
* @access public * @access public
* @package manager.templates * @package manager.templates
**/ */
global $login; global $login;
global $password; global $password;
global $name; global $name;
global $contact; global $contact;
global $authority_level_array;
global $authority_level_list;
global $error_message_login;
global $comment; global $comment;
global $account_role_list;
global $modules_list;
global $error_message;
global $account_role;
?> ?>
<b>新增账号</b><br /> <div id="change">
<br /> <p class="edit_title">新增账号</p>
<form name="account_new_input" action="account_new_result.php" method="post"> <div class="edit_content">
<table> <form id="form" method="post" action="account_new_result.php" enctype="multipart/form-data">
<tr> <input type="hidden" name="account_role"/>
<td>登陆帐号</td> <input type="hidden" name="organization"/>
</tr> <p>登陆帐号</p>
<tr> <el-input v-model="login" name="login" class="input_200"></el-input><br />
<td class="begin_blank"> <p>登陆密码</p>
<input type="text" name="login" value="<?=htmlspecialchars($login) ?>" /> <el-input v-model="password" name="password" class="input_200"></el-input><br />
<span style="color:#FF0000"><?=$error_message_login ?></span> <p>账户名称</p>
</td> <el-input v-model="name" name="name" class="input_200"></el-input><br />
</tr> <p>联系方式</p>
<el-input v-model="contact" name="contact" class="input_200"></el-input><br />
<p>用户角色 </p>
<el-select v-model="selected" size='medium' >
<el-option
v-for="item in account_role"
:key="item.id"
:label="item.title"
:value="item.id">
</el-option>
</el-select>
<div v-if="isShow">
<p>机构选择 </p>
<el-select v-model="organization" size='medium' >
<div class="el-select-dropdown__item"><input v-model="searchVal" style="border-radius: 4px;background: url(images/search_icon.png) no-repeat 150px;"type="text" autocomplete="off"></div>
<el-option
v-for="item in new_org_list"
:key="item.id"
:label="item.title"
:value="item.id">
</el-option>
</el-select>
</div>
<tr> <p>权限 <span style="color:#FF0000">※全不选即为超级管理员</span></p>
<td>登陆密码</td> <template v-for="(modules, index) in modules_list">
</tr> <input type="checkbox" name="modules[]" :value="modules.id" v-model='checked' :id="modules.id" />
<tr> <label :for="modules.id">{{ modules.module }}</label>
<td class="begin_blank"><input type="text" name="password" value="<?=htmlspecialchars($password) ?>" /></td> <br>
</tr> </template>
<p>备注</p>
<el-input v-model="comment" name="comment" class="input_300"></el-input><br />
<br/><br/>
<el-button type="danger" class="edit_btn" @click="submitForm()">新增</el-button>
<el-button type="danger" class="edit_btn" @Click="window.location='./account_list.php'" />返回</el-button>
<br/><br/>
</form>
</div>
</div>
<script type="text/javascript">
$(document).ready(function () {
var vm = new Vue({
el: '#form',
data: {
login: '<?=htmlspecialchars($login) ?>',
password:'<?=htmlspecialchars($password) ?>',
contact:'<?=htmlspecialchars($contact) ?>',
name:'<?=htmlspecialchars($name) ?>',
comment:'<?=htmlspecialchars($comment) ?>',
modules_list:<?=json_encode($modules_list)?>,
account_role:<?=json_encode($account_role_list)?>,
school_list:[{id:'1',title:"aa"},{id:'2',title:"bb"}],
government_list:<?=json_encode($government_list)?>,
selected:1,
checked:[],
isShow:true,
organization:'<?=$government_list[0]["id"]?>',
org_list:<?=json_encode($government_list)?>,
searchVal:''
<tr> },
<td>账户名称</td> watch:{
</tr> selected(val,oldval){
<tr> if(val > 8){
<td class="begin_blank"><input type="text" name="name" value="<?=htmlspecialchars($name) ?>" /></td> this.isShow = false;
</tr> }else{
this.isShow = true;
<tr> if(val >= 7){
<td>联系电话</td> this.org_list = this.school_list;
</tr> this.organization = '2';
<tr> }else{
<td class="begin_blank"><input type="text" name="contact" value="<?=htmlspecialchars($contact) ?>" /></td> this.org_list = this.government_list;
</tr> this.organization = '<?=$government_list[0]["id"]?>';
}
}
}
},
methods: {
submitForm() {
if(!this.login){
this.$message({
type: 'error',
message: '请输入登陆帐号。'
});
return;
}
if (!isAlpaNum(this.login)) {
this.$message({
type: 'error',
message: '登陆帐号只能使用半角英文或数字。'
});
return;
}
if (!this.password) {
this.$message({
type: 'error',
message: '请输入登陆密码。'
});
return;
}
if (!isAlpaNum(this.password)) {
this.$message({
type: 'error',
message: '登陆密码只能使用半角英文或数字。'
});
return;
}
if (!this.name) {
this.$message({
type: 'error',
message: '请输入账户名称。'
});
return;
}
$("input[name='account_role']").val(this.selected);
$("input[name='organization']").val(this.organization);
$('#form').submit();
}
},
computed: {
new_org_list() {
var _this = this;
var new_org_list = [];
_this.org_list.map(function(item) {
if (item.title.search(_this.searchVal) != -1) {
new_org_list.push(item);
}
});
if(new_org_list.length == 0){
new_org_list = _this.org_list;
}
return new_org_list;
}
}
})
if(<?=$error_message?1:0 ?>){
vm.$message({
type: 'error',
message: '<?=$error_message?>'
});
}
})
<tr> </script>
<td>备注</td>
</tr>
<tr>
<td class="begin_blank"><input type="text" name="comment" value="<?=htmlspecialchars($comment) ?>" /></td>
</tr>
<tr>
<td>权限 <span style="color:#FF0000">※全不选即为超级管理员</span></td>
</tr>
<tr>
<td class="begin_blank">
<?
foreach ($authority_level_list as $authority_level) {
?>
<label><input type="checkbox" name="authority_level[]" value="<?=$authority_level->name ?>"/><?=$authority_level->model ?></label>
<?
}
?>
</td>
</tr>
<tr>
</table>
<br />
<input type="button" value="新增" class="button_width_normal" onClick="doCheck();" />
</form>
...@@ -34,7 +34,7 @@ require(MANAGER_TEMPLATE_DIR_PATH. "/" . $layout_pages["header"]); ...@@ -34,7 +34,7 @@ require(MANAGER_TEMPLATE_DIR_PATH. "/" . $layout_pages["header"]);
<? require(MANAGER_TEMPLATE_DIR_PATH . "/" . $layout_pages["left"]); ?> <? require(MANAGER_TEMPLATE_DIR_PATH . "/" . $layout_pages["left"]); ?>
</div> </div>
</td> </td>
<td class="rightWidth" style="position: relative;"> <td class="rightWidth" style="position: relative;overflow-y: auto;overflow-x: hidden;">
<div class="right_content" style="position: absolute;top: 0;left: 0;"> <div class="right_content" style="position: absolute;top: 0;left: 0;">
<? require(MANAGER_TEMPLATE_DIR_PATH . "/" . $layout_pages["right"]); ?> <? require(MANAGER_TEMPLATE_DIR_PATH . "/" . $layout_pages["right"]); ?>
</div> </div>
...@@ -43,9 +43,9 @@ require(MANAGER_TEMPLATE_DIR_PATH. "/" . $layout_pages["header"]); ...@@ -43,9 +43,9 @@ require(MANAGER_TEMPLATE_DIR_PATH. "/" . $layout_pages["header"]);
</table> </table>
<script> <script>
$(function(){ $(function(){
var clientHeight = document.body.clientHeight; var clientHeight = document.body.clientHeight - 80;
$('.table').css('height',clientHeight) $('.table').css('height',clientHeight)
var width = document.body.clientWidth-200; var width = document.body.clientWidth-220;
$('.rightWidth').css('width',width) $('.rightWidth').css('width',width)
}) })
</script> </script>
......
<?php
/**
* 系统常量定义编辑
* $Id: system_const_edit_input.inc,v 1.1 2020/01/12 11:18:53 lixq Exp $
* @author lixq
* @access public
* @package manager.templates
**/
global $id;
global $action_type;
global $system_const_dat;
global $error_message;
?>
<div id="change">
<p class="edit_title">系统常量定义添加</p>
<form id="form" method="post" action="system_const_edit_result.php" enctype="multipart/form-data">
<input type="hidden" name="action_type" value="<?=$action_type ?>"/>
<input type="hidden" name="id" value="<?=$id ?>"/>
<div class="edit_content">
<p>常量定义名</p>
<el-input v-model="name" name="name" class="input_200"></el-input> <span style="color:#FF0000">(大写英文字母、下划线)</span><br />
<p>文字描述</p>
<el-input v-model="title" name="title" class="input_200"></el-input><br />
<p></p>
<el-input v-model="constant_value" name="constant_value" class="input_200"></el-input><br />
<el-button type="danger" @click="edit()" class="edit_btn">编辑</el-button>
<el-button type="danger" class="edit_btn" @Click="window.location='./system_const_list.php'" />返回</el-button>
</div>
</form>
</div>
<script type="text/javascript">
new Vue({
el:'#change',
data:{
name:'<?=htmlspecialchars($system_const_dat->name) ?>',
title:'<?=htmlspecialchars($system_const_dat->title) ?>',
constant_value:'<?=htmlspecialchars($system_const_dat->constant_value) ?>'
},
methods:{
edit:function(){
if(!this.name){
this.$message({
type: 'error',
message: '请输入常量定义名!'
});
return;
}
if(!this.name.match(/^[A-Z_]{1,}$/)){
this.$message({
type: 'error',
message: '常量定义名格式不正确!'
});
return;
}
if(!this.title){
this.$message({
type: 'error',
message: '请输入文字描述!'
});
return;
}
if(!this.name){
this.$message({
type: 'error',
message: '请输入值!'
});
return;
}
$('#form').submit();
}
}
})
$(document).ready(function () {
if(<?=$error_message?1:0 ?>){
vm.$message({
type: 'error',
message: '<?=$error_message?>'
});
}
})
</script>
<?php
/**
* 系统常量定义编辑完成
* $Id: system_const_edit_result.inc,v 1.12020/01/12 11:18:46 Exp $
* @author lixq
* @access public
* @package manager.templates
*/
?>
<br />
系统常量定义编辑完成
<br />
<br />
<div id="result">
<el-button type="danger" @click="back()" class="edit_btn">返回</el-button>
</div>
<script type="text/javascript">
new Vue({
el:'#result',
methods:{
back:function(){
window.location.href='./system_const_list.php';
}
}
})
</script>
<?php
/**
* 系统常量定义
* $Id: system_const_list.inc,v 1.1 2020/01/12 11:18:46 Exp $
* @author lixq
* @access public
* @package manager.templates
*/
global $system_const_list;
?>
<div id="classSetting">
<div class="list_title">
系统常量定义
<div style="float: right;">
<el-button type="primary" style="margin-right: 10px;" @click="addSysConst()">添加</el-button>
</div>
</div>
<br />
<div class="result_list">
<el-table :data="tableData" border>
<el-table-column prop="id" label="编号" width="50px"></el-table-column>
<el-table-column prop="name" label="常量定义名" width=""></el-table-column>
<el-table-column prop="title" label="文字描述" width=""></el-table-column>
<el-table-column prop="constant_value" label="常量的值" width=""></el-table-column>
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-button @click="handleChange(scope.row)" type="text" size="small">编辑</el-button>
<el-button type="text" size="small" @click.native.prevent="deleteRow(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
<script type="text/javascript">
var list=[];
<?
foreach ($system_const_list as $system_const_mst) {
?>
var data={
id:<?=$system_const_mst->id ?>,
name:'<?=$system_const_mst->name?>',
title:'<?=$system_const_mst->title?>',
constant_value:'<?=$system_const_mst->constant_value?>'
};
list.push(data);
<?
}
?>
new Vue({
el:'#classSetting',
data:{
tableData: list
},
methods:{
handleChange(row) {
console.log(row);
window.location.href='system_const_edit_input.php?action_type=edit&id='+row.id;
},
deleteRow(rows) {
this.$confirm('是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$message({
type: 'success',
message: '删除成功!'
});
// rows.splice(index, 1);
window.location.href='system_const_delete_result.php?id='+rows.id;
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
},
addSysConst(){
window.open('system_const_edit_input.php?action_type=new','_self')
}
}
})
</script>
\ No newline at end of file
...@@ -32,6 +32,7 @@ require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/definition/AccountRole.inc") ...@@ -32,6 +32,7 @@ require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/definition/AccountRole.inc")
require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/definition/AuthorityLevel.inc"); require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/definition/AuthorityLevel.inc");
require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/definition/SystemFunction.inc"); require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/definition/SystemFunction.inc");
require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/definition/OrganizationStatus.inc"); require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/definition/OrganizationStatus.inc");
require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/definition/AcountModule.inc");
// Action // Action
require_once(COMPASS_LIB_ROOT . "/cn/compass/action/TemplateAction.inc"); require_once(COMPASS_LIB_ROOT . "/cn/compass/action/TemplateAction.inc");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment