/
List.php
87 lines (76 loc) · 2.4 KB
/
List.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link href="http://cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
<link href="/favicon.ico" rel="icon" type="image/x-icon" >
<title>CodePaste</title>
<style>
.container{max-width: 82%;}
body{padding-top:70px;}
cn{font-family: "微软雅黑";}
.inputbox{max-width : 700px;}
.tips{padding-left : 15px;}
</style>
<link rel="stylesheet" href="http://wnjxyk.cn/support/Bootstrap/css/code-style.css" type="text/css" />
</head>
<body>
<div class="container">
<?
include("header.php");
include("mysql.php");
?>
<div class="page-header">
<h1>代码列表<small id="sml"> Recent code records</small></h1>
</div>
<table class="table table-striped">
<thread>
<tr>
<th>ID(Edit)</th>
<th>Title(View)</th>
<th>Author</th>
<th>Language</th>
<th>Length</th>
<th>Time</th>
</tr>
</thread>
<tbody>
<?php
$sql_con = getSqlCon();
$page=$_GET["Page"];
if ($page==0) $page = 1;
$pagePost = 15;
$content_Num = getMulNum('codepaste');
$contents = getMulLimit('codepaste',($page-1)*$pagePost,$pagePost);
while ($row = mysql_fetch_array($contents)){
echo "<tr><td><a href=\"./Edit.php?ID=".$row['id']."\" >".$row['id']."</a></td><td><cn><a href=\"./Code.php?ID=".$row['id']."\" >".$row['title']."</a></cn></td><td>".$row['author']."</td><td>".$row['language']."</td><td>".$row['length']." bytes</td><td>".$row['date']."</td></tr>";
}
?>
</tbody>
</table>
<div align = "center">
<nav>
<ul class="pagination">
<?
$pageNum = ceil($content_Num/$pagePost);
if ($page<=1)
echo "<li class=\"disabled\"><a>«</a></li>";
else
echo "<li><a href=\"List.php?Page=".($page-1)."\">«</a></li>";
for ($i=1;$i<=$pageNum;$i++){
if ($page==$i) echo "<li class=\"active\">"; else echo "<li>";
echo "<a href=\"List.php?Page=".$i."\">".$i."</a></li>";
}
if ($page>=$pageNum)
echo "<li class=\"disabled\"><a>»</a></li>";
else
echo "<li><a href=\"List.php?Page=".($page+1)."\">»</a></li>"
?>
</ul>
</nav>
</div>
</div>
<script src="http://cdn.bootcss.com/jquery/1.11.2/jquery.min.js"></script>
<script src="http://cdn.bootcss.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
</body>
</html>