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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
|
<? 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: '³â' });
$(".asBoard_list ul li").click(function(){ $v = $(this).data('val'); $("input[name='tab1']").val($v); goSearch(); }); }); </script> </head>
<body> <style> .asBoard_list{text-align: center;} .asBoard_list ul{display: inline-block;width: 98%;} .asBoard_list ul li{float:left;width:33%;text-align:center;font-weight:600;font-size:13px;padding:7px 0 10px;border-right: 1px solid #ccc;box-sizing:border-box;cursor:pointer;margin:5px 0;} .asBoard_list ul li:last-child{border-right:0;} .asBoard_list ul li:hover{background:#eff8ff;} .list_on{border-bottom: 3px solid #0098ff;color:#0098ff;} </style> <div class="wrap"> <h2>´ã´çÀÚº° ´äº¯ °Ç¼ö</h2> <div class="asBoard_list"> <!--¸Þ´ºÃß°¡--> <ul> <li class="<?php if($tab1==''){ echo "list_on"; }?>" data-val=''>Àüü</li> <li class="<?php if($tab1=='qa'){ echo "list_on"; }?>" data-val='qa'>Q&A</li> <li class="<?php if($tab1=='as'){ echo "list_on"; }?>" data-val='as'>AS</li> </ul> </div> <form name="serch_form" style="margin:0;"> <input type='hidden' name='tab1' value=''> <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"> <?
$add_where = ""; if($tab1=='as'){ $add_where = " and use_program = 'as' "; } else if($tab1=='qa'){ $add_where = " and use_program <> 'as' "; }
$sql = "select write_id, sum(ansnum) as cnt from (select write_id, count(*) AS ansnum from mBoard_as where thread = 'AA' AND from_unixtime(`reg_date`, '%Y-%m-%d') BETWEEN '$keydate1' AND '$keydate2' {$add_where} group by write_id union select write_id, count(*) AS ansnum from mBoard_build where thread = 'AA' AND from_unixtime(`reg_date`, '%Y-%m-%d') BETWEEN '$keydate1' AND '$keydate2' {$add_where} group by write_id ) c group by write_id order by cnt desc"; $result = mysql_query($sql); //print_r($sql);
/*$qry = " select name, count(name) AS ansnum from mBoard_as where thread = 'AA' AND from_unixtime(`reg_date`, '%Y-%m-%d') BETWEEN '$keydate1' AND '$keydate2' group by name order by ansnum desc" ; $result = mysql_query($qry);
$qry2 = " select name, count(name) AS ansnum from mBoard_build where thread = 'AA' AND from_unixtime(`reg_date`, '%Y-%m-%d') BETWEEN '{$keydate1}' AND '{$keydate2}' group by name order by ansnum desc" ; $result2 = mysql_query($qry2); */ ?>
<?php
$i = 0;
while($replyRow = mysql_fetch_array($result)){
$arrData[$i][1] = $replyRow['write_id']; $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> ¡Ø2016³â12¿ù01ÀϺÎÅÍ Åë°è »õ·Ó°Ô 󸮵Ȱ͸¸ ³ª¿É´Ï´Ù.
</div><!--//wrap--> </body> </html>
|