权限共90个,但实际只能加63个,超过的话提交出现空白
程序代码:
<%if request.Cookies("shiwei_username")="" then%> <script language="javascript">top.location.href="../index.asp"</script> <% response.end end if %> <!-- #include file="../conn2.asp" --> <!-- #include file="../const.asp" --> <!-- #include file="../inc/md5.asp" --> <html> <head> <title><%=gongsi%>-添加员工</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <link href="../style/style.css" rel="stylesheet" type="text/css"> <style>body {background-color:#FFFFFF;}</style> <script> function CheckAll(form) { for (var i=0;i<form.elements.length;i++) { var e = form.elements[i]; if (e.name != 'chkall') e.checked = form.chkall.checked; } } </script> </HEAD> <BODY> <%if fla49="0" and request.Cookies("shiwei_id")<>"1" then%> <br><center><img src="../images/note.gif" align="absmiddle"> <font color="#FF0000">你不具备此权限,请与管理员联系!</font></center> <% response.end end if %> <%if request("hid1")="" then%> <script language="javascript"> function check() { if (document.form1.gonghao.value==""||document.form1.username.value==""||document.form1.pwd.value==""||document.form1.zhenghao.value==""||document.form1.gongzi.value=="") { alert("有*号的必须填写!"); return false; }} </script> <form name="form1"> <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#C4D8ED"> <tr><td><img src="../images/r_1.gif" alt="" /></td> <td width="100%" background="../images/r_0.gif"> <table cellpadding="0" cellspacing="0" width="100%"> <tr><td> 添加员工(带*号的为必填项)</td> <td align="right"> </td> </tr></table></td> <td><img src="../images/r_2.gif" alt="" /></td> </tr> <tr><td></td> <td> <table align="center" cellpadding="4" cellspacing="1" class="toptable grid" border="1"> <tr><td width="25%" height="30" align="right">所属部门:</td> <td width="75%" class="category"> <% sql="select * from bumen order by id" set rs_bumen=conn.execute(sql) if rs_bumen.eof then %> <script language="javascript"> alert("请先添加员工部门!") window.location.href="bumen_add.asp" </script> <% response.end end if %> <select name="bumen"> <%do while rs_bumen.eof=false%> <option value="<%=rs_bumen("id")%>"><%=rs_bumen("bumen")%></option> <% rs_bumen.movenext loop %> </select> 所在小区: <% sql="select * from xiaoqu order by id" set rs_xiaoqu=conn.execute(sql) if rs_xiaoqu.eof then %> <script language="javascript"> alert("请先添加小区!") window.location.href="xiaoqu_add.asp" </script> <% response.end end if %> <select name="xiaoqu"> <%do while rs_xiaoqu.eof=false%> <option value="<%=rs_xiaoqu("id")%>"><%=rs_xiaoqu("xiaoqu")%></option> <% rs_xiaoqu.movenext loop %> </select></td></tr> <tr><td height="30" align="right">姓名:</td> <td class="category"><input type="text" name="username" style="width:100px"> <font color="#ff0000">*</font><font color="#666666"> (不能有同名的员工)</font></td></tr> <tr><td height="30" align="right">工号:</td> <td class="category"><input type="text" name="gonghao" style="width:100px"> <font color="#ff0000">*</font><font color="#666666"> (不能有相同的工号)</font> 工号和姓名都能登陆</td></tr> <tr><td align="right" height="30">操作口令:</td> <td class="category"><input type="text" name="pwd" style="width:100px"> <font color="#ff0000">*</font></td></tr> <tr><td align="right" height="30">基本工资:</td> <td class="category"><input type="text" name="gongzi" style="width:100px" onKeyUp="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"> <font color="#ff0000">*</font> 元 <font color="#666666">(只能是阿拉伯数字)</font></td></tr> <tr><td align="right" height="30">员工性别:</td> <td class="category"><input type="radio" name="xingbie" value="男" checked="checked"> 男 <input type="radio" name="xinbie" value="女"> 女</td></tr> <tr><td align="right" height="30">联系电话:</td> <td class="category"><input type="text" name="tel" style="width:150px"> QQ:<input type="text" name="qq" style="width:100px" onKeyUp="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"> Email:<input type="text" name="email" style="width:150px"></td></tr> <tr><td align="right" height="30">家庭住址:</td> <td class="category"><input type="text" name="address" style="width:200px"> 身份证号:<input type="text" name="zhenghao" style="width:200px"> <font color="#ff0000">*</font></td></tr> <tr><td align="right" height="30" valign="top">员工权限:</td> <td class="category"> <table cellpadding="3" cellspacing="0" width="100%" border="0"> <tr><td align="left"><input name="chkall" type="checkbox" id="chkall" value="select" onClick="CheckAll(this.form)" style="border:0">全选 <input type="reset" value="恢复默认" class="button"> </td></tr> </table> <table cellpadding="3" cellspacing="0" width="100%" border="0"> <tr><td width="25%"><input type="checkbox" name="quanxian87" value="1"> <font color=red> 查看项目成本</font></td> <td width="25%"><input type="checkbox" name="quanxian88" value="1"> <font color=red> 管理所有小区</font></td> <td width="25%"><input type="checkbox" name="quanxian89" value="1"> <font color=red> 查看操作记录</font></td> <td width="25%"><input type="checkbox" name="quanxian90" value="1"> <font color=red> 管理所有业主</font></td></tr> </table> <table cellpadding="3" cellspacing="0" width="100%" border="0"> <tr><td colspan="4" class="category">项目管理</td></tr> <tr><td width="25%"><input type="checkbox" name="quanxian1" value="1" checked="checked"> 添加项目</td> <td width="25%"><input type="checkbox" name="quanxian2" value="1" checked="checked"> 添加记录查询</td> <td width="25%"><input type="checkbox" name="quanxian3" value="1" checked="checked"> 添加状态审核</td> <td width="25%"><input type="checkbox" name="quanxian4" value="1"> 删除添加记录</td></tr> <tr><td><input type="checkbox" name="quanxian5" value="1" checked="checked"> 退回公司</td> <td><input type="checkbox" name="quanxian6" value="1" checked="checked"> 退单记录查询</td> <td><input type="checkbox" name="quanxian7" value="1" checked="checked"> 退单状态审核</td> <td><input type="checkbox" name="quanxian8" value="1"> 退单记录删除</td></tr> <tr><td><input type="checkbox" name="quanxian9" value="1" checked="checked"> 数量查询</td> <td><input type="checkbox" name="quanxian10" value="1"> 数量修改</td> <td><input type="checkbox" name="quanxian11" value="1"> 数量调转</td> <td><input type="checkbox" name="quanxian12" value="1"> 数量删除</td></tr> <tr><td><input type="checkbox" name="quanxian13" value="1" checked="checked"> 添加项目大类</td> <td><input type="checkbox" name="quanxian14" value="1" checked="checked">项目大类查询</td> <td><input type="checkbox" name="quanxian15" value="1"> 修改项目大类</td> <td><input type="checkbox" name="quanxian16" value="1"> 删除项目大类</td></tr> <tr><td><input type="checkbox" name="quanxian17" value="1" checked="checked"> 添加项目小类</td> <td><input type="checkbox" name="quanxian18" value="1" checked="checked"> 项目小类查询</td> <td><input type="checkbox" name="quanxian19" value="1"> 修改项目小类</td> <td><input type="checkbox" name="quanxian20" value="1"> 删除项目小类</td></tr> <tr><td><input type="checkbox" name="quanxian21" value="1" checked="checked"> 添加计量单位</td> <td><input type="checkbox" name="quanxian22" value="1" checked="checked"> 计量单位查询</td> <td><input type="checkbox" name="quanxian23" value="1"> 修改计量单位</td> <td><input type="checkbox" name="quanxian24" value="1"> 删除计量单位</td></tr> <tr><td colspan="4" class="category">收费管理</td></tr> <tr><td><input type="checkbox" name="quanxian25" value="1" checked="checked"> 前台收费</td> <td><input type="checkbox" name="quanxian26" value="1" checked="checked"> 收费记录查询</td> <td><input type="checkbox" name="quanxian27" value="1" checked="checked"> 收费状态审核</td> <td><input type="checkbox" name="quanxian28" value="1"> 收费记录删除</td></tr> <tr><td><input type="checkbox" name="quanxian29" value="1" checked="checked"> 项目退款</td> <td><input type="checkbox" name="quanxian30" value="1" checked="checked"> 退款记录查询</td> <td><input type="checkbox" name="quanxian31" value="1" checked="checked"> 退款状态审核</td> <td><input type="checkbox" name="quanxian32" value="1"> 退款记录删除</td></tr> <tr><td><input type="checkbox" name="quanxian33" value="1" checked="checked"> 物品报废</td> <td><input type="checkbox" name="quanxian34" value="1" checked="checked"> 报废记录查询</td> <td><input type="checkbox" name="quanxian35" value="1" checked="checked"> 报废状态审核</td> <td><input type="checkbox" name="quanxian36" value="1"> 报废记录删除</td></tr> <tr><td colspan="4" class="category">小区管理</td></tr> <tr><td><input type="checkbox" name="quanxian37" value="1" checked="checked"> 添加小区</td> <td><input type="checkbox" name="quanxian38" value="1" checked="checked"> 小区查询</td> <td><input type="checkbox" name="quanxian39" value="1"> 修改小区</td> <td><input type="checkbox" name="quanxian40" value="1"> 删除小区</td></tr> <tr><td><input type="checkbox" name="quanxian41" value="1"> 添加楼宇单元</td> <td><input type="checkbox" name="quanxian42" value="1"> 楼宇单元查询</td> <td><input type="checkbox" name="quanxian43" value="1"> 修改楼宇单元</td> <td><input type="checkbox" name="quanxian44" value="1"> 删除楼宇单元</td></tr> <tr><td colspan="4" class="category">人员管理</td></tr> <tr><td><input type="checkbox" name="quanxian45" value="1" checked="checked"> 添加业主</td> <td><input type="checkbox" name="quanxian46" value="1" checked="checked"> 业主查询</td> <td><input type="checkbox" name="quanxian47" value="1"> 修改业主</td> <td><input type="checkbox" name="quanxian48" value="1"> 删除业主</td></tr> <tr><td><input type="checkbox" name="quanxian49" value="1" checked="checked"> 添加员工</td> <td><input type="checkbox" name="quanxian50" value="1" checked="checked"> 员工查询</td> <td><input type="checkbox" name="quanxian51" value="1"> 修改员工</td> <td><input type="checkbox" name="quanxian52" value="1"> 删除员工</td></tr> <tr><td><input type="checkbox" name="quanxian53" value="1"> 添加部门</td> <td><input type="checkbox" name="quanxian54" value="1"> 部门查询</td> <td><input type="checkbox" name="quanxian55" value="1"> 修改部门</td> <td><input type="checkbox" name="quanxian56" value="1"> 删除部门</td></tr> <tr><td colspan="4" class="category">帐务管理</td></tr> <tr><td><input type="checkbox" name="quanxian57" value="1"> 添加银行</td> <td><input type="checkbox" name="quanxian58" value="1"> 银行查询</td> <td><input type="checkbox" name="quanxian59" value="1"> 修改银行</td> <td><input type="checkbox" name="quanxian60" value="1"> 删除银行</td></tr> <tr><td><input type="checkbox" name="quanxian61" value="1" checked="checked"> 添加帐务大类</td> <td><input type="checkbox" name="quanxian62" value="1" checked="checked"> 帐务大类查询</td> <td><input type="checkbox" name="quanxian63" value="1"> 修改帐务大类</td> <td><input type="checkbox" name="quanxian64" value="1"> 删除帐务大类</td></tr> <tr><td><input type="checkbox" name="quanxian65" value="1" checked="checked"> 添加帐务小类</td> <td><input type="checkbox" name="quanxian66" value="1" checked="checked"> 帐务小类查询</td> <td><input type="checkbox" name="quanxian67" value="1"> 修改帐务小类</td> <td><input type="checkbox" name="quanxian68" value="1"> 删除帐务小类</td></tr> <tr><td><input type="checkbox" name="quanxian69" value="1" checked="checked"> 添加帐务</td> <td><input type="checkbox" name="quanxian70" value="1" checked="checked"> 帐务查询</td> <td><input type="checkbox" name="quanxian71" value="1"> 修改帐务</td> <td><input type="checkbox" name="quanxian72" value="1"> 删除帐务</td></tr> <tr><td colspan="4" class="category">统计报表</td></tr> <tr><td><input type="checkbox" name="quanxian73" value="1" checked="checked"> 支出统计</td> <td><input type="checkbox" name="quanxian74" value="1" checked="checked"> 收费统计</td> <td><input type="checkbox" name="quanxian75" value="1" checked="checked"> 公司退单统计</td> <td><input type="checkbox" name="quanxian76" value="1" checked="checked"> 业主退单统计</td></tr> <tr><td><input type="checkbox" name="quanxian77" value="1" checked="checked"> 报废统计</td> <td><input type="checkbox" name="quanxian78" value="1" checked="checked"> 员工工资统计</td> <td> </td><td> </td></tr> <tr><td colspan="4" class="category"> 系统设置</td></tr> <tr><td><input type="checkbox" name="quanxian79" value="1"> 系统设置</td> <td><input type="checkbox" name="quanxian80" value="1"> 数据备份</td> <td><input type="checkbox" name="quanxian81" value="1"> 数据还原</td> <td><input type="checkbox" name="quanxian82" value="1"> 登陆日志</td></tr> <tr><td><input type="checkbox" name="quanxian83" value="1" checked="checked"> 添加供应单位</td> <td><input type="checkbox" name="quanxian84" value="1" checked="checked"> 查询供应单位</td> <td><input type="checkbox" name="quanxian85" value="1"> 修改供应单位</td> <td><input type="checkbox" name="quanxian86" value="1"> 删除供应单位</td></tr> </table></td></tr> <tr><td height="30"> </td> <td class="category"><input type="submit" value="确认添加" onClick="return check()" class="button"> <input type="hidden" name="hid1" value="ok"><input type="reset" value="重新填写" class="button"></td> </tr></table></td> <td></td> </tr> <tr><td><img src="../images/r_4.gif" alt="" /></td> <td></td> <td><img src="../images/r_3.gif" alt="" /></td> </tr></table></form> <% else nowgonghao=request("gonghao") nowqq=request("qq") nowemail=request("email") nowbumen=request("bumen") nowusername=request("username") nowpwd=request("pwd") nowgongzi=request("gongzi") nowxingbie=request("xingbie") nowtel=request("tel") nowaddress=request("address") nowzhenghao=request("zhenghao") nowxiaoqu=request("xiaoqu") nowquanxian="" if request("quanxian1")="1" then nowquanxian=nowquanxian&"1" else nowquanxian=nowquanxian&"0" end if for x=2 to 90 if request("quanxian"&x)="1" then nowquanxian=nowquanxian&",1" else nowquanxian=nowquanxian&",0" end if next sql="select * from login where gonghao='"&nowgonghao&"'" set rs=conn.execute(sql) if rs.eof=false then %> <script language="javascript"> alert("您输入的工号已经存在,请重新输入!") window.history.go(-1) </script> <% response.end end if sql="select * from login where username='"&nowusername&"'" set rs=conn.execute(sql) if rs.eof=false then %> <script language="javascript"> alert("您输入的姓名已经存在,如果有同名员工,请加以区分!") window.history.go(-1) </script> <% response.end end if sql="insert into login(gonghao,username,pwd,gongzi,quanxian,xingbie,tel,address,zhenghao,qq,email,bumen,xiaoqu) values('"&nowgonghao&"','"&nowusername&"','"&md5(nowpwd)&"',"&nowgongzi&",'"&nowquanxian&"','"&nowxingbie&"','"&nowtel&"','"&nowaddress&"','"&nowzhenghao&"','"&nowqq&"','"&nowemail&"',"&nowbumen&","&nowxiaoqu&")" conn.execute(sql) %> <script language="javascript"> alert("员工添加成功!") window.location.href="user.asp" </script> <%end if%> </body></html>
[ 本帖最后由 天蝎风 于 2010-12-1 12:07 编辑 ]