PHP动态柱状图实现方法_PHP教程

php中文网
发布: 2016-07-13 09:59:08
原创
1330人浏览过

php动态柱状图实现方法

 这篇文章主要介绍了php动态柱状图实现方法,实例分析了php结合html元素实现动态柱状图的技巧,非常具有实用价值,需要的朋友可以参考下

 

 

本文实例讲述了PHP动态柱状图实现方法。分享给大家供大家参考。具体分析如下:

1.需求

查询最近一个月的数据总条数和审核通过的条数,做成柱状图

立即学习PHP免费学习笔记(深入)”;

2.实现代码:

?

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

法语写作助手
法语写作助手

法语助手旗下的AI智能写作平台,支持语法、拼写自动纠错,一键改写、润色你的法语作文。

法语写作助手 31
查看详情 法语写作助手

//计算上一个月的今天

function last_month_today($time){

$last_month_time = mktime(date("G", $time), date("i", $time),date("s", $time), date("n", $time), 0, date("Y",$time));

$last_month_t = date("t", $last_month_time);

if ($last_month_t

return date("Y-m-t H:i:s", $last_month_time);

}

return date(date("Y-m", $last_month_time) . "-d", $time);

}

?>

 

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

//$sql = "select count(*) from newpro where p_date>'$beginDate' and p_date

$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);

?>

 

table{

cellpadding:0px;

cellspacing:0px;

}

p{

padding:0px;

margin:0px;

}

div{

background-color:#669900;

width:50px;

}

#div1{

height:200px;

}

总计

一审通过

二审通过

审核通过

3.效果图如下所示:

PHP动态柱状图实现方法   帮客之家

希望本文所述对大家的php程序设计有所帮助。

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/976532.htmlTechArticlePHP动态柱状图实现方法 这篇文章主要介绍了PHP动态柱状图实现方法,实例分析了php结合HTML元素实现动态柱状图的技巧,非常具有实用价值,需...
相关标签:
PHP速学教程(入门到精通)
PHP速学教程(入门到精通)

PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号