⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 on_numbers.asp

📁 武汉软件园人力资源管理系统完整源代码,希望大家能够多多交流.
💻 ASP
字号:
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<!--[if !mso]>
<style>
v\:*         { behavior: url(#default#VML) }
o\:*         { behavior: url(#default#VML) }
.shape       { behavior: url(#default#VML) }
</style>
<![endif]-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>人力资源管理系统</title>
<link href="../Include/type.css" rel="stylesheet" type="text/css">
</head>
<body >
<!--#include file="../Include/conn.asp"-->
<!--#include file="../Include/Head.asp"-->
<!--#include file="../Include/Syscheck.asp"-->
<div id="content" style="position:absolute; width:90%; height:90%; z-index:1; left: 48px; top: 168px;"><!--内容开始-->
  <div id="childmenu" style="position:absolute;top:60px;left:2%;width:12%;height:80px;z-index:2;"><!--子菜单-->
    <li><a href="On_numbers.asp">基于人数分析</a></li>
    <li><a href="On_dept.asp">基于部门分析</a></li>
  </div><!--子菜单结-->
  <div id="mainop" style="position:absolute; width:80%; height:90%; z-index:2; left: 18%; top: 0px;"><!--主操作开始-->
    <div id="condt" style="position:absolute; width:50%; height:15px;z-index:2; left: 0; top: 30px;">
      <!--分析条件开始-->
      <%
      call checkin_sys(session("UsersId"),session("PerId"),27)
      dim con_f
      con_f=Request.QueryString("select1")
    %>
      <form name="se_condt" method="get" action="On_numbers.asp">
        <SELECT name="select1" onchange="javascript:document.se_condt.submit();">
          <OPTION value=""   <%if con_f="" then
                                  Response.Write "selected"
                               end if%>>-请选择-</OPTION>
          <OPTION value="gz" <%if con_f="gz" then
                                  Response.Write "selected"
                               end if%>>按工作性质</OPTION>
          <OPTION value="zt" <%if con_f="zt" then
                                  Response.Write "selected"
                               end if%>>按员工状态</OPTION>
          <OPTION value="bm" <%if con_f="bm" then
                                  Response.Write "selected"
                               end if%>>按部门</OPTION>
          <OPTION value="gw" <%if con_f="gw" then
                                  Response.Write "selected"
                               end if%>>按岗位</OPTION>
          <OPTION value="zc" <%if con_f="zc" then
                                  Response.Write "selected"
                               end if%>>按职称</OPTION>
          <OPTION value="xl" <%if con_f="xl" then
                                  Response.Write "selected"
                               end if%>>按学历</OPTION>
          <OPTION value="zy" <%if con_f="zy" then
                                  Response.Write "selected"
                               end if%>>按专业</OPTION>
          <OPTION value="xb" <%if con_f="xb" then
                                  Response.Write "selected"
                               end if%>>按性别</OPTION>
        </SELECT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
       
      </form>
    </div><!--分析条件结束-->
    <div id="view" style="position:absolute; width:55%;z-index:2; left: 15%; top:30px;background-color:#eeeeee;"> 
      <!--查询结果开始-->
      <script type="text/javascript" src="zhu.js"></script>
    <script type="text/javascript">
    var dataArray = new Array();
    var nameArray = new Array(); 
    function indata(data,name)               //向数据数组赋值;参数为数据,名称
    {
      var data_arr=data.split(",");
      var name_arr=name.split(",");
      var i;
      for(i=0;i<data_arr.length-1;i++)
      {
        dataArray[i]=parseInt(data_arr[i]);
        nameArray[i]=name_arr[i].toString();
      }
    }
    
    function sedata(data,name)            //调用控件
    {
      indata(data,name)
      var total= new Array(dataArray,nameArray);
      table1(total,80,30,20,30,400,200,document.getElementById("show"));
	}
    
    function setable(data,name)
    {
      indata(data,name);
      var total= new Array(nameArray,dataArray);
      
      var mytable=document.createElement("table");
      var caption=document.createTextNode("人事分析");
      mytable.createCaption().appendChild(caption);
      var mytbody=document.createElement("tbody");

      var i,j;
      for(i=0;i<total.length;i++)
      {
        var row=document.createElement("tr");
        for(j=0;j<total[i].length;j++)
        {
           var cell=document.createElement("td");
           cell.setAttribute("align", "center");
           if (i==0)
           {cell.setAttribute("bgColor", "#eeeeee");}
           else
           {cell.setAttribute("bgColor", "#f8f8f8");}
           var text=document.createTextNode(total[i][j]);
           cell.appendChild(text);
           row.appendChild(cell);
        }
        row.setAttribute("height","38");
        mytbody.appendChild(row);
      }
      
      mytable.appendChild(mytbody);
      mytable.setAttribute("border", "0");
      mytable.setAttribute("align", "center");
      mytable.setAttribute("width", "70%");
      mytable.setAttribute("cellSpacing", "2");
      mytable.setAttribute("cellPadding", "0");
      mytable.setAttribute("class", "table1");
      document.getElementById("show").innerHTML=""
      show.appendChild(mytable);
      
    }


    </script>
<%
    dim str_data,str_name
    
    if con_f<>"" then
        dim res
        set res=server.CreateObject("ADODB.recordset")
        
        if con_f="gz" then
          res.Open "select work_property,count(work_property) as '人数' from personnel  where personnel_state='在职' or personnel_state='试用' group by work_property",conn,1,1
          do while not res.EOF=true
              str_name=str_name&trim(res("work_property"))&","
              str_data=str_data&trim(res("人数"))&","
              res.MoveNext
          loop
          res.close
        elseif con_f="zt" then
           res.Open "select personnel_state,count(personnel_state) as '人数' from personnel  where personnel_state='在职' or personnel_state='试用' group by personnel_state",conn,1,1
           do while not res.EOF=true
               str_name=str_name&trim(res("personnel_state"))&","
               str_data=str_data&trim(res("人数"))&","
               res.MoveNext
           loop
           res.Close        
        elseif con_f="bm" then
           res.Open "select a.dept_name,b.人数 from dept as a inner join (select dept_id,count(dept_id) as '人数' from personnel where personnel_state='在职' or personnel_state='试用' group by dept_id) as b on a.dept_id=b.dept_id",conn,1,1
           do while not res.EOF=true
               str_name=str_name&trim(res("dept_name"))&","
               str_data=str_data&trim(res("人数"))&","
               res.MoveNext
           loop
           res.Close               
        elseif con_f="gw" then
           res.Open "select a.post_name,b.人数 from post as a inner join (select post_id,count(post_id) as '人数' from personnel where personnel_state='在职' or personnel_state='试用' group by post_id) as b on a.post_id=b.post_id",conn,1,1
           do while not res.EOF=true
               str_name=str_name&trim(res("post_name"))&","
               str_data=str_data&trim(res("人数"))&","
               res.MoveNext
           loop
           res.Close                       
        elseif con_f="zc" then
           res.Open "select personnel_level,count(personnel_level) as '人数' from personnel  where personnel_state='在职' or personnel_state='试用' group by personnel_level",conn,1,1
           do while not res.EOF=true
               str_name=str_name&trim(res("personnel_level"))&","
               str_data=str_data&trim(res("人数"))&","
               res.MoveNext
           loop
           res.Close        
        elseif con_f="xl" then
           res.Open "select personnel_educ,count(personnel_educ) as '人数' from personnel  where personnel_state='在职' or personnel_state='试用' group by personnel_educ",conn,1,1
           do while not res.EOF=true
               str_name=str_name&trim(res("personnel_educ"))&","
               str_data=str_data&trim(res("人数"))&","
               res.MoveNext
           loop
           res.Close               
        elseif con_f="zy" then
           res.Open "select personnel_major,count(personnel_major) as '人数' from personnel  where personnel_state='在职' or personnel_state='试用' group by personnel_major",conn,1,1
           do while not res.EOF=true
               str_name=str_name&trim(res("personnel_major"))&","
               str_data=str_data&trim(res("人数"))&","
               res.MoveNext
           loop
           res.Close                       
        elseif con_f="xb" then
           res.Open "select personnel_sex,count(personnel_sex) as '人数' from personnel  where personnel_state='在职' or personnel_state='试用' group by personnel_sex",conn,1,1
           do while not res.EOF=true
               str_name=str_name&trim(res("personnel_sex"))&","
               str_data=str_data&trim(res("人数"))&","
               res.MoveNext
           loop
           res.Close                               
        end if
%>
        分析结果已得到!
        <INPUT type="button" value="表格显示" name=button1 onclick="setable('<%=str_data%>','<%=str_name%>')">
        <INPUT type="button" value="柱图显示" name=button2 onclick="sedata('<%=str_data%>','<%=str_name%>')">

<%    
    else
        Response.Write "请选择分析条件!"
    end if
%>
    </div><!--查询结果结束-->
    <div id="show" style="position:absolute; width:100%; z-index:3; left: 0; top:100px;" ></div><!--柱图显示-->
  </div><!--主操作结束-->
  <!--#include file="../Include/bottom.asp"-->
</div><!--内容结束-->
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -