<!--#include file="conn/conn_index.asp"-->
<!--#include file="inc/setup.asp"-->
<!--#include file="inc/char.asp"-->
<!--#include file="inc/sql.asp"-->
<%
	end if
%>
<HTML>
<HEAD>
<link rel="Shortcut Icon" href="Images/favicon.ico">
<link rel="Bookmark" href="Images/favicon.ico">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<TITLE><%= homename %>--培训教育</TITLE>
<meta name="Keywords" content="<%= webmeta %>">
<meta name="Description" content="<%= webmeta1 %>">
<link href="css/train.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
 function login_check(){
 if (document.login.uname.value==""){
  alert("-请输入用户名-");
  document.login.uname.focus();
  return false;
 }
  if (document.login.pwd.value==""){
  alert("-请输入登陆密码-");
  document.login.pwd.focus();
  return false;
 }
  if (document.login.CheckCode.value==""){
  alert("-请输入登陆密码-");
  document.login.CheckCode.focus();
  return false;
 }
}
function search(){     
    if(document.searcher.keyword.value==null || document.searcher.keyword.value==""){
      alert("请输入课程关键字");
      document.searcher.keyword.focus();
      return false;
    }
}
</script>
</HEAD>
<BODY topMargin=0 leftmargin="0" rightmargin="0">
<!--#include file="top.asp"-->
<table width="977" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="8"></td>
  </tr>
</table>
<table width="974" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="789" valign="top">
<table width="99%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="46%" valign="top">
<table width="99%" border="0" cellpadding="0" cellspacing="0" background="images/train/ss_1333.gif" class="qianlanbk">
              <tr> 
                <td width="28%" height="28" background="images/train/ss_03.gif"><table width="94%" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr> 
                      <td height="4"></td>
                    </tr>
                    <tr> 
                      <td><div align="center"><font color="#000099">课程搜索</font></div></td>
                    </tr>
                  </table></td>
                <td width="0%"><img src="images/train/ss_05.gif" width="20" height="28" alt=""></td>
                <td width="72%" background="images/train/ss_06.gif">&nbsp;</td>
              </tr>
            <tr> 
                <td height="115" colspan="3"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class=normal>
                        <form name="searcher"  action="train_subject_list.asp" method="get" onSubmit="return search()">
                        <input name="action" type="hidden" value="search">
                          <tr>
                            <td width="20%" height="24" valign="middle"><div align="right"><font color="#666666"><span class="text12"></span></font>类　别:</div></td>
                            <td width="30%" valign="middle"><select name="jobtype" class="option" id="jobtype"  style="width:100px">
                                <option value="" selected>所有类别</option>
<%
	type_id=int(Trim(Request.QueryString("type_id")))
	set rs=server.createobject("adodb.recordset")
	sql="select * from train_subject_type where mid=0 order by stime desc"
	rs.open sql,conn,1,1
	do while not rs.eof
	if type_id=int(rs("id")) then
		response.write"<OPTION value="&rs("id")&" selected>"&rs("type_name")&"</option>"
	else
		response.write"<OPTION value="&rs("id")&">"&rs("type_name")&"</option>"
	end if
	rs.movenext
	loop
	rs.close
	set rs=nothing
%>
                            </select></td>
                            <td width="20%" align="right" valign="middle">发布日期:</td>
                            <td width="30%" valign="middle"><select name="pubTime" size="1" style="width:84px">
                              <option value="0" <% If Trim(Request.QueryString("pubTime"))=0 Then Response.Write("selected")%>>不限时间</option>
                              <option value="1" <% If Trim(Request.QueryString("pubTime"))=1 Then Response.Write("selected")%>>一天内</option>
                              <option value="3" <% If Trim(Request.QueryString("pubTime"))=3 Then Response.Write("selected")%>>三天内</option>
                              <option value="7" <% If Trim(Request.QueryString("pubTime"))=7 Then Response.Write("selected")%>>一周内</option>
                              <option value="15" <% If Trim(Request.QueryString("pubTime"))=15 Then Response.Write("selected")%>>半月内</option>
                              <option value="30" <% If Trim(Request.QueryString("pubTime"))=30 Then Response.Write("selected")%>>一个月内</option>
                              <option value="90" <% If Trim(Request.QueryString("pubTime"))=90 Then Response.Write("selected")%>>三个月内</option>
                              <option value="180" <% If Trim(Request.QueryString("pubTime"))=180 Then Response.Write("selected")%>>半年内</option>
                            </select></td>
                          </tr>
                          <tr>
                            <td height="30"><div align="right">关键字:</div></td>
                            <td width="65%" height="30" colspan="3"><input name="otherKey" value="<% If Trim(Request.QueryString("otherKey"))<>"" Then Response.Write(Trim(Request.QueryString("otherKey"))) else Response.Write("课程关键字")%>" class="input01"  style=" WIDTH: 257px" onClick="this.value=''" ></td>
                          </tr>
                          <tr valign="bottom">
                            <td height="29" colspan=4 align=center><input type="image" src="images/train/bu_7.gif" alt="搜索课程" border="0"></td>
                          </tr>
                        </form>
                </table></td>
              </tr>
            </table></td>
          <td width="54%" valign="top"><table width='99%' border='0' align='right' cellpadding='0' cellspacing='0' class='qianlanbk'>
            <tr>
              <td valign='top'><table width='99%' border='0' cellspacing='0' cellpadding='0' height="143">
                  <tr>
                    <td height='38' background='images/train/zhiweilb_03.gif'><table width='90%' border='0' align='center' cellpadding='0' cellspacing='0'>
                        <tr>
                          <td><img src='images/train/zhiweilb_06.gif' width='173' height='16' alt=''></td>
                          <td><div align='right'><a href='train_subject_list.asp?action=vip' class='lianjie'><font color='#FF6600'>&gt;&gt;更多推荐课程</font></a></div></td>
                        </tr>
                    </table></td>
                  </tr>
                  <tr>
                    <td valign='top'><table width='100%' border='0' cellspacing='0' cellpadding='0'>
