<!--#include file="conn.asp"-->
<!--#include file="check.asp"-->
<%
	useflag=3
%>
<!--#include file="flag.asp"-->
<!--#include file="../inc/setup.asp"-->
<!--#include file="../inc/sql.asp"-->
<%
	end if
	action=Trim(Request.QueryString("action"))
	id=Trim(Request.Form("id"))
	if action="del" then
		if id="" then
			response.write"<script language=JavaScript>alert('参数为空，请选择您要删除的收藏夹信息');"    
			response.write"this.location.href='pfavorite.asp';</script>"
		end if
		sql="delete from pfavorite where id in("&id&")"
		conn.Execute sql
		response.write"<script language=JavaScript>alert('用户收藏夹信息删除成功！');"    
		response.write"this.location.href='pfavorite.asp';</script>"
		response.End
	end if
	
	if action="delall" then
		sql="delete from pfavorite"
		conn.Execute sql
		response.write"<script language=JavaScript>alert('用户删除成功！');"    
		response.write"this.location.href='pfavorite.asp';</script>"
		response.End
	end if
%>
<script src='Include/Common.js'></script>
<link href='Include/Admin_Style.CSS' rel='stylesheet' type='text/css'>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="sortbutton">
<tr>    
<td width="23%" height="23" align="center" valign="middle">个人收藏夹管理
<td width="77%" align="center" valign="middle">
<table width="100%" border="0">
<form name="form2" method="get">
<input name="action" type="hidden" value="search" />
        <tr>
          <td width="19%"><input type="text" name="uname" value="输入要查询的用户名" onMouseOver="if(this.value=='输入要查询的用户名'){this.value=''}" title="输入要查询的用户名">
          </td>
          <td width="63%"><input class="button" type="submit" value="提交条件"></td>
        </tr>
		</form>
</table>
</tr>
</table>
<table width="100%" style="MARGIN-TOP: 3px" border="0" align="center" cellspacing="1" cellpadding="1"  class="Border">
<tr height="25" align="center" class='title'>
	<td width='5%' nowrap>选择</th>
	<td width="13%" nowrap>收藏编号</th>
	<td width="25%" nowrap>收藏者用户名</th>
	<td width="14%" nowrap>收藏职位的ID号
	<td width="19%" nowrap>收藏的职位名称</th>
  <td width="24%" nowrap>收藏时间</th>	
</tr>

<form name="selform" method="post" action="?action=del">
<%
	searchtype=""
	
	if Trim(Request.QueryString("action"))="search" then
	uname=int(Trim(Request.QueryString("uname")))
	
	searchtype="where uname like '%"&uname&"%'"
	
	end if

	dim i,intPage,page,pre,last,filepath'定义变量
	set rs_user = server.CreateObject("adodb.recordset")'创建对象
	sql="select * from pfavorite "&searchtype&" order by id desc"'定义SQL语句
	rs_user.PageSize = 14 '这里设定每页显示的记录数
	rs_user.CursorLocation = 3
	rs_user.Open sql,conn,0,2,1 '这里执行你查询SQL并获得结果记录集
	pre = true
	last = true
	page = trim(Request.QueryString("page"))'变量是跳转页面时的值

	if len(page) = 0 then
		intpage = 1
		pre = false
	else
		if cint(page) =< 1 then
			intpage = 1
			pre = false
		else
			if cint(page) >= rs_user.PageCount then
				intpage = rs_user.PageCount
				last = false
			else
				intpage = cint(page)
			end if
		end if
	end if
	if not rs_user.eof then
		rs_user.AbsolutePage = intpage
	end if
	if rs_user.eof then
		response.Write "<tr><td colspan=6><div align=center><font size=3 color=red><b>没有收藏夹资料，请查询后再重试</b></font></div></td></tr>"
		response.End
	else
	for i=1 to rs_user.PageSize
	if rs_user.EOF or rs_user.BOF then exit for
	jobid=int(rs_user("fuid"))
	set rs1 = server.CreateObject("adodb.recordset")			'创建对象
	sql1="select * from zp where id="&jobid&""
	rs1.Open sql1,conn,1,1
	jtzw=int(rs1("jtzw"))
	rs1.close
	set rs1=nothing
	jobnameid=jtzw
