<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"--><%WS_M.HX_BargainManage%>
<head>
<title></title>
<link rel=stylesheet type=text/css href="../HXinclude/HX_Style.css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script src="../HXinclude/HX_function.js"></script>
</head>
<body topmargin="20" leftmargin="0" bottommargin="20">
<table width="609"  border="0" cellspacing="1" cellpadding="0" align=center bgcolor="#613c25">
  <tr>
    <td width="609" colspan="2" bgcolor=FFFBE8><table width="609"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="609" height="25" background="../hximages/titleline.gif"><font class="fontmenu">合同管理</font></td>
  </tr>
</table>
<table width="100%" cellspacing cellpadding>  
<tr><td width="100%"> 
<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#613c25" height="100%">
                      <%select case action
					     case "edit"
						    %>
							<tr> 
                            <td bgcolor=FFFBE8><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor=BF9B73>
                         <form action="bargainmanage.asp" name="form1" method="post">
                          <tr bgcolor="#FFFBE8"> 
                            <td width="80" bgcolor="#FFFBE8">合同开始日期</td>
                            <td width="195"> 
                              <select name="byys">
                                <%
								if rs("WS_statetime")<>"" then
								statetimearr=rs("WS_statetime")
								else
								statetimearr=date
								end if
								statetimearr=split(statetimearr,"-")
								for i=year(date)-30 to year(date)+10%> 
                                <option value="<%=i%>"<%if i=statetimearr(0) then%> selected<%end if%>><%=i%></option>
                                <%next%> 
                              </select>
                              年 
                              <select name="bmms">
                                <%for i=1 to 12%> 
                                <option value="<%=i%>"<%if i=statetimearr(1) then%> selected<%end if%>><%=i%></option>
                                <%next%>
                              </select>
                              月 
                              <select name="bdds">
                                <%for i=1 to 31%> 
                                <option value="<%=i%>"<%if i=statetimearr(2) then%> selected<%end if%>><%=i%></option>
                                <%next%>
                              </select>
                            日</td>
                            <td width="80" bgcolor="#FFFBE8">合同结束日期</td>
                            <td> 
                              <select name="byyo">
                                <%
								if rs("WS_overtime")<>"" then
								overtimearr=rs("WS_overtime")
								else
								overtimearr=date
								end if
								overtimearr=split(overtimearr,"-")
								for i=year(date)-20 to year(date)+20%> 
                                <option value="<%=i%>"<%if i=overtimearr(0) then%> selected<%end if%>><%=i%></option>
                                <%next%> 
                              </select>
                              年 
                              <select name="bmmo">
                                <%for i=1 to 12%> 
                                <option value="<%=i%>"<%if i=overtimearr(1) then%> selected<%end if%>><%=i%></option>
                                <%next%> 
                              </select>
                              月 
                              <select name="bddo">
                                <%for i=1 to 31%> 
                                <option value="<%=i%>"<%if i=overtimearr(2) then%> selected<%end if%>><%=i%></option>
                                <%next%> 
                              </select>
                            日</td>
                          </tr>
                          <tr> 
                            <td width="80" bgcolor="#FFFBE8">签订时间</td>
                            <td colspan="3" bgcolor="#FFFBE8"> 
                              <select name="byy">
                                <%
								if rs("WS_register")<>"" then
								registerarr=rs("WS_register")
								else
								registerarr=date
								end if
								registerarr=split(registerarr,"-")
								for i=year(date)-20 to year(date)+20%> 
                                <option value="<%=i%>"<%if i=registerarr(0) then%> selected<%end if%>><%=i%></option>
                                <%next%> 
                              </select>
                              年 
                              <select name="bmm">
                                <%for i=1 to 12%> 
                                <option value="<%=i%>"<%if i=registerarr(1) then%> selected<%end if%>><%=i%></option>
                                <%next%> 
                              </select>
                              月 
                              <select name="bdd">
                                <%for i=1 to 31%> 
                                <option value="<%=i%>"<%if i=registerarr(2) then%> selected<%end if%>><%=i%></option>
                                <%next%> 
                              </select>
                            日</td>
                          </tr>
                          <tr> 
                            <td width="80" bgcolor="#FFFBE8">合同类别</td>
                            <td colspan="3" bgcolor="#FFFBE8">
							   <select name="WS_state"><%
							   set strs=WS_S.HX_SetRSD("","HX_bargaintype"," order by WS_OrderBy asc")
							   if strs.recordcount>0 then
							    do until strs.eof
							   %>
                              <option value="<%=strs("WS_Tid")%>" <%if strs("WS_Tid")=rs("WS_state") then response.write "selected" %>><%=strs("WS_bargaintypename")%></option>
							  <%
							    strs.movenext
								loop
							   end if
							   Call WS_S.HX_RSClose(strs)
							   %>
                              </select></td>
                          </tr>
                          <tr>
                            <td bgcolor="#FFFBE8">主要负责人</td>
                            <td colspan="3" bgcolor="#FFFBE8"><input type="text" name="WS_Name" value="<%set urs=WS_S.HX_SetRSD("","HX_CompanyUser"," where WS_Uid="&rs("WS_Uid")):if urs.recordcount>0 then response.Write urs("WS_name") else response.Write "无"%>" size="20" readonly>&nbsp;&nbsp;
                            <input type="button" name="Submit" value=" 选 择 " onclick="openwin(510,500,'../HXInclude/HX_Checkuser.asp')"></td>
                          </tr>
                          <tr> 
                            <td width="80" bgcolor="#FFFBE8">合同附件</td>
                            <td colspan="3" bgcolor="#FFFBE8"><input type="text" name="WS_Annex" maxlength="200" size="40" value="<%=rs("WS_Annex")%>">&nbsp;&nbsp;<input type="button" name="Submit2" value="上传附件" onClick="window.open('../HXManpowerResource/UpUserAnnex.asp?editname=WS_Annex','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')"></td>
                          </tr>
                          <tr> 
                            <td width="80" bgcolor="#FFFBE8">特别条款</td>
                            <td colspan="3" bgcolor="#FFFBE8"> 
