<!--#include file="../Include/Const.Asp" -->
<!--#include file="../Include/ConnSiteData.Asp" -->
<!--#include file="../Include/System_Language.asp" -->
<!--#include file="../Include/Version.Asp" -->
<!--#include file="CheckAdmin.Asp"-->
<%
'*******************************************************
'软件名称：科蚁企业网站内容管理系统（KEYICMS）
'软件开发：成都神笔天成网络科技有限公司
'网   址：http://www.keyicms.com
'本信息不会影响您网站的正常使用，无论免费用户或是收费用户请保留这里的信息.
'神笔(14)天成网络享有软件著作权，如果您擅自删除这里的版权信息,我们将追究法律责任.
'未经公司同意禁止更改以下代码.
'*******************************************************
Call SiteInfo()
%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="<%=Keyicms_Lang_Copyright(13)%>">
<meta name="author" content="<%=Keyicms_Lang_Copyright(3)%>">
<title><%=Keyicms_Lang_Copyright(1)%> <%=Str_Soft_Version%></title>
<!--#Include file="Keyicms_css.Asp"-->
</head>

<body>
<!--#Include file="Keyicms_Top.Asp"-->
<div id="wrap">
	<!--#Include file="Keyicms_Meun.Asp"-->
	<%
	If InStr(CompanyAdminPurview, "|4,") = 0 Then
		response.Write ("<br /><br /><div style='height:100%; text-align:center' class='main'><font style=""color:red; font-size:14px;"")>"&Keyicms_Lang_System(26)&"</font></div>")
		response.End
	End If

	dim Result,Keyword,SortID,SortPath
	Result = request.QueryString("Result")
	Keyword = request.QueryString("Keyword")
	SortID = request.QueryString("SortID")
	SortPath = request.QueryString("SortPath")
	%>
    <div class="main">
        <div class="row ">
            <ol class="breadcrumb">
                <li><i class="fa fa-home"></i> 当前位置</li>
             	<li>功能模块</li>
                <%
				If SortPath<>"" Then
					Response.Write "<li>案例信息列表</li>"
					TextPath(SortID)
				Else
					Response.Write "<li class='active'>案例信息列表</li>"
				End If
				%>
            </ol>	
        </div>	
     	<div class="row">
            <div class="col-lg-12 hideInIE8">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h2><i class="fa fa-edit"></i><span class="break"></span><strong>案例管理</strong></h2> 
                    </div>
                    <div class="panel-body">
                        <a class="ShortCut1" href="Ky_CaseEdit.Asp?Result=Add">  
                            <i class="fa fa-picture-o"></i>
                            <div class="title">添加案例</div>
                        </a>					
                        <a class="ShortCut2" href="Ky_Case.Asp">  
                            <i class="fa fa-th-large"></i>
                            <div class="title">案例列表</div>
                        </a>	
                        <a class="ShortCut3" href="Ky_CaseSort.Asp">  
                            <i class="fa fa-sitemap"></i>
                            <div class="title">案例分类</div>
                        </a>													
                    </div>
                </div>
            </div>
        </div>
         <div class="row"  style="margin-left:15px; margin-bottom:15px;">
			   <div class="col-lg-12" style="border: 1px solid #d4d4d4;">
                           <div style=" margin:10px; float:right;" class="input-group">
				                            <form name="formSearch" method="post" action="Search.Asp?Result=Case">
                                            <input name="Keyword" type="text" value="<%=Keyword%>" class="form-control" style=" width:260px" placeholder="输入案例关键字">
				                            <span class="input-group-btn">
				                            <button name="submitSearch" type="submit" class="btn btn-primary" ><i class="fa fa-search"></i> 搜索案例</button>
				                            </span>
                                            </form>
				           </div>
               </div>
         </div>
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-default">
                    <div data-original-title="" class="panel-heading">
                        <h2><i class="fa fa-user"></i><span class="break"></span><strong>案例列表</strong></h2>
                        
                    </div>
                    <div class="panel-body">
                            <form name="FormList">
                        	<input type="hidden" name="Result" value="Case">
                            <table class="table table-striped table-bordered bootstrap-datatable" cellspacing="0" width="100%">
                            <thead>
                            <tr role="row">
                                <th>ID</th>
                                <th>状态</th>
                                <%If mStatus Then%><th>手机显示</th><%End If%>
                                <th>标题</th>
                                <th>推荐</th>
                                <th>案例缩略图</th>
                                <th>排序</th>
                                <th>操作</th>
                                <th>选择</th>
                            </tr>
                            </thead>
                            <tbody>
								<%Call CaseList()%>
                            </tbody>
                            </table>   
                        </form>        
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>
<script>
function GoPage(){
window.location.href = '?Page=' + document.FormList.SkipPage.value	
}
</script>
<!--#Include file="Keyicms_js.Asp"-->
</body>
</html>
<%
Function CaseList()
    Dim idCount
    Dim pages
    pages = 20
    Dim pagec
    Dim page
    If request("page") <> "" Then page = CLng(request("Page")) Else page = 1
    Dim pagenc
    pagenc = 2
    Dim pagenmax
    Dim pagenmin
    Dim datafrom
    datafrom = "Keyicms_Case"
    Dim datawhere
    If Result = "Search" Then
        datawhere = "where CaseName like '%" & Keyword &_
        "%' "
    Else
        If SortPath<>"" Then
            datawhere = "where Instr(SortPath,'"&SortPath&"')>0 "
        Else
            datawhere = ""
        End If
    End If
    Dim sqlid
    Dim Myself, PATH_INFO, QUERY_STRING
    PATH_INFO = request.servervariables("PATH_INFO")
    QUERY_STRING = request.ServerVariables("QUERY_STRING")'
    If QUERY_STRING = "" Or InStr(PATH_INFO & "?" & QUERY_STRING, "Page=") = 0 Then
        Myself = PATH_INFO & "?"
    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
    Dim rs, sql
    sql = "select count(ID) as idCount from ["& datafrom &"]" & datawhere
    Set rs = server.CreateObject("adodb.recordset")
    rs.Open sql, conn, 0, 1
    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 ["& datafrom &"] " & datawhere & taxis