<%
	set rs=server.createobject("adodb.recordset")
	sql="select top 4 * from train_subject order by refresh desc,id desc"
	rs.open sql,conn,1,1
	snum=rs.recordcount
	if snum="" then snum=0
	i=0
	if rs.eof then
%>
		<tr><td valign="top" align="center">&nbsp;</td></tr>
		<tr><td valign="top" align="center">还没有推荐的培训课程</td></tr>
<%
	else
	do while not rs.eof
	i=i+1
	if i=1 or i=3 then Response.Write("<tr>")
%>
      <td width='6%' height='24' <% If i<=2 Then Response.Write("bgcolor='#EDF3FF'")%>>&nbsp;</td>
      <td width='43%' <% If i<=2 Then Response.Write("bgcolor='#EDF3FF'")%>>·<A class=lianjie  href='html/train/<%= Rs("tid") %>/<%= Rs("id") %>.html' target=_blank><%= rs("tsname") %></A></td>
<% If i=1 or i=3 Then Response.Write("<td width='1%'>&nbsp;</td>")%>
<%
	if i=2 or id=4 then Response.Write("</tr>")
	if i=4 then i=0
	rs.movenext
	loop
	end if
	rs.close
	set rs=nothing
	for i=1 to 4-snum
%>
<tr><td height="24" align="center">&nbsp;</td></tr>
<%
	next
%>
                    </table></td>
                  </tr>
              </table></td>
            </tr>
          </table></td>
        </tr>
      </table></td>
    <td width="191" valign="top"><!--#include file="ads/js/ads76.asp"--></td>
  </tr>
</table>
<table width="974" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="13"></td>
  </tr>
</table>
<table width="974" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="787" valign="top">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr > 
          <td valign="top">
           <table width="99%" border="0" align="left" cellpadding="0" cellspacing="0" bgcolor="#F5F8FF" class="qianlanbk">
              <tr height="30" valign="top"> 
                <td>
					<table width='95%' border='0' align='center' cellpadding='0' cellspacing='0'>
                    	<tr>
                        	<td height='4'></td>
                        </tr>
                        <tr>
                        	<td><img src='images/train/zhiweilb_14.gif' width='185' height='17' alt=''></td>
                        </tr>
                  </table>
				</td>
             </tr>
         <tr> 
          <td valign="top" height="530">
            <table width='100%' border='0' cellspacing='2' cellpadding='0'>
              <tr bgcolor='#E7F3FC' height="25">
                <td width='22%' height='22'> <div align='center'><font color='#000099'>课程名称</font></div></td>
                <td width='21%'><div align='center'><font color='#000099'>机构名称</font></div></td>
                <td width='17%'><div align='center'><font color='#000099'>有效期</font></div></td>
                <td width='14%'><div align='center'><font color='#000099'>课程类别</font></div></td>
                <td width='16%'><div align='center'><font color='#000099'>上课区域</font></div></td>
                <td width='10%'><div align='center'><font color='#000099'>发布时间</font></div></td>
              </tr>
