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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
|
<? @session_start();?> <? Header("P3P: CP='NOI DSP COR IVAa OUR BUS IND UNI COM NAV INT'"); include("./FusionCharts/Includes/FusionCharts.php"); if($_SESSION[ADMINID] == "mijin" || $_SESSION[ADMINID] == "psw" || $_SESSION[ADMINID] == "csh" || $_SESSION[ADMINID] == "jkj" || $_SESSION[ADMINID] == "osm" ){
} else { ?> <script> location.href = "index.php"; </script> <? } ?> <? if ($txtdate == "") { $txtdate = ($txtdate == "") ? date("Y-m-01", time()) : $txtdate; } if ($txtdate2 == "") { $txtdate2 = ($txtdate2 == "") ? date("Y-m-d", time()) : $txtdate2; } ?> <?
$nowyear = date("Y", time()); $nowmonth = date("m", time()); if ($year == "") { $year = $nowyear; } if ($month == "") { $month = $nowmonth; } ?> <script type="text/javascript" src="../onlinecs/js/PopupCalendar.js"></script> <? include("../manage/category/common.php"); ?>
<?
$userid = $_SESSION[ADMINID];
$nameQry = " SELECT admin_name From admin WHERE admin_id = '$userid' "; $nameResult = MYSQL_QUERY($nameQry);
$nameRow = MYSQL_FETCH_ARRAY($nameResult);
$adminName = $nameRow[admin_name]; mysql_close;
?>
<link href="../css/style.css" rel="stylesheet" type="text/css">
<SCRIPT LANGUAGE="JavaScript">
function programchg(chg) { var type = document.getElementsByName("programtype")[0].value; var year = document.getElementsByName("year")[0].value; var month = document.getElementsByName("month")[0].value; location.href = "program_graph.php?programtype="+type+"&year="+year+"&month="+month+""; }
function Search(){ searchFrm.submit(); } </SCRIPT> <title>°ü¸®ÀÚ ÆäÀÌÁö</title> <meta http-equiv="Content-Type" content="text/html; charset=euc-kr"> <link rel=stylesheet type=text/css href=style.css> <script language='javascript' src='../js/left_menu.js'></script> <script language='javascript' src='../js/img.js'></script> <body bgcolor=white topmargin=0 leftmargin=0> <? include("memberManage.php"); ?> <? include("../manage/category/opcommon.php"); ?>
<br>
<!-- ÇÏ´Ü --> <table border=0 cellpadding=0 cellspacing=0 width="954" align="center" > <tr> <td height="20"> </td> </tr> <tr> <td height="50"> <img src="../manage/img/program_title2.gif"> </td> </tr> <tr> <td>
<table width="1000" border="0" cellpadding="3" cellspacing="1" bgcolor="#d0daf0"> <tr bgcolor="#ffffff"> <form name='searchFrm' method='post' > <td bgcolor="#efefef" align="center"> <font color="#333333"><b>ÇÁ·Î±×·¥¸í: </td> <td bgcolor="#ffffff"> <select name="program" id="program"> <option value="0" <? if($program == "0") echo selected; ?> >Àüü <? $psql = "SELECT * FROM codes WHERE flag1 = 'A' AND cde < 100"; $presult = mysql_query($psql); while($prow = mysql_fetch_array($presult)){ ?> <option value=<?=$prow[cde]?> <? if($program == $prow[cde]) echo selected; ?> ><?=$prow[cde_nm]?> <? } ?> </select> </td>
<!-- Åë°è ¸ÞÀÎ --> <? /* $sql = "SELECT c.cde_nm, count(*) AS cnt_install, SUM(m.cnt_exec) AS cnt_exec, SUM(m.uninstalled) AS uninstalled, COUNT(d.mac_idx) AS buy FROM macs m INNER JOIN codes c ON ( m.app_code = c.cde) LEFT JOIN mac_detail d ON ( m.idx = d.mac_idx) WHERE m.frst_rgst_dtm between '$txtdate 00:00:00' AND '$txtdate2 23:59:59' GROUP BY m.app_code ORDER BY cnt_install desc limit 14 "; */ if($program != "" && $program != "0"){ $pcode = "AND app_code = '$program'"; } $sql = " SELECT SUBSTR(frst_rgst_dtm,1,10) AS ins_date, COUNT(app_code) AS pg_num FROM macs WHERE frst_rgst_dtm BETWEEN '$txtdate 00:00:00' AND '$txtdate2 23:59:59' $pcode GROUP BY SUBSTR(frst_rgst_dtm,1,10) "; $result = mysql_query($sql); // echo $sql;
?>
<td align="center" bgcolor="#efefef"> <input type='hidden' name='SearchMdiv' value='search'>
<input type='hidden' name='searchid' value='<?=$searchid;?>'> <font color="#333333"><b>±â°£¼±ÅÃ: </td> <td> <input type='text' style='height:20px;' name='txtdate' class="log" size=10 value='<?=$txtdate;?>'> <img src="../onlinecs/img/common/calendar.gif" style="cursor:hand;" align="absmiddle" border="0" onClick="popUpCalendar(this, txtdate, 'yyyy-mm-dd');"> ~ <input type='text' style='height:20px;' name='txtdate2' class="log" size=10 value='<?=$txtdate2;?>'> <img src="../onlinecs/img/common/calendar.gif" style="cursor:hand;" align="absmiddle" border="0" onClick="popUpCalendar(this, txtdate2, 'yyyy-mm-dd');"> <a href='javascript:Search();'><img src="../onlinecs/img/common/search_bt.gif" border="0" align="absmiddle" style="cursor:hand;"> </td> </form> </tr> <tr bgcolor="#02689f"> <td colspan="4"> <?php $i = 0; $week = array(ÀÏ, ¿ù, È, ¼ö, ¸ñ, ±Ý, Åä); while ($row = mysql_fetch_array($result)){ // $yoil = ¡°ÀÏ¡±
$yoil = $week[date("w", strtotime($row[ins_date]))];
$arrData[$i][1] = $yoil; $arrData[$i][2] = $row[pg_num]; // $arrData[$i][3] = $row[buy]; // $arrData[$i][4] = $row[uninstalled];
$i++; } $numline = $i-2; /* $arrData[0][1] = "Quarter 1"; $arrData[1][1] = "Quarter 2"; $arrData[2][1] = "Quarter 3"; $arrData[3][1] = "Quarter 4"; // Sales data for Product A $arrData[0][2] = 567500; $arrData[1][2] = 815300; $arrData[2][2] = 556800; $arrData[3][2] = 734500; // Sales data for Product B $arrData[0][3] = 547300; $arrData[1][3] = 594500; $arrData[2][3] = 754000; $arrData[3][3] = 456300; */ //Now, we need to convert this data into multi-series XML. //We convert using string concatenation. // $strXML - Stores the entire XML // $strCategories - Stores XML for the <categories> and child <category> elements // $strDataProdA - Stores XML for current year's sales // $strDataProdB - Stores XML for previous year's sales //Initialize <graph> element // $strXML = "<graph caption='¼³Ä¡/»èÁ¦/±¸¸Å' baseFontSize='12' baseFont='±¼¸²' numberPrefix='' formatNumberScale='5' decimalPrecision='0'>"; $strXML = "<graph caption='¼³Ä¡' baseFontSize='12' baseFont='±¼¸²' numberPrefix='' numdivlines='0' numVDivLines='" .$numline. "' formatNumberScale='5' decimalPrecision='0' >"; //Initialize <categories> element - necessary to generate a stacked chart $strCategories = "<categories>"; //Initiate <dataset> elements $strDataProdA = "<dataset seriesName='¼³Ä¡' color='0000ff' baseFontSize='12' baseFont='±¼¸²'>"; // $strDataProdB = "<dataset seriesName='±¸¸Å' color='00ff00' baseFontSize='12' baseFont='±¼¸²'>"; // $strDataProdC = "<dataset seriesName='»èÁ¦' color='ff0000' baseFontSize='12' baseFont='±¼¸²'>"; //Iterate through the data foreach ($arrData as $arSubData) { //Append <category name='...' /> to strCategories $strCategories .= "<category outCnvBaseFontColor='ff0000' baseFontColor='ff0000' name='" . $arSubData[1] . "' />"; //Add <set value='...' /> to both the datasets $strDataProdA .= "<set value='" . $arSubData[2] . "' />"; // $strDataProdB .= "<set value='" . $arSubData[3] . "' />"; // $strDataProdC .= "<set value='" . $arSubData[4] . "' />"; } //Close <categories> element $strCategories .= "</categories>"; //Close <dataset> elements $strDataProdA .= "</dataset>"; // $strDataProdB .= "</dataset>"; // $strDataProdC .= "</dataset>"; //Assemble the entire XML now $strXML = $strXML . $strCategories . $strDataProdA . $strDataProdB . $strDataProdC . "</graph>";
//Create the chart - Column 3D Chart with data from strXML variable using dataXML method echo renderChartHTML("../manage/FusionCharts/FCF_MSLine.swf", "", $strXML, "productSales", 1000, 550); ?>
</td> </tr>
</table>
</td> </tr> </table>
</td> <td width="19" > <p> </p> </td> </tr> </table>
|