Set rs = server.CreateObject("adodb.recordset")
rs.Open sql, conn, 1, 1
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 * from ["& datafrom &"] where id in("& sqlid &") "&taxis
Set rs = server.CreateObject("adodb.recordset")
rs.Open sql, conn, 0, 1
While(Not rs.EOF)
		Response.Write "<tr role='row'>" & vbCrLf
		Response.Write "<td>"&rs("ID")&"</td>" & vbCrLf
		If rs("ViewFlag") Then
			Response.Write "<td><a href='Conversion.Asp?id="&rs("ID")&"&LX="&datafrom&"&Conver=ViewFlag&Operation=down'><span class='label label-success'>生效</span></a></td>" & vbCrLf
		Else
			Response.Write "<td><a href='Conversion.Asp?id="&rs("ID")&"&LX="&datafrom&"&Conver=ViewFlag&Operation=up'><span class='label label-default'>未生效</span</a></td>" & vbCrLf
		End If
	If mStatus Then
		If rs("MobileFlag") Then
			Response.Write "<td><a href='Conversion.Asp?id="&rs("ID")&"&LX="&datafrom&"&Conver=MobileFlag&Operation=down'><span class='label label-danger'>显示</span></a></td>" & vbCrLf
		Else
			Response.Write "<td><a href='Conversion.Asp?id="&rs("ID")&"&LX="&datafrom&"&Conver=MobileFlag&Operation=up'><span class='label label-warning'>不显示</span></a></td>" & vbCrLf
		End If
	End If
		Response.Write "<td title='"&rs("CaseName")&"'><a href='Ky_CaseEdit.Asp?Result=Modify&ID="&rs("ID")&"'>"&rs("CaseName")&"</td>" & vbCrLf
		If rs("CommendFlag") Then
			Response.Write "<td><a href='Conversion.Asp?id="&rs("ID")&"&LX="&datafrom&"&Operation=down&Conver=CommendFlag'><font color='blue'><strong>√</strong></font></a></td>" & vbCrLf
		Else
			Response.Write "<td><a href='Conversion.Asp?id="&rs("ID")&"&LX="&datafrom&"&Operation=up&Conver=CommendFlag'><font color='red'><strong>×</strong></font></a></td>" & vbCrLf
		End If
		Response.Write "<td width='100' align='center' style='padding:2px'><img src='"&rs("BigPic")&"' width='65' border='0' onerror=""this.src='ke01/img/noimg_big.gif'""/></td>"
		Response.Write "<td>"&rs("Sequence")&"</td>" & vbCrLf
		Response.Write "<td>" & vbCrLf
		Response.Write "<a title='查看前台页面' href='/"&CaseDir&"/"&rs("ClassSeo")&Separated&rs("ID")&"."&HTMLName&"' class='btn btn-success' target='_blank'><i class='fa fa-search-plus'></i></a>"
		Response.Write "<a title='修改' href='Ky_CaseEdit.Asp?Result=Modify&ID="&rs("ID")&"&Page=" & Page & "' class='btn btn-info'><i class='fa fa-edit'></i></a>"
		Response.Write "<a title='删除' href='JavaScript:void(0)' class='btn btn-danger' onclick='test("&rs("ID")&", ""Case"")'><i class='fa fa-trash-o'></i></a>"
		Response.Write "</td>" & vbCrLf
		Response.Write "<td><input name='SelectID' type='checkbox' value='"&rs("ID")&"'></td>"
		Response.Write "</tr>" & vbCrLf
		rs.movenext
        Wend