<%
	
	jobtype=ReplaceBadChar(int(Trim(Request("jobtype"))))		 	'类型
	pubTime=ReplaceBadChar(int(Trim(Request("pubTime"))))		    '时间段
	otherKey=ReplaceBadChar(Trim(Request("otherKey")))			'关键字
	
	if otherKey="" then otherKey="abc"
	
	dim i,intPage,page,pre,last,filepath,searchtype '定义变量
	set rs_user = server.CreateObject("adodb.recordset")'创建对象
	
	searchtype="where train_subject.zhuangtai=1 and train_subject.hidesubject=0 and train_subject.tid=train.id and train_subject.type_max=train_subject_type.id and train.zhuangtai=1 and train.hideuser=0 "
	
	if Trim(Request.QueryString("action"))="search" then
	
		if jobtype<>0 then searchtype=searchtype&"and train_subject.type_max="&jobtype&" "
		
		if pubTime<>0 then searchtype=searchtype&"and datediff(dd,train_subject.setup,getdate())<"&pubTime&" "
		
		if otherKey<>"abc" and otherKey<>"课程关键字" then searchtype=searchtype&"and train_subject.tsname like '%"&otherKey&"%' "
	
	elseif Trim(Request.QueryString("action"))="vip" then
	
		searchtype=searchtype&"and train_subject.grade=1 "
	
	else
	
		jobtype=int(Trim(Request.QueryString("type_id")))
		if jobtype<>0 then searchtype=searchtype&"and train_subject.type_max="&jobtype&" "
	
	end if
	
	sql="select train_subject.*,train.train_name,train_subject_type.type_name from train_subject,train,train_subject_type "&searchtype&" order by train_subject.refresh desc,train_subject.id desc"'定义SQL语句
	rs_user.PageSize = 12 '这里设定每页显示的记录数
	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
%>
              <tr>
                 <td class='baibian' colspan="6" align="center" height="150">暂时还没有该类别的课程信息</td>
               </tr>
<%
	else
		for i=1 to rs_user.PageSize
		if rs_user.EOF or rs_user.BOF then exit for
		shengid=rs_user("province")
		cityid=rs_user("city")
%>
<!--#include file="inc/cityname.asp"-->
<!--#include file="inc/shengname.asp"-->
              <tr>
                  <td height='35' class='baibian'>&nbsp;&nbsp;<a href="html/train/<%= rs_user("tid") %>/<%= rs_user("id") %>.html" target="_blank" class='lianjie'><%= left(rs_user("tsname"),8) %>...</a><% If rs_user("grade")=1 Then Response.Write("<font color='red'>(推荐)</font>")%></td>
                  <td class='baibian'>&nbsp;&nbsp;<a href="html/train/<%= rs_user("tid") %>/index.html" target="_blank" class='lianjie'>&nbsp;&nbsp;<%= left(rs_user("train_name"),12) %></a></td>
                  <td class='baibian' align=center><%= rs_user("lasttime") %></td>
                  <td class='baibian' align=center><%= rs_user("type_name") %></td>
                  <td class='baibian' align=center><%= shengname %>--<%= cityname %></td>
                  <td align=center><%= year(rs_user("refresh")) %>-<%= month(rs_user("refresh")) %>-<%= day(rs_user("refresh")) %></td>
               </tr>
<%
		rs_user.movenext
		next
	end if
%>
              <tr>
                  <td height='35' class='baibian' colspan="6"><table width="99%" border="0" 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=search&jobtype=<%=jobtype%>&pubTime=<%= pubTime %>&otherKey=<%= otherKey %>">首页</a>|
<%if pre then%>
<a href="?page=<%=intpage -1%>&action=search&jobtype=<%=jobtype%>&pubTime=<%= pubTime %>&otherKey=<%= otherKey %>">上页</a>| <%end if%>
<%if last then%>
<a href="?page=<%=intpage +1%>&action=search&jobtype=<%=jobtype%>&pubTime=<%= pubTime %>&otherKey=<%= otherKey %>">下页</a> |<%end if%>
<a href="?page=<%=rs_user.PageCount%>&action=search&jobtype=<%=jobtype%>&pubTime=<%= pubTime %>&otherKey=<%= otherKey %>">尾页</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=search&jobtype=<%=jobtype%>&pubTime=<%= pubTime %>&otherKey=<%= otherKey %>" selected><%=i%></option>
<%else%> 
<option value="?page=<%=i%>&action=search&jobtype=<%=jobtype%>&pubTime=<%= pubTime %>&otherKey=<%= otherKey %>"><%=i%></option>
<%
	end if
	next
	rs_user.close
	set rs_user=nothing
%>
</select>页</font></td>
</tr>
</table></td>
              </tr>
             </table>
            </td>
          </tr>
         </table></td>
        </tr>
      </table></td>
    <td width="193" valign="top"><table width="98%" border="0" align="right" cellpadding="0" cellspacing="0">
        <tr> 
          <td height="94"><!--#include file="ads/js/ads77.asp"--></td>
        </tr>
        <tr> 
          <td height="94"><!--#include file="ads/js/ads78.asp"--></td>
        </tr>
        <tr> 
          <td height="94"><!--#include file="ads/js/ads79.asp"--></td>
        </tr>
        <tr> 
          <td height="94"><!--#include file="ads/js/ads80.asp"--></td>
        </tr>
        <tr> 
          <td height="94"><!--#include file="ads/js/ads81.asp"--></td>
        </tr>
        <tr> 
          <td height="94"><!--#include file="ads/js/ads81.asp"--></td>
        </tr>
      </table></td>
  </tr>
</table>
<!--#include file="end.asp"-->