Commit 1ffb49b6 authored by 马超's avatar 马超

值班管理

parent c81eefd7
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.util.*" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
String add_user = pub.trimNull((String) session.getAttribute("session_login_id"));
if ("".equals(add_user)) {
System.out.println("当前没有用户信息");
}
String result="error";
try {
conn = com.censoft.db.DBUtil.getConnection();
String sql="select t1.login_id from t_book_user_role_rel t1 join t_book_role t2 " +
"on t1.role_id=t2.id where t1.login_id=? and t2.role_name like '%管理%'";
Vector role_list=cf.doQuery(conn,sql,null,new Object[]{add_user});
if(role_list!=null && role_list.size()>0){
result="success";
}
out.println(result);
} catch (Exception e) {
conn.rollback();
System.out.println("有异常" + e);
return;
} finally {
if (conn != null) {
conn.setAutoCommit(true);
try {
conn.close();
} catch (Exception e) {
}
}
}
%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page contentType="text/html;charset=UTF-8" language="java" %>
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/rili.css"> <link rel="stylesheet" href="<%=request.getContextPath()%>/css/rili.css">
<div style="margin-top: 10px;text-align: right;margin-right: 40px;"> <div style="margin-top: 10px;text-align: right;margin-right: 40px;">
<a class="btn btn-primary radius" onclick="zdPb();" > <a class="btn btn-primary radius" onclick="zdPb();" id="zdpb" style="display: none">
自动排班 自动排班
</a> </a>
<a class="btn btn-primary radius" onclick="viewUserWeek();" > <a class="btn btn-primary radius" onclick="viewUserWeek();" >
...@@ -228,4 +228,16 @@ ...@@ -228,4 +228,16 @@
}); });
//layer.full(abc); //layer.full(abc);
} }
getButtonRole();
function getButtonRole() {
$.ajax({
type: "post",
url: "getButtonRole.jsp",
success: function (msg) {
if (msg.indexOf("success") >= 0) {
$("#zdpb").css("display","");
}
}
});
}
</script> </script>
...@@ -41,12 +41,27 @@ ...@@ -41,12 +41,27 @@
} }
return tel; return tel;
} }
public static boolean getButtonRole(ConnectionFactory cf,Connection conn,String user_name) {
boolean b=false;
String sql="select t1.login_id from t_book_user_role_rel t1 join t_book_role t2 " +
"on t1.role_id=t2.id where t1.login_id=? and t2.role_name like '%管理%'";
Vector userList = cf.doQuery(conn,sql
,null,new Object[]{user_name});
if(userList!=null && userList.size()>0){
b=true;
}
return b;
}
%> %>
<% <%
ConnectionFactory cf = new ConnectionFactory(); ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub(); Pub pub = new Pub();
Connection conn = null; Connection conn = null;
Vector v_list = null; Vector v_list = null;
String add_user = pub.trimNull((String) session.getAttribute("session_login_id"));
if ("".equals(add_user)) {
System.out.println("当前没有用户信息");
}
String year = pub.trimNull(request.getParameter("year")); String year = pub.trimNull(request.getParameter("year"));
String month = pub.trimNull(request.getParameter("month")); String month = pub.trimNull(request.getParameter("month"));
String day = pub.trimNull(request.getParameter("day")); String day = pub.trimNull(request.getParameter("day"));
...@@ -117,9 +132,11 @@ ...@@ -117,9 +132,11 @@
<% <%
} }
%> %>
<%if(getButtonRole(cf,conn,add_user)){%>
<span onclick="editUser('<%=year+month+day%>','<%=zb_type%>');" style="text-align:center;position:absolute; right:0; bottom:0;"> <span onclick="editUser('<%=year+month+day%>','<%=zb_type%>');" style="text-align:center;position:absolute; right:0; bottom:0;">
<img src="../../images/edit.png" width="20" height="15" /> <img src="../../images/edit.png" width="20" height="15" />
</span> </span>
<%}%>
</div> </div>
<% <%
} }
......
...@@ -57,7 +57,6 @@ ...@@ -57,7 +57,6 @@
Hashtable ht_row = (Hashtable) v_list.get(0); Hashtable ht_row = (Hashtable) v_list.get(0);
String rowCnt = pub.trimNull((String) ht_row.get("ROWCOUNT")); String rowCnt = pub.trimNull((String) ht_row.get("ROWCOUNT"));
String telSegmentUrl="./list_add-t.jsp";
%> %>
<form method="post" id="form1" name="form1" action="export_query.jsp" > <form method="post" id="form1" name="form1" action="export_query.jsp" >
<div class="table-list" style="height:450px;"> <div class="table-list" style="height:450px;">
......
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.util.*" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
String add_user = pub.trimNull((String) session.getAttribute("session_login_id"));
if ("".equals(add_user)) {
System.out.println("当前没有用户信息");
}
String result="error";
try {
conn = com.censoft.db.DBUtil.getConnection();
String sql="select t1.login_id from t_book_user_role_rel t1 join t_book_role t2 " +
"on t1.role_id=t2.id where t1.login_id=? and t2.role_name like '%管理%'";
Vector role_list=cf.doQuery(conn,sql,null,new Object[]{add_user});
if(role_list!=null && role_list.size()>0){
result="success";
}
out.println(result);
} catch (Exception e) {
conn.rollback();
System.out.println("有异常" + e);
return;
} finally {
if (conn != null) {
conn.setAutoCommit(true);
try {
conn.close();
} catch (Exception e) {
}
}
}
%>
...@@ -9,13 +9,8 @@ ...@@ -9,13 +9,8 @@
height: 600px; height: 600px;
} }
</style> </style>
<div style="margin-top: 10px;display: none;">
<a class="btn btn-primary radius" onclick="operList();" >
导出
</a>
</div>
<div style="margin-top: 10px;text-align: right;margin-right: 40px;"> <div style="margin-top: 10px;text-align: right;margin-right: 40px;">
<a class="btn btn-primary radius" onclick="zdPb();" > <a class="btn btn-primary radius" onclick="zdPb();" id="zdpb" style="display: none">
自动排班 自动排班
</a> </a>
<a class="btn btn-primary radius" onclick="viewUserWeek();" > <a class="btn btn-primary radius" onclick="viewUserWeek();" >
...@@ -209,4 +204,16 @@ ...@@ -209,4 +204,16 @@
}); });
//layer.full(abc); //layer.full(abc);
} }
getButtonRole();
function getButtonRole() {
$.ajax({
type: "post",
url: "getButtonRole.jsp",
success: function (msg) {
if (msg.indexOf("success") >= 0) {
$("#zdpb").css("display","");
}
}
});
}
</script> </script>
...@@ -41,12 +41,27 @@ ...@@ -41,12 +41,27 @@
} }
return tel; return tel;
} }
public static boolean getButtonRole(ConnectionFactory cf,Connection conn,String user_name) {
boolean b=false;
String sql="select t1.login_id from t_book_user_role_rel t1 join t_book_role t2 " +
"on t1.role_id=t2.id where t1.login_id=? and t2.role_name like '%管理%'";
Vector userList = cf.doQuery(conn,sql
,null,new Object[]{user_name});
if(userList!=null && userList.size()>0){
b=true;
}
return b;
}
%> %>
<% <%
ConnectionFactory cf = new ConnectionFactory(); ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub(); Pub pub = new Pub();
Connection conn = null; Connection conn = null;
Vector v_list = null; Vector v_list = null;
String add_user = pub.trimNull((String) session.getAttribute("session_login_id"));
if ("".equals(add_user)) {
System.out.println("当前没有用户信息");
}
String year = pub.trimNull(request.getParameter("year")); String year = pub.trimNull(request.getParameter("year"));
String month = pub.trimNull(request.getParameter("month")); String month = pub.trimNull(request.getParameter("month"));
String day = pub.trimNull(request.getParameter("day")); String day = pub.trimNull(request.getParameter("day"));
...@@ -117,9 +132,11 @@ ...@@ -117,9 +132,11 @@
<% <%
} }
%> %>
<%if(getButtonRole(cf,conn,add_user)){%>
<span onclick="editUser('<%=year+month+day%>','<%=zb_type%>');" style="text-align:center;position:absolute; right:0; bottom:0;"> <span onclick="editUser('<%=year+month+day%>','<%=zb_type%>');" style="text-align:center;position:absolute; right:0; bottom:0;">
<img src="../../images/edit.png" width="20" height="15" /> <img src="../../images/edit.png" width="20" height="15" />
</span> </span>
<%}%>
</div> </div>
<% <%
} }
......
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