脚本宝典收集整理的这篇文章主要介绍了PHP动态柱状图实现方法,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
本文实例讲述了PHP动态柱状图实现方法。分享给大家供大家参考。具体分析如下:
1.需求
2.实现代码:
<PRe class="brush:PHp;"> @H_126_12@PHP //计算上一个月的今天 function last_month_today($time){ $last_month_time = mktime(date("G",$time),date("i",date("s",date("n",date("Y",$time)); $last_month_t = date("t",$last_month_time); if ($last_month_t < date("j",$time))="" {="" return="" date("y-m-t="" h:i:s",$last_month_time);="" }="" return="" date(date("y-m",$last_month_time)="" .="" "-d",$time);="" }=""><?php
include dirname(dirname(dirname(FILE))).'/config.php';
$endDate = date('Y-m-d');
$date = strtotime($endDate);
$beginDate= last_month_today($date);
//查询最近一个月的总的数据条数
$SQL = 'select count() From newpro where p_date>\''.$beginDate.'\' and p_date<\''.$endDate.'\'';
//$sql = "select count() from newpro where p_date>'$beginDate' and p_date <'$endDate'";//这条语句也可以
$d = db()->query($sql)->fetch(PDO::FETCH_NUM);
//echo "总的数据条数:".$d[0];
//查询审核通过的数据条数
$sql2=$sql.' and is_pa_check_First=1 and is_pa_check_second=1 and is_pa_check_third=1';
$d2 = db()->query($sql2)->fetch(PDO::FETCH_NUM);
//echo "审核通过的数据条数:".$d2[0];
//查询一次审核通过的条数
$sql3=$sql.' and is_pa_check_first=1';
$d3 = db()->query($sql3)->fetch(PDO::FETCH_NUM);
//查询二次审核通过的条数
$sql4=$sql.' and is_pa_check_first=1 and is_pa_check_second=1';
$d4 = db()->query($sql4)->fetch(PDO::FETCH_NUM);
?>
以上是脚本宝典为你收集整理的PHP动态柱状图实现方法全部内容,希望文章能够帮你解决PHP动态柱状图实现方法所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。