/
show.php
162 lines (146 loc) · 4.64 KB
/
show.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>提交成功</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="css/bootstrap-theme.css" />
<link rel="stylesheet" type="text/css" href="css/all.css" />
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/javascript" href="js/bootstrap.min.js" />
</head>
<body>
<nav class="navbar navbar-default">
<p class="navbar-text"><a href="index.html" class="navbar-brand">返回需求上传页</a></p>
</nav>
<?php
include_once('connect.php');
$query = "SELECT * FROM `upload_case` order by `creat_time` desc";
$result = $db->query($query);
//Added for page-seperators.
$each_page_num = 3;
$total_num = 0;
while($fetched_row = $result -> fetch_row())
{
$content_array[] = $fetched_row;
$total_num++;
}
echo $total_num;
function show_table($row_choosed)
{
if ($row_choosed[6] == "undef")
{
echo "<tr>";
echo "<td>".$row_choosed[2]."</td>";
echo "<td>".$row_choosed[3]."</td>";
echo "<td>".$row_choosed[5]."</td>";
echo "<td><span class=\"label label-default\">Undefine</span></td>";
echo "<td>".$row_choosed[4]."</td>";
echo "<td>".$row_choosed[1]."</td>";
echo "</tr>";
}
else if ($row_choosed[6] == "需求分析")
{
echo "<tr>";
echo "<td>".$row_choosed[2]."</td>";
echo "<td>".$row_choosed[3]."</td>";
echo "<td>".$row_choosed[5]."</td>";
echo "<td><span class=\"label label-primary\">需求分析</span></td>";
echo "<td>".$row_choosed[4]."</td>";
echo "<td>".$row_choosed[1]."</td>";
echo "</tr>";
}
else if ($row_choosed[6] == "Demo开发")
{
echo "<tr>";
echo "<td>".$row_choosed[2]."</td>";
echo "<td>".$row_choosed[3]."</td>";
echo "<td>".$row_choosed[5]."</td>";
echo "<td><span class=\"label label-success\">Demo开发</span></td>";
echo "<td>".$row_choosed[4]."</td>";
echo "<td>".$row_choosed[1]."</td>";
echo "</tr>";
}
else if ($row_choosed[6] == "电信测试")
{
echo "<tr>";
echo "<td>".$row_choosed[2]."</td>";
echo "<td>".$row_choosed[3]."</td>";
echo "<td>".$row_choosed[5]."</td>";
echo "<td><span class=\"label label-info\">电信测试</span></td>";
echo "<td>".$row_choosed[4]."</td>";
echo "<td>".$row_choosed[1]."</td>";
echo "</tr>";
}
else if ($row_choosed[6] == "电信正式")
{
echo "<tr class=\"danger\">";
echo "<td><s>".$row_choosed[2]."</s></td>";
echo "<td><s>".$row_choosed[3]."</td>";
echo "<td><s>".$row_choosed[5]."</td>";
echo "<td><span class=\"label label-warning\">电信正式</span></td>";
echo "<td><s>".$row_choosed[4]."</s></td>";
echo "<td><s>".$row_choosed[1]."</s></td>";
echo "</tr>";
}
}
?>
<table class="table table-hover">
<thead>
<tr>
<th>标题</th>
<th>需求类型</th>
<th>内容</th>
<th>状态</th>
<th>提交人</th>
<th>日期</th>
</tr>
<tbody>
<?php
if ($total_num <= $each_page_num)
{
for ($i=0; $i<$total_num; $i++)
{
show_table($content_array[$i]);
}
}
?>
</tbody>
</thead>
</table>
<?php
if ($total_num > $each_page_num)
{
echo "<div id=\"page_num\">";
echo "<nav>";
echo "<ul class=\"pagination pagination-lg\">";
echo "<li>";
echo "<a href=\"#\" aria-label=\"Previous\">";
echo "<span aria-hidden=\"true\">«</span>";
echo "</a>";
echo "</li>";
//page numbers
//<li><a href="#">1</a></li>
echo "<li>";
echo "<a href=\"#\" aria-label=\"Next\">";
echo "<span aria-hidden=\"true\">»</span>";
echo "</a>";
echo "</li>";
echo "</ul>";
echo "</nav>";
echo "</div>";
echo "<div class=\"progress\">";
echo "<div class=\"progress-bar\" role=\"progressbar\" aria-valuenow=\"60\" aria-valuemin=\"0\" aria-valuemax=\"100\" style=\"width: 60%;\">";
echo "60%";
echo "</div>";
echo "</div>";
}
?>
<?php
$db->close();
?>
</body>
</html>