Else
    response.Write "<tr><td nowrap align='center' colspan='10' class=""forumRow"">暂无相关信息+</td></tr>"
End If
Response.Write "</tbody>" & vbCrLf
Response.Write "</table>" & vbCrLf
Response.Write "<div class='row'>" & vbCrLf
Response.Write "<div class='col-xs-4'>" & vbCrLf
Response.Write "<div class='dataTables_info' id='datatable_info' role='status' aria-live='polite'>共计：<font color='red'>"&idcount&"</font>条记录 页次：<font color='red'>"&page&"</font></strong>/"&pagec&" 每页：<font color='red'>"&pages&"</font>条</div>" & vbCrLf
Response.Write "</div>" & vbCrLf
Response.Write "<div class='col-xs-8'>" & vbCrLf
Response.Write "<div class='dataTables_paginate paging_simple_numbers'>" & vbCrLf
Response.Write "<ul class='pagination'>" & vbCrLf
pagenmin = page - pagenc
pagenmax = page+pagenc
If(pagenmin<1) Then pagenmin = 1
If(page>1) Then response.Write ("<li><a href='"& myself &"Page=1'>首页</a></li> ")
If(pagenmin>1) Then response.Write ("<li><a href='"& myself &"Page="& page-(1) &"'>上一页</a></li> ")
If(pagenmax>pagec) Then pagenmax = pagec
For i = pagenmin To pagenmax
    If(i = page) Then
    response.Write ("<li class='active'><a href='#'>"& i &"</a></li> ")
Else
    response.Write ("<li><a href="& myself &"Page="& i &">"& i &"</a></li>")
End If
Next
If(pagenmax<pagec) Then response.Write (" <li><a href='"& myself &"Page="& page+(1) &"'>下一页</a></li> ")
If(page<pagec) Then response.Write (" <li><a href='"& myself &"Page="& pagec &"'>尾页</a></li>")
Response.Write "<span style='margin-left:10px;margin-right:1px;'><div class='btn btn-info' disabled='disabled'>第</div></span>" & vbCrLf
Response.Write "<input class='ky-atz' name='SkipPage' onKeyDown='if(event.keyCode==13)event.returnValue=false' onchange=""if(/\D/.test(this.value)){alert('请输入需要跳转到的页数并且必须为整数！');this.value='"&Page&"';}"" type='text' value='"&Page&"'>" & vbCrLf
Response.Write "<span class='btn btn-info' disabled='disabled' style='margin-left:1px;'>页</span>" & vbCrLf

Response.Write "<input class='btn btn-primary' style='margin-right:10px' name='submitSkip' type='button' onClick='GoPage("""&Myself&""")' value='转到'>" & vbCrLf
Response.Write "</ul>" & vbCrLf
Response.Write "<button type='button' class='btn btn-default' onclick='CheckOther()'>反选</button>" & vbCrLf
Response.Write "<button type='button' class='btn btn-default' onclick='CheckAll()'>全选</button>" & vbCrLf
Response.Write "<button type='button' class='btn btn-danger' onclick='test_0()'>删除所选</button>" & vbCrLf
Response.Write "</div>" & vbCrLf
rs.Close
Set rs = Nothing
Response.Write "</div>" & vbCrLf
Response.Write "</div>" & vbCrLf
End Function

Function TextPath(ID)
    Dim rs, sql
    Set rs = server.CreateObject("adodb.recordset")
    sql = "Select * From keyicms_CaseSort where ID="&ID
    rs.Open sql, conn, 1, 1
    TextPath = "<li class='active'>"&rs("SortName")&"</li>"
    If rs("ParentID")<>0 Then TextPath rs("ParentID")
    response.Write(TextPath)
End Function
%>