<!--#include file="../include/Conn.asp"-->
<!--#include file="../Include/Char.asp" -->
<!--#include file="../include/md5.asp"-->
<!--#include file="Admin_IsLogin.asp" -->
<!--#include file="../Include/html.inc"-->
<%
'Define Variable 
dim i
dim rs
dim mGrade,mSql,mFlag,mBgColor

'initialization 
mFlag=true'add

'Display
if request("action")="edit" then 
 'Read
 mSql="Select * From T_Personal Where F_ID="&Request.QueryString("ModifyID")
 Set rs = conn.Execute(mSql)
 if Not rs.Eof then 
   mUserName = rs("F_UserName")
   mPassword = rs("F_Password")
   mQuestion = rs("F_Question")
   mAnswer = rs("F_Answer")
   mIntegral = rs("F_Integral")
   mRealName = rs("F_RealName")
   mEmail = rs("F_Email")
   mAddress = rs("F_Address")
   mTel = rs("F_Tel")
   mFax = rs("F_Fax")
   mMobile = rs("F_Mobile")
   mCompanyName = rs("F_CompanyName")
   'mGrade = rs("F_Grade")
   mMemo = rs("F_Memo")
 End if
 mFlag=false
 rs.Close
End if

if Request.ServerVariables("REQUEST_METHOD")="POST" then
   mUserName = checkStr(Trim(Request.Form("txtUserName")))
   mQuestion = checkStr(Trim(Request.Form("txtQuestion")))
   mPassword = checkStr(Trim(Request.Form("txtPassword")))
   mAnswer = checkStr(Trim(Request.Form("txtAnswer")))
   mRealName = checkStr(Trim(Request.Form("txtRealName")))
   mEmail = checkStr(Trim(Request.Form("txtEmail")))
   mTel = checkStr(Trim(Request.Form("txtTel")))
   mMobile = checkStr(Trim(Request.Form("txtMobile")))
   mFax = checkStr(Trim(Request.Form("txtFax")))
   mAddress = checkStr(Trim(Request.Form("txtAddress")))
   mCompanyName = checkStr(Trim(Request.Form("txtCompanyName")))
   mMemo = checkStr(rTrim(Request.Form("txtMemo")))
   if Request("action")="Insert" then
    mSql = "Select * From T_Personal Where F_UserName='"&mUserName&"'"
	Set rs = conn.Execute(mSql)
	if not rs.Eof then
	   rs.Close
	   call msgbox("对不起，该用户名已存在，请更换用户名后再试",1)
	   Response.end
	else
	  rs.Close
	  mSql = "Insert Into T_Personal(F_UserName,F_Password,F_Question,F_Answer,F_RealName,F_Email,F_Tel,F_Address,F_Fax,F_Mobile,F_CompanyName,F_Memo,F_IsCheck)"
	  mSql = mSql + "Values('"&mUserName&"','"&md5(mPassword)&"','"&mQuestion&"','"&mAnswer&"','"&mRealName&"','"&mEmail&"','"&mTel&"','"&mAddress&"','"&mFax&"','"&mMobile&"','"&mCompanyName&"','"&mMemo&"',1)"
      conn.Execute(mSql)
      response.redirect "Admin_Personal2.asp?action=IsInsert&pageno="&Request("pageno")
     end if '//rs.eof
  else 
      mSql = "UPDATE T_Personal SET"
	  mSql = mSql+" F_UserName='"&mUserName&"',"
      if mPassword <> "" then  mSql = mSql+" F_Password='"&md5(mPassword)&"',"
      mSql = mSql+" F_Question='"&mQuestion&"',"
      mSql = mSql+" F_Answer='"&mAnswer&"',"
      mSql = mSql+" F_RealName='"&mRealName&"',"
      mSql = mSql+" F_Email='"&mEmail&"',"
      mSql = mSql+" F_Address='"&mAddress&"',"
      mSql = mSql+" F_Fax='"&mFax&"',"
      mSql = mSql+" F_Mobile='"&mMobile&"',"
      mSql = mSql+" F_Tel='"&mTel&"',"
      mSql = mSql+" F_CompanyName='"&mCompanyName&"',"
      mSql = mSql+" F_Grade='"&mGrade&"',"
      mSql = mSql+" F_Memo='"&mMemo&"'" 
      mSql = mSql +" WHERE F_ID=" & Request("ModifyID") 
      conn.Execute(mSql)
      Response.redirect "Admin_Personal2.asp?action=IsModify&pageno="&Request("pageno")
   End if
 End if

