<%
function jobList()
Dim str,rs,sql,StringText
Dim idCount
    Dim pages
    pages = JobInfo
    Dim pagec
    Dim page
    page = CLng(request("Page"))
    Dim pagenc
    pagenc = 5
    Dim pagenmax
    Dim pagenmin
    Dim pageprevious
    Dim pagenext
    'datafrom = ""&Datapre&"_Jobs"
    Dim datawhere
    datawhere = "where ViewFlag "
    Dim sqlid
    Dim Myself, PATH_INFO, QUERY_STRING
    PATH_INFO = request.servervariables("PATH_INFO")
    QUERY_STRING = request.ServerVariables("QUERY_STRING")
    If QUERY_STRING = "" Then
        Myself = PATH_INFO & "?"
    ElseIf InStr(PATH_INFO & "?" & QUERY_STRING, "Page=") = 0 Then
        Myself = PATH_INFO & "?" & QUERY_STRING & "&"
    Else
        Myself = Left(PATH_INFO & "?" & QUERY_STRING, InStr(PATH_INFO & "?" & QUERY_STRING, "Page=") -1)
    End If
    Dim taxis
    taxis = "order by id desc "
    Dim i
    sql = "select count(ID) as idCount from ["&Datapre&"_Jobs]" & datawhere
    Set rs = db(sql,4)
    idCount = rs("idCount")
    If(idcount>0) Then
    If(idcount Mod pages = 0)Then
    pagec = Int(idcount / pages)
Else
    pagec = Int(idcount / pages) + 1
End If
sql = "select id from ["&Datapre&"_Jobs] " & datawhere & taxis
Set rs = db(sql,2)
rs.pagesize = pages
If page < 1 Then page = 1
If page > pagec Then page = pagec
If pagec > 0 Then rs.absolutepage = page
For i = 1 To rs.pagesize
    If rs.EOF Then Exit For
    If(i = 1)Then
    sqlid = rs("id")
Else
    sqlid = sqlid &","&rs("id")
End If
rs.movenext
Next
End If
If(idcount>0 And sqlid<>"") Then
sql = "select ID,JobName,UpdateTime from ["&Datapre&"_Jobs] where id in("& sqlid &") "&taxis
Set rs = db(sql,4)
StringText=StringText&"<table border=""0"" align=""center"">"
Dim AutoLink,ij
ij=0
While Not rs.EOF
    if IsHtml=1 then
AutoLink=""&JobNameDiy&""&Separated&""&rs("ID")&"."&HTMLName&""
else
AutoLink="JobsView.asp?ID="&rs("ID")&""
end if
	if ij mod 2=0 and ij<idcount then StringText=StringText&"<tr>"
StringText=StringText&"<td class=""time-list"" width=15% nowrap align=right><span>"&FormatDate(rs("UpdateTime"),13)&"</span>&nbsp;</td><td width=34% style='overflow:hidden;'><a href="""&AutoLink&""" title="""&rs("JobName")&""">"&rs("JobName")&"</a></td>"
ij=ij+1
if ij mod 2=0 then 
StringText=StringText&"</tr>"&vbCrLf
else
	if ij>=idcount then StringText=StringText&"</tr>"&vbCrLf
end if
    rs.movenext
Wend
StringText=StringText&"</table>"&vbCrLf
Else
StringText=StringText&"<center>暂无相关信息</center>"
    Exit Function
End If

StringText=StringText&"<div class=""page_list"">"&vbcrlf
StringText=StringText&"<div class=""list_info"">共"&idcount&"条&nbsp;&nbsp;"&pages&"/页&nbsp;&nbsp;<span class=""disabled"">&nbsp;"&vbcrlf

pagenmin = page - pagenc
pagenmax = page+pagenc
If(pagenmin<1) Then pagenmin = 1
If ISHTML = 1 Then
    'If ID = "" Then
        If(page>1) Then StringText=StringText&"<span><a href="""&JobSortName&""&Separated&"1."&HTMLName&""" title=""回到第一页"">&nbsp;&lt;&lt;&nbsp;</a></span>"
    'Else
     '   If(page>1) Then StringText=StringText&"<span><a href="""&JobSortName&""&Separated&""&ID&""&Separated&"1."&HTMLName&""" title=""回到第一页"">&nbsp;&lt;&lt;&nbsp;</a></span> "
    'End If
Else
    If(page>1) Then StringText=StringText&"<span><a href="""& myself &"Page=1"" title=""回到第一页"">&nbsp;&lt;&lt;&nbsp;</a> </span>"
End If
If page - (pagenc * 2 + 1)<= 0 Then
    pageprevious = 1
Else
    pageprevious = page - (pagenc * 2 + 1)
