首页
关于
友情链接
文章归档
Search
1
centos 32位 64位 下挂vagex一键包代码
719 阅读
2
wordpress转typecho方法
615 阅读
3
一个自制的virto精简版kvm qemu win2003模板 最低64M内存可用
605 阅读
4
PHP 安装
540 阅读
5
暴雨 车被泡了~
483 阅读
默认分类
vps综合利用
登录
/
注册
Search
标签搜索
Uncategorized
安装
mysql
utf-8
网站
google
linux
free
免费
黑色
ssl
一键包
优化
40%
press
vagex
32位
64位
debian
domain
御品VPS
累计撰写
501
篇文章
累计收到
1
条评论
首页
栏目
默认分类
vps综合利用
页面
关于
友情链接
文章归档
搜索到
1
篇与
一段根据日期查询并把结果显示出来的代码
的结果
2017-04-14
一段根据日期查询并把结果显示出来的代码
<? include "./sess.php"; include "./config.php"; $logined=$_SESSION["logined"]; if($logined!=1){ print "<center><font color=red size=8>你没有权限,请先从<a href=/>这里</a>进行登录 。</font></center>"; exit; }include "./sbl/config.php";if($_GET[startdate]==''){echo '起始日期为空,系统自动统计当天的数据';$_GET[startdate]=date("Ymd");}if($_GET[enddate]==''){echo '终止日期为空,系统自动统计当天的数据';$_GET[enddate]=date("Ymd"); }if ($_GET[enddate] > date("Ymd")) {echo '终止日期不能大于当前日期,系统自动统计到当天的数据';$_GET[enddate]=date("Ymd");}if ($_GET[startdate] > $_GET[enddate]) {echo '日期错误 终止日期必须大于或等于起始日期,系统自动统计当天的数据';$_GET[startdate]=date("Ymd");$_GET[enddate]=date("Ymd");}$timeb=time()+(3600*24*10);$dateb=date("Y-m-d",strtotime(date("$_GET[enddate]")." +10 day ")); if (!$conn) {exit("Connection Failed: " . $conn);}$sql0="select ....略;$sql1="select ...略 and a.enddate+1 between '$_GET[startdate]' and '$_GET[enddate]'group by 1, 2, 3, 4, 5into temp sbold with no log";$sql2="select b.*from sbold a, sbnew1 bwhere a.comcode=b.comcode...略 with no log";$sql3="select a.comcode[1,7],count(*) oldsl,sum(sumpremium) oldsumpremiumfrom sbold awhere 1=1group by 1into temp old with no log;select a.comcode[1,7],count(*) newsl,sum(sumpremium) newsumpremiumfrom sbnew awhere 1=1group by 1into temp new with no log";$sql4="select ....";//$rs0=odbc_exec($conn,$sql0);//$rs1=odbc_exec($conn,$sql1); //$rs2=odbc_exec($conn,$sql2);//$rs3=odbc_exec($conn,$sql3);$rs=odbc_exec($conn,$sql4);if (!$rs) {exit("Error in SQL");}if (file_exists("./sbl/test.txt")){unlink("./sbl/test.txt");}while (odbc_fetch_row($rs)){ $comcode=odbc_result($rs,"comcode"); $AppliName=odbc_result($rs,"oldsl"); $AppliCode=odbc_result($rs,"newsl"); $operatedate=odbc_result($rs,"sbl"); $OperatorCode=odbc_result($rs,"oldsumpremium"); $UnderwriteName=odbc_result($rs,"newsumpremium"); $content= "<tr><td class='style3'>$comcode</td><td class='style3'>$AppliName</td><td class='style3'>$AppliCode</td><td class='style3'>$operatedate</td><td class='style3'>$OperatorCode</td><td class='style3'>$UnderwriteName</td></tr>";file_put_contents('./sbl/test.txt',$content,FILE_APPEND);}$content=file_get_contents("./sbl/test.txt");$getcontent=ob_get_contents();echo "</table>";ob_clean();ob_start(); $title=统计时间: .$_GET[startdate]. 到 .$_GET[enddate];echo "$title \n"; //echo $dateb;$gettitle=ob_get_contents();//ob_clean();odbc_close($conn);$fp=fopen("./sbl/mb.htm","r"); $str=fread($fp,filesize("./sbl/mb.htm"));$str=str_replace("{content}",$content,$str); $str=str_replace("{title}",$title,$str); $handle=fopen("./sbl/index.htm","w+"); fwrite($handle,$str); fclose($handle);if (file_exists("./sbl/test.txt")){unlink("./sbl/test.txt");}echo "恭喜,数据报表已生成,<a href=./sbl/index.htm>点这里查看</a>";?>
2017年04月14日
126 阅读
0 评论
0 点赞