代码拉取完成,页面将自动刷新
<?php
echo "<!DOCTYPE html>\n";
include 'inc/conn.php';
$pageSize = 100;
$phpself =$_SERVER['PHP_SELF'];
$pagestr = end(explode("/",$phpself));
$view=0; /*default is list*/
extract($_POST);
extract($_GET);
unset($_POST,$_GET);
if (isset($view))
{
if ($view == "1"){
$view=1;
}else{
$view=0;
}
}
if (!isset($page)){
$page = 1;
}
$pageCount = 0;
$db = new mysql();
if (isset($search))
$db->query("select * from sn_uuid where PN like '%$search%' or SN like '%$search%'");
else
$db->query("select count(id) as CNT from sn_uuid");
$row = $db->fetch_assoc();
$rowCount = $row['CNT'];
$db->close();
$pageCount = ceil(($rowCount/$pageSize));
$pre = ($page-1)*$pageSize;
?>
<html lang="en">
<head>
<title>DPK机器数据(DPK UUID System)</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">-->
<link rel="stylesheet" href="/css/bootstrap.min.css">
<script src="/js/jquery.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<script type="text/javascript">
function goTopEx() {
var obj = document.getElementById("goTopBtn");
function getScrollTop() {
return document.documentElement.scrollTop + document.body.scrollTop;
}
function setScrollTop(value) {
if (document.documentElement.scrollTop) {
document.documentElement.scrollTop = value;
} else {
document.body.scrollTop = value;
}
}
window.onscroll = function() {
getScrollTop() > 0 ? obj.style.display = "": obj.style.display = "none";
}
obj.onclick = function() {
var goTop = setInterval(scrollMove, 10);
function scrollMove() {
setScrollTop(getScrollTop() / 1.1);
if (getScrollTop() < 1) clearInterval(goTop);
}
}
}
</script>
<script language="javascript">
function Go(it) {
window.location="<? echo $pagestr ?>?page="+it.value;
}
</script>
<style>
BODY {
HEIGHT: auto;
}
#goTopBtn {
POSITION: fixed; TEXT-ALIGN: center; LINE-HEIGHT: 30px; WIDTH: 30px; BOTTOM: 35px;
HEIGHT: 33px; FONT-SIZE: 12px; CURSOR: pointer; RIGHT: 0px; _position: absolute; _right: auto
}
</style>
</head>
<body class="background">
<div style="display: none" id="goTopBtn"><img border=0 src="/image/top.jpg"></div>
<script type=text/javascript>goTopEx();</script>
<?php
include "top.php";
echo "<div class='container-fluid'>";
echo " <div><h3><span class='label label-primary'>DPK机器数据(DPK UUID System)</span></h3></div>";
echo " <div class='well'> ";
echo " <form class='form-inline'>";
echo " <div style='form-group'>";
if (isset($search))
echo " 搜索:<input type='text' class='form-control' name='search' value='$search'><button type='submit' class='btn btn-info'>Search</button>";
else
echo " 搜索:<input type='text' class='form-control' name='search'><button type='submit' class='btn btn-info'>Search</button>";
echo " <div style='float:right'>视图:NULL</div>";
echo " </div>";
echo " </form>";
echo " </div>";
echo " <div>";
echo " <table border=0 cellpadding=0 class='table table-striped'>";
if ($view == 1){
echo '<tr><th>Item</th><th>机器序号</th><th>成品料号</th><th>UUID</th><th>添加日期</th></tr>';
}else{
echo '<tr class="success"><th>Item</th><th>机器序号</th><th>成品料号</th><th>UUID</th><th>添加日期</th></tr>';
}
$db = new mysql();
if (isset($search))
{
$db->query("select * from sn_uuid where PN like '%$search%' or SN like '%$search%' ORDER BY add_date DESC limit $pre,$pageSize");
}else
$db->query("select * from sn_uuid ORDER BY add_date DESC limit $pre,$pageSize");
$num = $db->db_num_rows();
for($i=0; $i<$num; $i++){
$row = $db->fetch_assoc();
$item = $i + 1;
echo "<tr>";
echo "<td>$item</td>";
echo "<td>".$row['SN']."</a></td>";
echo "<td>".$row['PN']."</a></td>";
echo "<td>".$row['UUID']."</a></td>";
echo "<td>".$row['add_date']."</td>";
echo "</tr>\n";
}
echo "</table>";
echo "</div>";
if($pageCount>1) {
echo "<div align='center'><ul class='pager'>";
if($page>=2){
$pageP=$page-1;
echo "<li class='previous'><a href='$pagestr?page=$pageP'>←上一页</a></li>";
} else
$pageP=1;
echo "第<select name='page' id='page' onchange='javascript:Go(this);'>";
for($j=1;$j<=$pageCount;$j++){
if($j==$page)
echo "<option value='$j' selected='$j'>$j</option>\n";
else
echo "<option value='$j'>$j</option>\n";
}
echo "</select>页";
if($page<$pageCount)
$pageN=$page+1;
else
$pageN=1;
if (isset($search))
echo "<a href='$pagestr?page=$pageN&search=$search'>下一页</a>";
else
echo "<li class='next'><a href='$pagestr?page=$pageN'>下一页→</a></li>";
echo "</ul></div>";
}
echo "</div>";
include 'bottom.php';
?>
</body>
</html>
<?
$db->close();
?>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。