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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
<? Header("P3P: CP='NOI DSP COR IVAa OUR BUS IND UNI COM NAV INT'"); include("./FusionCharts/Includes/FusionCharts.php"); include("./category/common.php"); ?>
<!DOCTYPE html> <head> <meta http-equiv="Content-Type" content="text/html; charset=euc-kr"> <title>´ã´çÀÚº° ´äº¯ °Ç¼ö</title> <link rel='stylesheet' type='text/css' href='./css/reset.css'> <link rel='stylesheet' type='text/css' href='./css/point.css'> <script language='javascript' src="./js/jquery-1.6.4.min.js"></script> <script src='/js/jqueryui/jquery-ui.js'></script> <link href="/js/jqueryui/jquery-ui.css" rel="stylesheet" type="text/css"> <script language="JavaScript"> function goSearch(){ //Á¶È¸ ½ºÅ©¸³Æ® document.serch_form.action="" document.serch_form.submit(); } $(function(){ $("input[name='keydate1']").datepicker({ showOn: "button", buttonImage: "./images/common/icon_calendar.png", buttonImageOnly: true, buttonText: "Select date", dateFormat: "yy-mm-dd", changeMonth: true, changeYear: true, monthNames: ['1¿ù','2¿ù','3¿ù','4¿ù','5¿ù','6¿ù','7¿ù','8¿ù','9¿ù','10¿ù','11¿ù','12¿ù'], monthNamesShort: ['1¿ù','2¿ù','3¿ù','4¿ù','5¿ù','6¿ù','7¿ù','8¿ù','9¿ù','10¿ù','11¿ù','12¿ù'], dayNames: ['ÀÏ','¿ù','È','¼ö','¸ñ','±Ý','Åä'], dayNamesShort: ['ÀÏ','¿ù','È','¼ö','¸ñ','±Ý','Åä'], dayNamesMin: ['ÀÏ','¿ù','È','¼ö','¸ñ','±Ý','Åä'], showMonthAfterYear: true, yearSuffix: '³â' }); $("input[name='keydate2']").datepicker({ showOn: "button", buttonImage: "./images/common/icon_calendar.png", buttonImageOnly: true, buttonText: "Select date", dateFormat: "yy-mm-dd", changeMonth: true, changeYear: true, monthNames: ['1¿ù','2¿ù','3¿ù','4¿ù','5¿ù','6¿ù','7¿ù','8¿ù','9¿ù','10¿ù','11¿ù','12¿ù'], monthNamesShort: ['1¿ù','2¿ù','3¿ù','4¿ù','5¿ù','6¿ù','7¿ù','8¿ù','9¿ù','10¿ù','11¿ù','12¿ù'], dayNames: ['ÀÏ','¿ù','È','¼ö','¸ñ','±Ý','Åä'], dayNamesShort: ['ÀÏ','¿ù','È','¼ö','¸ñ','±Ý','Åä'], dayNamesMin: ['ÀÏ','¿ù','È','¼ö','¸ñ','±Ý','Åä'], showMonthAfterYear: true, yearSuffix: '³â' }); }); </script> </head>
<body> <div class="wrap"> <h2>´ã´çÀÚº° ´äº¯ °Ç¼ö</h2> <form name="serch_form" style="margin:0;"> <div class="replyWrap"> <? if ($keydate1 == "") { $keydate1 = ($keydate1 == "") ? date("Y-m-01", time()) : $keydate1; } if ($keydate2 == "") { $keydate2 = ($keydate2 == "") ? date("Y-m-d", time()) : $keydate2; } ?> <dl style='width:400px;'> <dt>±â°£ : </dt> <dd><input type="text" name="keydate1" size="10" value='<?=$keydate1;?>' maxlength="10" onClick="check_mouse('SearchFrm.'+this.name)"><span>~</span><input type="text" name="keydate2" size="10" value='<?=$keydate2;?>' maxlength="10" onClick="check_mouse('SearchFrm.'+this.name)" ><input type="button" name="btnqurry" value="°Ë»ö" onClick="goSearch()"> </dd> </dl> </div><!--//replyWrap--> </form> <div class="chartWrap"> <?
$sql = "select smoption, count(*) as cnt from mBoard_install_req where smoption<>'' and substring(reg_date,1,10) >= '$keydate1' and substring(reg_date,1,10) <= '$keydate2' group by smoption order by cnt desc"; //echo $sql; $result = mysql_query($sql);
?>
<?php
$i = 0;
while($replyRow = mysql_fetch_array($result)){
$arrData[$i][1] = $replyRow['smoption']; $arrData[$i][2] = $replyRow['cnt'];
$i++; }
//print_r($arrData);
$max_cnt = 0; for($i=0;$i<count($arrData);$i++){ if($arrData[$i][2]>$max_cnt){ $max_cnt = $arrData[$i][2]; } } $max_cnt = $max_cnt+3;
//echo "<pre>";print_r($arrData);echo "</pre>";
$numline = $i-2;
$strXML = "<graph caption='´äº¯¼ö' baseFontSize='12' baseFont='±¼¸²' numberPrefix='' numdivlines='0' numVDivLines='" .$numline. "' formatNumberScale='5' decimalPrecision='0' >";
$strCategories = "<categories>";
$strDataProdA = "<dataset seriesName='´äº¯¼ö' color='4444ff' baseFontSize='12' baseFont='±¼¸²'>"; foreach ($arrData as $arSubData) { $strCategories .= "<category outCnvBaseFontColor='ff0000' baseFontColor='ff0000' name='" . $arSubData[1] . "' />"; $strDataProdA .= "<set value='" . $arSubData[2] . "' />"; } $strCategories .= "</categories>"; $strDataProdA .= "</dataset>";
$strXML = $strXML . $strCategories . $strDataProdA . $strDataProdB . $strDataProdC . "</graph>";
//echo renderChartHTML("../manage/FusionCharts/FCF_MSColumn2DLineDY.swf", "", $strXML, "productSales", 700, 400); // echo "<pre>"; print_r($arrData); echo "</pre>"; ?> <style> .div_chart {width:100%;border:0px solid red;position:relative;margin-bottom:30px;margin-top:20px;} .div_chart p {position:relative; left:-20px;} .div_chart .out_table {border-left:1px solid #e0e0e0; border-top:1px solid #e0e0e0;margin:0 auto;} .div_chart .out_table .head_td {border-bottom:1px solid #e0e0e0; border-top:0px solid #e0e0e0 !important; border-left:0px solid #e0e0e0 !important; border-right:0px solid #e0e0e0 !important;} .div_chart .out_td {vertical-align:top;height:300px;width:70px;border-bottom:1px solid #e0e0e0; border-right:1px solid #e0e0e0;} .div_chart .in_table {width:50px;margin-top:10px;margin-left:10px;position:relative;top:30px; height:330px; } .div_chart .in_table td {text-align:center;margin:0 auto;} .div_chart .bar_td {background:blue;color:white;} .div_chart .cnt_td {background:white;vertical-align:bottom;padding-bottom:3px;} .div_chart .name_td { height:30px; } </style> <div class='div_chart'> <table class='out_table'> <tr> <? for($i=0;$i<count($arrData);$i++){ $height_val = 280; $v = 280/$max_cnt;
$b_height = round($arrData[$i][2]*$v); $h_height = 280-$b_height; ?> <td class='out_td'> <table class='in_table'> <tr> <td class='cnt_td' style='height:<?=$h_height+20?>px'><?=$arrData[$i][2]?><?//=$h_height?></td> </tr> <tr> <td class='bar_td' style='height:<?=$b_height?>px'></td> </tr> <tr> <td class='name_td'><?=$arrData[$i][1]?></td> </tr> </table> </td> <? } ?> </tr> </table> </div> </div><!--//chartWrap--> <br>
</div><!--//wrap--> </body> </html>
|