<input type="text" name="WS_notice" maxlength="200" size="40" value="<%=rs("WS_notice")%>">                            
&nbsp;</td>
                          </tr>
                          <tr> 
                            <td width="80" bgcolor="#FFFBE8">备注</td>
                            <td colspan="3" bgcolor="#FFFBE8"> 
                              <textarea name="WS_brief" cols="40" rows="5"><%=rs("WS_brief")%></textarea>
                            &nbsp;</td>
                          </tr>
                          <tr align="right" bgcolor="#FFFBE8"> 
                            <td colspan="4"> 
                              <input type="submit" name="提交" value="修改合同">
							  <input type="button" name="WS_Submit2" value=" 返 回 " onclick="javascript:history.go(-1);">
                              <input type="hidden" name="action" value="editcompactsave">
                            <input type="hidden" name="WS_Uid" value="<%=rs("WS_Uid")%>">   
							<input type="hidden" name="WS_id" value="<%=WS_id%>">                          </td>
                          </tr></form>
						 
                        </table></td>
                          </tr>
						  <%
						  case "view"
						  %> <tr> 
                            <td bgcolor=FFFBE8>
						  <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor=BF9B73>
                          <tr bgcolor="#FFFBE8"> 
                            <td width="80" bgcolor="#FFFBE8">合同开始日期</td>
                            <td width="195"><%=WS_S.Format_Time(rs("WS_statetime"),5)%></td>
                            <td width="80" bgcolor="#FFFBE8">合同结束日期</td>
                            <td><%=WS_S.Format_Time(rs("WS_overtime"),5)%></td>
                          </tr>
                          <tr> 
                            <td width="80" bgcolor="#FFFBE8">签订时间</td>
                            <td colspan="3" bgcolor="#FFFBE8"><%=WS_S.Format_Time(rs("WS_register"),5)%></td>
                          </tr>
                          <tr> 
                            <td width="80" bgcolor="#FFFBE8">合同类别</td>
                            <td colspan="3" bgcolor="#FFFBE8"><%set strs=WS_S.HX_SetRSD("","HX_bargaintype"," where WS_Tid="&rs("WS_state")):if strs.recordcount>0 then:response.Write strs("WS_bargaintypename"):end if:Call WS_S.HX_RSClose(strs)%></td>
                          </tr>
                          <tr>
                            <td bgcolor="#FFFBE8">主要负责人</td>
                            <td colspan="3" bgcolor="#FFFBE8"><%set urs=WS_S.HX_SetRSD("","HX_CompanyUser"," where WS_Uid="&rs("WS_Uid")):if urs.recordcount>0 then response.Write "<a style='cursor:hand;' onclick=""openwin(680,600,'../HXManpowerResource/userinfolook.asp?WS_Uid="&urs("WS_Uid")&"')"">"&urs("WS_name")&"</a>" else response.Write "无"%></td>
                          </tr>
                          <tr> 
                            <td width="80" bgcolor="#FFFBE8">合同附件</td>
                            <td colspan="3" bgcolor="#FFFBE8"><%
							if rs("WS_Annex")<>"" then
							 response.write "<a href='../HXManpowerResource/"&rs("WS_Annex")&"' target='_blank'>"&rs("WS_Annex")&"</a>"
							else
							 response.write "无"
						    end if
							%></td>
                          </tr>
                          <tr> 
                            <td width="80" bgcolor="#FFFBE8">特别条款</td>
                            <td colspan="3" bgcolor="#FFFBE8"><%=rs("WS_notice")%></td>
                          </tr>
                          <tr> 
                            <td width="80" bgcolor="#FFFBE8">备注</td>
                            <td colspan="3" bgcolor="#FFFBE8"> <%=rs("WS_brief")%></td>
                          </tr>                        
                        </table></td>
                          </tr>
						  <tr bgcolor="#FFFBE8"> 
                            <td height="2" align=right><input type="button" name="WS_Submit2" value=" 返 回 " onclick="javascript:history.go(-1);">
						    <input type="button" name="WS_Submit2" value=" 打 印 " onclick="javascript:print();">						    </td>
                          </tr>
							<%
						 case else
						   if rs.recordcount<=0 then%>
                          <tr> 
                            <td height="27" bgcolor=FFFBE8>&nbsp;暂无合同，您要<a href="addbargain.asp"><font color=red>添加</font></a>吗？</td>
                          </tr>
						  <%else%> 
                        <tr> 
                          <td bgcolor=FFFBE8><table width="100%"  border="0" cellspacing="1" cellpadding="0" bgcolor="BF9B73">
  <tr bgcolor="#FFFBE8">
    <td width="7%" height="20"><div align="center">
	<%
	if DESCORASC="WS_id desc" then
	  response.Write "<a style='cursor:hand;' onclick=""location.href='bargainmanage.asp?DESCORASC=WS_id asc';""><img src='../hximages/down.gif' align=absmiddle>"
	elseif DESCORASC="WS_id asc" then
	 response.Write "<a style='cursor:hand;' onclick=""location.href='bargainmanage.asp?DESCORASC=WS_id desc';""><img src='../hximages/up.gif' align=absmiddle>"	
	else
	 response.Write "<a style='cursor:hand;' onclick=""location.href='bargainmanage.asp?DESCORASC=WS_id desc';"">"
	end if 
	%>序号</div></td>
    <td width="11%"><div align="center"><%
	if DESCORASC="WS_uid desc" then
	  response.Write "<a style='cursor:hand;' onclick=""location.href='bargainmanage.asp?DESCORASC=WS_uid asc';""><img src='../hximages/down.gif' align=absmiddle>"
	elseif DESCORASC="WS_uid asc" then
	 response.Write "<a style='cursor:hand;' onclick=""location.href='bargainmanage.asp?DESCORASC=WS_uid desc';""><img src='../hximages/up.gif' align=absmiddle>"
	else
	 response.Write "<a style='cursor:hand;' onclick=""location.href='bargainmanage.asp?DESCORASC=WS_uid desc';"">"
	end if 
	%>签约人</div></td>
    <td width="12%"><div align="center"><%
	if DESCORASC="WS_state desc" then
	  response.Write "<a style='cursor:hand;' onclick=""location.href='bargainmanage.asp?DESCORASC=WS_state asc';""><img src='../hximages/down.gif' align=absmiddle>"
	elseif DESCORASC="WS_state asc" then
	 response.Write "<a style='cursor:hand;' onclick=""location.href='bargainmanage.asp?DESCORASC=WS_state desc';""><img src='../hximages/up.gif' align=absmiddle>"
	else
	 response.Write "<a style='cursor:hand;' onclick=""location.href='bargainmanage.asp?DESCORASC=WS_state desc';"">"
	end if 
	%>合同类别</div></td>
    <td width="15%"><div align="center"><%
	if DESCORASC="WS_statetime desc" then
	  response.Write "<a style='cursor:hand;' onclick=""location.href='bargainmanage.asp?DESCORASC=WS_statetime asc';""><img src='../hximages/down.gif' align=absmiddle>"
	elseif DESCORASC="WS_statetime asc" then
	 response.Write "<a style='cursor:hand;' onclick=""location.href='bargainmanage.asp?DESCORASC=WS_statetime desc';""><img src='../hximages/up.gif' align=absmiddle>"
	else
	 response.Write "<a style='cursor:hand;' onclick=""location.href='bargainmanage.asp?DESCORASC=WS_statetime desc';"">"
	end if 
	%>开始日期</div></td>
    <td width="15%"><div align="center"><%
	if DESCORASC="WS_overtime desc" then
	  response.Write "<a style='cursor:hand;' onclick=""location.href='bargainmanage.asp?DESCORASC=WS_overtime asc';""><img src='../hximages/down.gif' align=absmiddle>"
	elseif DESCORASC="WS_overtime asc" then
	 response.Write "<a style='cursor:hand;' onclick=""location.href='bargainmanage.asp?DESCORASC=WS_overtime desc';""><img src='../hximages/up.gif' align=absmiddle>"
	else
	 response.Write "<a style='cursor:hand;' onclick=""location.href='bargainmanage.asp?DESCORASC=WS_overtime desc';"">"
	end if 
	%>结束日期</div></td>
    <td width="15%"><div align="center"><%
	if DESCORASC="WS_register desc" then
	  response.Write "<a style='cursor:hand;' onclick=""location.href='bargainmanage.asp?DESCORASC=WS_register asc';""><img src='../hximages/down.gif' align=absmiddle>"
	elseif DESCORASC="WS_register asc" then
	 response.Write "<a style='cursor:hand;' onclick=""location.href='bargainmanage.asp?DESCORASC=WS_register desc';""><img src='../hximages/up.gif' align=absmiddle>"
	else
	 response.Write "<a style='cursor:hand;' onclick=""location.href='bargainmanage.asp?DESCORASC=WS_register desc';"">"	
	end if 
	%>签订时间</div></td>
    <td width="6%"> <div align="center">附件</div></td>
    <td width="19%"><div align="center">操作</div></td>
  </tr>
  <%
	rs.PageSize =15 '每页记录条数
	iCount=rs.RecordCount '记录总数
	iPageSize=rs.PageSize
    	maxpage=rs.PageCount 
    	page=request("page")
    
    if Not IsNumeric(page) or page="" then
        page=1
    else
        page=cint(page)
    end if
    
    if page<1 then
        page=1
    elseif  page>maxpage then
        page=maxpage
    end if
    
    rs.AbsolutePage=Page

	if page=maxpage then
		x=iCount-(maxpage-1)*iPageSize
	else
		x=iPageSize
	end if
	ii=0
	do while not rs.EOF
		                %>
  <tr <%if ii mod 2 =0 then response.write "bgcolor='#FFFBE8'" else response.write "bgcolor='#FFFBE8'"%>>
    <td height="25"><%=rs("WS_id")%></td>
    <td><%set urs=WS_S.HX_SetRSD("","HX_CompanyUser"," where WS_Uid="&rs("WS_Uid")):if urs.recordcount>0 then response.Write "<a style='cursor:hand;' onclick=""openwin(680,600,'../HXManpowerResource/userinfolook.asp?WS_Uid="&urs("WS_Uid")&"')"">&nbsp;"&urs("WS_name")&"</a>" else response.Write "无"%></td>
    <td><%set bars=WS_S.HX_SetRSD("","HX_bargaintype"," where WS_Tid="&rs("WS_state")):if bars.recordcount>0 then  response.Write bars("WS_bargaintypename")%></td>
    <td><%if rs("WS_statetime")<date then 
	        response.write WS_S.FormatColor(WS_S.Format_time(rs("WS_statetime"),5),"red")
		  elseif rs("WS_statetime")=date then 
	        response.write WS_S.FormatColor(WS_S.Format_time(rs("WS_statetime"),5),"#613c25")
		  else
		    response.write WS_S.FormatColor(WS_S.Format_time(rs("WS_statetime"),5),"blue")
		  end if
		  %></td>
    <td><%if rs("WS_overtime")<date then 
	        response.write WS_S.FormatColor(WS_S.Format_time(rs("WS_overtime"),5),"red")
		  elseif rs("WS_overtime")<date then
		    response.write WS_S.FormatColor(WS_S.Format_time(rs("WS_overtime"),5),"#613c25")
		  else
		    response.write WS_S.FormatColor(WS_S.Format_time(rs("WS_overtime"),5),"blue")
		  end if%></td>
    <td><%if rs("WS_register")<date then 
	        response.write WS_S.FormatColor(WS_S.Format_time(rs("WS_register"),5),"red")
		  elseif rs("WS_register")=date then 
	        response.write WS_S.FormatColor(WS_S.Format_time(rs("WS_register"),5),"#613c25")
		  else
		    response.write WS_S.FormatColor(WS_S.Format_time(rs("WS_register"),5),"blue")
		  end if%></td>
    <td><%
							if rs("WS_Annex")<>"" then
							 response.write "<a href='../HXManpowerResource/"&rs("WS_Annex")&"' target='_blank'><font color=blue>下载</font></a>"
							else
							 response.write "无"
						    end if
							%></td>
    <td><input name="edit" type="button" value="修改" onClick="javascript:location.href='bargainmanage.asp?action=edit&WS_id=<%=rs("WS_id")%>';">
	<input name="view" type="button" value="查看" onclick="javascript:location.href='bargainmanage.asp?action=view&WS_id=<%=rs("WS_id")%>';">
      <input name="delete" type="button" value="删除" onclick="javascript:location.href='bargainmanage.asp?action=del&WS_id=<%=rs("WS_id")%>';">
	</td>
  </tr>
  <%ii=ii+1
	  if ii>=rs.PageSize then Exit Do
	  rs.movenext
      loop
      call WS_S.PageControl(iCount,maxpage,page,"border=0 align=right","<p align=right>",8)%>
</table>
                              </td>
              </tr>
						  
                          <tr bgcolor="#FFFBE8"> 
                            <td height="2" align=right><input type="button" name="WS_Submit2" value=" 返 回 " onclick="javascript:history.go(-1);">
						    <input type="button" name="WS_Submit2" value=" 打 印 " onclick="javascript:print();">						    </td>
                          </tr><%end if
						  end select
						  %>
                      </table>                    </td>       
                </tr>  
      </table></td>
  </tr>
</table>