'Delect Records
if request("action")="Delete" then
  mSql = "DELETE FROM zp WHERE id="&request("id")
  conn.execute mSql
end if
%>

<html>
<head>
<title></title>
<META http-equiv=Content-type content="text/html; charset=gb2312">
<link href="Images/Style.css" rel="stylesheet" type="text/css">
<SCRIPT LANGUAGE="JavaScript">
<!--//
function check()
{
   if (isNaN(go2to.page.value))
		alert("请正确填写转到页数！");
   else if (go2to.page.value=="") 
	     {
		alert("请输入转到页数！");
		 }
   else
		go2to.submit();
}
//-->
</SCRIPT>
<SCRIPT language="JavaScript">
function jDelete(url)
{
  if((confirm(" 警告:请确定是否删除,删除后不能恢复! "))==true) 
	self.location=url+'&action=Delete';
}
</SCRIPT>
<script language="javascript">
function CheckData(){
  if (document.form1.txtUserName.value=="")
   {
    alert("对不起,用户名不能为空，请输入！");
	document.form1.txtUserName.focus();
	return false;
   }
}
</script>
</head>
<body text="#000000" >
	  <%
      admin_flag="08"
      if instr(session("flag1"),admin_flag)=0 or isnull(session("flag1"))=true then
         Response.write "<br><br><br><br><b><font color=red>对不起，您没有管理本页面的权限!</font></B>"
		 Response.end
	  end if
      %>
	  
<br>
<table width="95%" border="0" align="center" cellpadding="4" cellspacing="0" bordercolor="#111111" id="AutoNumber71" style="border-collapse: collapse">
  <tr>
    <% set rs=server.createobject("adodb.recordset") 
              if not isempty(request("page")) then   
	          pagecount=cint(request("page"))   
              else   
	          pagecount=1   
              end if
			  sql="select * from zp where uname & cname like '%"&key&"%' order by id desc"
			  rs.open sql,conn,1,1   
              if rs.eof and rs.bof then  %>
    <br>
    <a href=admin_company.asp>对不起，没有记录！点击返回！！！</a> <br>
    <%  response.end
			end if
              rs.pagesize=15
              if pagecount>rs.pagecount or pagecount<=0 then              
              pagecount=1              
              end if              
              rs.AbsolutePage=pagecount %>
    <td align=middle width="100%"><% if rs.pagecount=1 then %>
        <font color="#000000">共有[<font color="#ff0000"><%=rs.recordcount%></font>]位单位用户符合条件 以下是[<font color="red">1～<%=rs.recordcount%></font>]条</font>
        <%else%>
        <% page_start=(pagecount-1)*rs.pagesize
            if pagecount=1 then page_start=1
		    page_end=rs.pagesize*pagecount
		    if pagecount*rs.pagesize=>rs.recordcount then page_end=rs.recordcount end if%>
      共有[<font color="#ff0000"><%=rs.recordcount%></font>]位单位用户符合条件 以下是[<font color="red"><%=page_start%>～<%=page_end%></font>]条</td>
  </tr>
</table>
<table width="95%" border="0" align="center" cellpadding="2" cellspacing="1" bordercolor="#111111" id="AutoNumber72" style="border-collapse: collapse">
  <tr>
    <td width="100%"><% response.write"<form name=go2to form method=Post action='admin_company.asp?key="+key+"'>"
		     response.write "<font color='#000064'>◆&nbsp;</font>"                                              
		     if pagecount=1 then                                                        
			 response.write "<font color='#000064'>首页 上一页</font>&nbsp;"
			 else                                                        
             response.write "<a href=admin_company.asp?page=1&key="+key+"><font color='0000BE'>首页</font></a>&nbsp;" 
	         response.write "<a href=admin_company.asp?page="+cstr(pagecount-1)+"&key="+key+"><font color='0000BE'>上一页</font></a>&nbsp;"
			 end if                                             
             if rs.PageCount-pagecount<1 then                                                        
             response.write "<font color='#000064'>下一页 尾页</font>"                                                    
			 else                                                        
             response.write "<a href=admin_company.asp?page="+cstr(pagecount+1)+"&key="+key+"><font color='0000BE'>下一页</font></a>&nbsp;"
			 response.write "<a href=admin_company.asp?page="+cstr(rs.PageCount)+"&key="+key+"><font color='0000BE'>尾页</font></a>"           
             end if 
			 response.write "<font color='000064'>&nbsp;页次:<font color=blue>"&pagecount&"</font>/"&rs.pagecount&"页</font>" 
			response.write "<font color='000064'> 转到第　<input type='text' name='page'style='border:1px solid #1168A9; background-color: #EBEBEB; color: #00006A; font-family: 宋体; font-size: 9pt; padding-left:4; padding-right:4; padding-top:1; padding-bottom:1' size=5 maxLength=5 style='font-size: 9pt; color:#00006A; position: relative; height: 18' value="&PageCount&">　页</font>&nbsp;"                               
			response.write "　<input class=button type='button' value='确 定' onclick=check() style='border:1px solid #1168A9; font-family: 宋体; font-size: 9pt; color: #00006A; padding-left:4; padding-right:4; padding-top:1; padding-bottom:1; background-color:#EBEBEB' position: relative; height: 19'>" %>
    </td>
    <%end if%>
  </tr>