End If
If ISHTML = 1 Then
    'If ID = "" Then
        If(pagenmin>1) Then StringText=StringText&"<span><a href="""&JobSortName&""&Separated&""&pageprevious&"."&HTMLName&""" title=""第"& pageprevious &"页"">&nbsp;&lt;&nbsp;</a></span>"
    'Else
        'If(pagenmin>1) Then StringText=StringText&"<span><a href="""&JobSortName&""&Separated&""&ID&""&Separated&""&pageprevious&"."&HTMLName&""" title=""第"& pageprevious &"页"">&nbsp;&lt;&lt;&nbsp;</a></span>"
    'End If
Else
    If(pagenmin>1) Then StringText=StringText&"<a href="""& myself &"Page="& pageprevious &""" title=""第"& pageprevious &"页"">&nbsp;&lt;&lt;&nbsp;</a> "
End If
If(pagenmax>pagec) Then pagenmax = pagec
For i = pagenmin To pagenmax
    If(i = page) Then
    StringText=StringText&"&nbsp;<span class=""current"">"& i &"</span>&nbsp;"
Else
    If ISHTML = 1 Then
        If ID = "" Then
           StringText=StringText&"<a href="""&JobSortName&""&Separated&""&i&"."&HTMLName&""">"& i &"</a>"
        Else
           StringText=StringText&"<a href="""&JobSortName&""&Separated&""&ID&""&Separated&""&i&"."&HTMLName&""">"& i &"</a>"
        End If
    Else
       StringText=StringText&"<a href="""& myself &"Page="&i&""">"& i &"</a>"
    End If
End If
Next
If page+(pagenc * 2 + 1)>= pagec Then
    pagenext = pagec
Else
    pagenext = page+(pagenc * 2 + 1)
End If
If ISHTML = 1 Then
    'If ID = "" Then
        If(pagenmax<pagec) Then StringText=StringText&" <a href="""&JobSortName&""&Separated&""&pagenext&"."&HTMLName&""" title=""跳转到第"&pagenext&"页"">&nbsp;&gt;&gt;&nbsp;</a> "
       ' If(page<pagec) Then StringText=StringText&" <a href="""&JobSortName&""&Separated&""&pagec&"."&HTMLName&""" title=""跳转到第"&pagec&"页"">&nbsp;&gt;&gt;&nbsp;</a>"
    'Else
        'If(pagenmax<pagec) Then StringText=StringText&" <a href="""&JobSortName&""&Separated&""&ID&""&Separated&""&pagenext&"."&HTMLName&""" title=""跳转到第"&pagenext&"页"">&nbsp;&gt;&gt;&nbsp;</a> "
        'If(page<pagec) Then StringText=StringText&" <a href="""&JobSortName&""&Separated&""&ID&""&Separated&""&pagec&"."&HTMLName&""" title=""跳转到第"&pagec&"页"">&nbsp;&gt;&gt;&nbsp;</a>"
   ' End If
Else
    If(pagenmax<pagec) Then StringText=StringText&" <a href="""& myself &"Page="& pagenext &""" title=""跳转到第"&pagenext&"页"">&nbsp;&gt;&gt;&nbsp;</a> "
    If(page<pagec) Then StringText=StringText&" <a href="""& myself &"Page="& pagec &""" title=""跳转到第"&pagec&"页"">&nbsp;&gt;&gt;&nbsp;</a>"
End If
rs.Close
Set rs = Nothing
StringText=StringText&"</div></div>"&vbCrLf
jobList=StringText
end function


Function WebContentJobView(DataFrom, ID)
Dim StringText
StringText=""
    If ID = "" Or Not IsNumeric(ID) Then
StringText=StringText&" <div class=""Bodyer_right_page_content"">信息ID读取错误</div>"
    ElseIf conn.Execute("select ID from ["&Datapre&"_"&DataFrom&"] Where ViewFlag and  ID="&ID).EOF Then
StringText=StringText&" <div class=""Bodyer_right_page_content"">信息ID读取错误</div>"
    Else
        Dim rs, sql
        
        sql = "select * from ["&Datapre&"_"&DataFrom&"] where ViewFlag and ID="&ID
        set rs=db(sql,3)
StringText=StringText&" <table width=""95%"" border=""1"" align=""center"" cellpadding=""7"" cellspacing=""0"" bordercolor=""#D5D3D4"" style=""border-collapse:collapse"">"&vbCrLf
StringText=StringText&" <tr height=""25"">"&vbCrLf
StringText=StringText&"   <td width=""15%"" align=""right"">工作地点：</td>"&vbCrLf
StringText=StringText&"   <td width=""35%"" align=""left"">&nbsp;"&rs("JobAddress")&"</td>"&vbCrLf
StringText=StringText&"   <td width=""15%"" align=""right"">招聘人数：</td>"&vbCrLf
StringText=StringText&"    <td width=""35%"">&nbsp;"&rs("JobNumber")&"人</td>"&vbCrLf
StringText=StringText&"  </tr>"&vbCrLf
StringText=StringText&"  <tr bgcolor=""#F7F7F7"" height=""25"">"&vbCrLf
StringText=StringText&"   <td width=""15%"" align=""right"">薪酬待遇：</td>"&vbCrLf
StringText=StringText&"    <td width=""35%"" align=""left"">&nbsp;"&rs("Emolument")&"</td>"&vbCrLf
StringText=StringText&"    <td width=""15%"" align=""right"">有效时间：</td>"&vbCrLf
StringText=StringText&"   <td width=""35%"">&nbsp;"&FormatDate(rs("StartDate"), 13)&" 至 "&FormatDate(rs("EndDate"), 13)&"</td>"&vbCrLf
StringText=StringText&" </tr>"&vbCrLf
StringText=StringText&" <tr height=""25"">"&vbCrLf
StringText=StringText&"   <td width=""15%"" align=""right"">招聘单位：</td>"&vbCrLf
StringText=StringText&"    <td width=""35%"" align=""left"">&nbsp;"&rs("eEmployer")&"</td>"&vbCrLf
StringText=StringText&"   <td width=""15%"" align=""right"">联 系 人：</td>"&vbCrLf
StringText=StringText&"    <td width=""35%"">&nbsp;"&rs("eContact")&"</td>"&vbCrLf
StringText=StringText&"  </tr>"&vbCrLf
StringText=StringText&"  <tr bgcolor=""#F7F7F7"" height=""25"">"&vbCrLf
StringText=StringText&"    <td nowrap width=""15%"" align=""right"">联系电话：</td>"&vbCrLf
StringText=StringText&"    <td width=""35%"" align=""left"">&nbsp;"&rs("eTel")&"</td>"&vbCrLf
StringText=StringText&"    <td width=""15%"" align=""right"">详细地址：</td>"&vbCrLf
StringText=StringText&"    <td width=""35%"">&nbsp;"&rs("eAddress")&"</td>"&vbCrLf
StringText=StringText&"  </tr>"&vbCrLf
StringText=StringText&"  <tr height=""25"">"&vbCrLf
StringText=StringText&"    <td width=""15%"" align=""right"">邮政编码：</td>"&vbCrLf
StringText=StringText&"    <td width=""35%"" align=""left"">&nbsp;"&rs("ePostCode")&"</td>"&vbCrLf
StringText=StringText&"    <td width=""15%"" align=""right"">电子邮箱：</td>"&vbCrLf
StringText=StringText&"    <td width=""35%"">&nbsp;"&rs("eEmail")&"</td>"&vbCrLf
StringText=StringText&"  </tr>"&vbCrLf
StringText=StringText&"  <tr bgcolor=""#F7F7F7"" height=""25"">"&vbCrLf
StringText=StringText&"    <td width=""15%"" align=""right"">更新时间：</td>"&vbCrLf
StringText=StringText&"    <td width=""35%"" align=""left"">&nbsp;"&FormatDate(rs("UpdateTime"), 13)&"</td>"&vbCrLf
StringText=StringText&"    <td width=""15%"" align=""right"">浏览次数：</td>"&vbCrLf
StringText=StringText&"    <td width=""35%"">&nbsp;<script language=""javascript"" src=""HitCount.Asp?id="&rs("ID")&"&LX="&Datapre&"_Jobs""></script><script language=""javascript"" src=""HitCount.Asp?action=count&LX="&Datapre&"_Jobs&id="&rs("ID")&"""></script></td>"&vbCrLf
StringText=StringText&"  </tr>"&vbCrLf
StringText=StringText&"  <tr height=""25"">"&vbCrLf
StringText=StringText&"    <td align=""right"">工作职责：</td>"&vbCrLf
StringText=StringText&"    <td colspan=""3"" align=""left"">&nbsp;"&HtmlStrReplace(rs("Responsibility"))&"</td>"&vbCrLf
StringText=StringText&"  </tr>"&vbCrLf
StringText=StringText&"  <tr bgcolor=""#F7F7F7"" height=""25"">"&vbCrLf
StringText=StringText&"    <td align=""right"" valign=""top"">职位要求：</td>"&vbCrLf
StringText=StringText&"    <td colspan=""3"" align=""left"">&nbsp;"&HtmlStrReplace(rs("Requirement"))&"</td>"&vbCrLf
StringText=StringText&"  </tr>"&vbCrLf
StringText=StringText&"  <tr height=""50"">"&vbCrLf
StringText=StringText&"    <td colspan=""4"" align=""center""><a href=""TalentWrite.Asp?JobID="&ID&"&JobName="&server.urlencode(rs("JobName"))&""" title=""提交简历"" ><img src="""&SysRootDir&templatepath&"Images/Page_resume.gif"" border=""0"" /></a></td>"&vbCrLf
StringText=StringText&"  </tr>"&vbCrLf
StringText=StringText&"</table>"&vbCrLf
        rs.update
        rs.Close:Set rs = Nothing
    End If
WebContentJobView=StringText
End Function
%>