%>
<!--#include file="../inc/jobname.asp"-->
<tr height="25" align=center class='tdbg' onMouseOver="this.className='tdbgmouseover'" onMouseOut="this.className='tdbg'">
	<td><input type="checkbox" name="id" value="<%= rs_user("id") %>"></td>
	<td><%= rs_user("id") %></td>
	<td><%=rs_user("uname")%></td>
	<td><%=rs_user("fuid")%></td>
	<td><%=jobname%></td>
	<td><%=rs_user("time")%></td>
	</tr>
<%
	rs_user.movenext
	next
	End If
%>
<table width="96%" border="0" align="center" cellpadding="2" cellspacing="2" borderColorLight=#808080 borderColorDark=#ffffff>
<tr>
<%if rs_user.pagecount > 0 then%>
<td width="13%" align="left">当前页<%=intpage%>/<%=rs_user.PageCount%></td>
<%else%>
<td width="41%" align="left">当前页0/0</td><%end if%>
<td width="46%" align="right"> <a href="?page=1&action=<%= Trim(Request.QueryString("action")) %>&Keyword=<%= Trim(Request.QueryString("Keyword")) %>">首页</a>|
<%if pre then%>
<a href="?page=<%=intpage -1%>&action=<%= Trim(Request.QueryString("action")) %>&Keyword=<%= Trim(Request.QueryString("Keyword")) %>">上页</a>| <%end if%>
<%if last then%>
<a href="?page=<%=intpage +1%>&action=<%= Trim(Request.QueryString("action")) %>&Keyword=<%= Trim(Request.QueryString("Keyword")) %>">下页</a> |<%end if%>
<a href="?page=<%=rs_user.PageCount%>&action=<%= Trim(Request.QueryString("action")) %>&Keyword=<%= Trim(Request.QueryString("Keyword")) %>">尾页</a>|转到第
<select name="sel_page" onchange=javascript:location.href=this.options[this.selectedIndex].value>
<%
	for i = 1 to rs_user.PageCount
	if i = intpage then
%>
<option value="?page=<%=i%>&action=<%= Trim(Request.QueryString("action")) %>&Keyword=<%= Trim(Request.QueryString("Keyword")) %>" selected><%=i%></option>
<%else%> 
<option value="?page=<%=i%>&action=<%= Trim(Request.QueryString("action")) %>&Keyword=<%= Trim(Request.QueryString("Keyword")) %>"><%=i%></option>
<%
	end if
	next
	rs_user.close
	set rs_user=nothing
%>
</select>页</font></td>
</tr>
</table>
<tr>
	<td  class='tdbg' onMouseOver="this.className='tdbgmouseover'" onMouseOut="this.className='tdbg'" height='25' colspan=6>
	&nbsp;&nbsp;<input id="chkAll" onClick="CheckAll(this.form)" type="checkbox" value="checkbox"  name="chkAll">全选
	<input class=Button type="submit" name="Submit2" value=" 删 除 " onclick="{if(confirm('您确定要删除此收藏夹资料吗?')){this.document.selform.submit();return true;}return false;}">
	<input class=Button type="button" name="Submit3" value="清空所有收藏夹资料" onclick="{if(confirm('您确定要清空所有收藏夹资料吗?')){location.href='?action=delall';return true;}return false;}"></td>
</tr>
</form>
<tr>
	<td  class='tdbg' onMouseOver="this.className='tdbgmouseover'" onMouseOut="this.className='tdbg'" colspan=6 align=right>	</td>
</tr>
</table>