</table>
<table class=tableBorder width="95%" border="0" align="center" cellpadding="2" cellspacing="1">
  <tr> 
    <th height=22 colspan="9" align="center" sytle="line-height:150%">招聘列表</th>
  </tr>
  <tr > 
    <td width="6%" align="center" class=forumHeaderBackgroundAlternate><b>ID</b></td>
    <td width="21%" class=forumHeaderBackgroundAlternate><div align="center"><b>职位</b></div></td>
    <td width="8%" align="center" class=forumHeaderBackgroundAlternate><b>性别</b></td>
    <td width="14%" align="center" class=forumHeaderBackgroundAlternate><strong>发布时间</strong></td>
    <td width="8%" align="center" class=forumHeaderBackgroundAlternate><strong>招聘人数</strong></td>
    <td width="7%" align="center" class=forumHeaderBackgroundAlternate><strong>学历</strong></td>
    <td width="19%" align="center" class=forumHeaderBackgroundAlternate><strong>公司名称</strong></td>
    <td width="5%" align="center" class=forumHeaderBackgroundAlternate><strong>热点</strong></td>
    <td width="12%" align="center" class=forumHeaderBackgroundAlternate><b>管理[<font color="#FF0000">删除</font>]</b></td>
  </tr>
  <% do while not rs.eof %>
  <tr> 
    <td  class=forumRow width="6%" align="center"><%=rs("id")%></td>
    <td class=forumRow ><div align="center"><a href='../main/job.asp?uid=<%=rs("uname")%>&id=<%=rs("id")%>' target="_blank" ><%=rs("job")%></a></div></td>
    <td class=forumRow align="center" ><%=rs("sexs")%></td>
    <td class=forumRow width="14%" align="center" ><% if rs("idate")<>"" then%><%=rs("idate")%><%else response.write"未登录" end if%></td>
    <td class=forumRow width="8%" align="center" ><%=rs("zpnum")%></td>
    <td class=forumRow align="center" ><%=rs("edus")%></td>
    <td class=forumRow align="center" ><% if rs("cname")<>"" then%>
      <a href="../main/company.asp?uid=<%=rs("uname")%>" target=_blank>
      <% if len(rs("cname"))>8 then%>
      <%=Left(rs("cname"),8)%>...
      <%else%>
      <%=rs("cname")%>
      <%end if%>
      </a>
      <%else response.write"[未登录]" end if%>
    　    </td>
    <td align="center" class=forumRow ><% if rs("rdjob")<>"1" then%>
      普
      <%else%>
      热
    <%end if%></td>
    <td class=forumRow width="12%" align="center" ><a href='Company_job_update.asp?id=<%=rs("id")%>'>修改</a> | <a href='Admin_Company.asp?action=Delete&id=<%=rs("id")%>' onclick="{if(confirm('确定删除选定的纪录吗?')){return true;}return false;}">删除</a></td>
  </tr>
  <% i=i+1
          rs.movenext     
          if i>=rs.PageSize then exit do 
		  loop 
		  rs.close
          set rs=nothing                                                                                                
          conn.close                                                                                                
          set conn=nothing
           %>
  <tr> 
    <td class=forumRow  colspan="9" align="center">&nbsp;
	</td>
  </tr>
</table>
</body>
</html>
