<?
include_once("inc/auth.inc.php");
include_once("inc/utility_all.php");
include_once("inc/utility_org.php");
include_once("inc/utility_file.php");
$HTML_PAGE_TITLE = _("手机签到查询");
include_once("inc/header.inc.php");
$connstatus = ($connstatus) ? true : false;
$ITEMS_IN_PAGE=10;
if(!isset($start) || $start=="")
$start=0;
if(!$PAGE_SIZE)
$PAGE_SIZE=10;
if($ASC_DESC=="")
$ASC_DESC="1";
if($FIELD=="")
$FIELD="M_ID";
?>
<style type="text/css">
#tr1 td{
padding:5px;
}
.tr2 td{
padding-left:4px;
padding-right:3px;
line-height:20px;
}
.zhanshi{
width:95%;
min-height:80px;
margin-top:5px;
margin-bottom:10px;
margin-left:10px;
margin-right:5px;
border:#39F 1px solid;
box-shadow:-5px 0px 0px #0033FF; /* 老的 Firefox */
box-shadow:-5px 0px 0px #0066FF;
border-radius:6px;
font-size:12px;
line-height:25px;
padding-left:3px;
}
.biaoti{
text-align:center;
line-height:36px;
}
</style>
<script type="text/javascript" src="jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="/inc/js_lang.php"></script>
<script type="text/javascript" src="<?=MYOA_JS_SERVER?>/static/js/attach.js"></script>
<script src="<?=MYOA_JS_SERVER?>/static/js/module.js?v=<?=MYOA_SYS_VERSION?>"></script>
<script src="<?=MYOA_JS_SERVER?>/module/DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var num = 1; //计数器初始化为1
var maxnum = 10000; //设置一共要加载几次
$(window).scroll(function(){
//alert(1111);
checkload();
});
//建立加载判断函数
function checkload(){
var srollPos = $(window).scrollTop(); //滚动条距离顶部的高度
var windowHeight = $(window).height(); //窗口的高度
var dbHiht = $("body").height(); //整个页面文件的高度
s= setTimeout(function(){
if((windowHeight + srollPos) >= (dbHiht) && num != maxnum){
//alert(num);
LoadList(num);
num++; //计数器+1
}
},500);
}
//创建ajax加载函数,并设置变量C,用于输入调用的页面频道,请根据实际情况判断使用,非必要。
function LoadList(c){
//alert("aaaa");
//$.get("aaa.php?c="+c, function(result){
//alert(result);
//t = setTimeout(function(){$("#list_box").append(result+"<br/>")},1);
//});
///
$.ajax({
type: "POST",
url: "aaa.php",
data: "c="+c,
success: function(result){
//$("#myDiv").html('<h2>'+data+'</h2>');
t = setTimeout(function(){$("#list_box").append(result+"<br/>")},1);
}
});
///
}
});
</script>
</script>
<body class="bodycolor" style=" background-color:#FFF" >
<div class="biaoti">
<h3>外勤签到公示栏</h3>
</div>
<div id="list_box">
<?
$query = "SELECT * from attend_mobile as a ,user as b where a.M_UID=b.UID and M_ISFOOT='2' order by M_ID desc limit 30 ";
?>
<?
//$query = "SELECT * from attend_mobile order by M_ID DESC limit 500";
$cursor= exequery(TD::conn(),$query);
$jishu1=0;
while($ROW=mysql_fetch_array($cursor))
{
$jishu1++;
$ATTACHMENT_ID=$ROW["ATTACHMENT_ID"];
$ATTACHMENT_NAME=$ROW["ATTACHMENT_NAME"];
$uid=$ROW["M_UID"];
$M_ID=$ROW["M_ID"];
$M_ISFOOT=$ROW["M_ISFOOT"];
$USER_NAME=$ROW["USER_NAME"];
$USER_ID=$ROW["USER_ID"];
$DEPT_ID=$ROW["DEPT_ID"];
$M_REMARK=$ROW["M_REMARK"];
?>
<div class="zhanshi">
<?
//echo $jishu1."--".$USER_NAME."---".date("Y-m-d H:i:s",$ROW["M_TIME"])."---".$ROW["M_LOCATION"]."--".$M_REMARK;
echo $jishu1.",签到人:".$USER_NAME." 时间:".date("Y-m-d H:i:s",$ROW["M_TIME"])."<hr>";
echo "地点:".$ROW["M_LOCATION"]."<br>";
echo "备注:".$M_REMARK."<br>";
/*
if($ATTACHMENT_ID=="")
echo _("无照片");
else
echo attach_link($ATTACHMENT_ID,$ATTACHMENT_NAME,1,1,1,0,0,1,0,0);
*/
?>
</div>
<?
}
?>
</div>
</body>
aaa.php
<?
include_once("inc/conn.php");
$c=$_REQUEST["c"];
$a=$c*30+1;
$query = "SELECT * from attend_mobile as a ,user as b where a.M_UID=b.UID and M_ISFOOT='2' order by M_ID desc limit ".$a.", 30 ";
$cursor= exequery(TD::conn(),$query);
$jishu=$c*30;
$num=mysql_num_rows($cursor);
if($num==0){?>
<div class="zhanshi">不要在继续滑动了,已经到最后了!</div>
<?
} else {
while($ROW=mysql_fetch_array($cursor))
{
$jishu++;
$ATTACHMENT_ID=$ROW["ATTACHMENT_ID"];
$ATTACHMENT_NAME=$ROW["ATTACHMENT_NAME"];
$uid=$ROW["M_UID"];
$M_ID=$ROW["M_ID"];
$M_ISFOOT=$ROW["M_ISFOOT"];
$USER_NAME=$ROW["USER_NAME"];
$USER_ID=$ROW["USER_ID"];
$DEPT_ID=$ROW["DEPT_ID"];
$M_REMARK=$ROW["M_REMARK"];
// echo $jishu."--".$USER_NAME."---".date("Y-m-d H:i:s",$ROW["M_TIME"])."---".$ROW["M_LOCATION"]."--".$M_REMARK;
?>
<div class="zhanshi">
<?
// echo $jishu."--".$USER_NAME."---".date("Y-m-d H:i:s",$ROW["M_TIME"])."---".$ROW["M_LOCATION"]."--".$M_REMARK;
echo $jishu.",签到人:".$USER_NAME." 时间:".date("Y-m-d H:i:s",$ROW["M_TIME"])."<hr>";
echo "地点:".$ROW["M_LOCATION"]."<br>";
echo "备注:".$M_REMARK;
?>
</div>
<?
}
}