@Ghazascanner
_2019runbot
Ghazascanner File Manager
server :Linux adweb87 2.6.32-754.el6.x86_64 #1 SMP Tue Jun 19 21:26:04 UTC 2018 x86_64
Current Path :
/
home
/
sanchung
/
public_html
/
admin
/
wlog
/
Path :
Upload File :
New :
File
Dir
/home/sanchung/public_html/admin/wlog/log_count.php
<? $dbnum = "1"; $table = "psk_count$dbnum"; if(!$compare) $compare = ""; if(!$basedate1) $basedate1 = date("Y-m-d"); // ´ÜÀ§ $gtxt = array("00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23"); $row = $mysql->row($table, "*", "where basedate='$basedate1'", 0); for($i=0; $i<24; $i++){ $column = ($i < 10) ? "T0".$i : "T".$i; $gval[$i] = $row[$column]; } $graph[w] = 705; // ±×·¡ÇÁ ³ÐÀÌ $graph[h] = 300; // ±×·¡ÇÁ ³ÐÀÌ $graph[outcolor] = "#999"; // Å׵θ® »ö»ó $graph[grapcolor] = "#333"; // x, y ¼± »ö»ó $graph[barcolor] = "#399"; // ¸·´ë±×·¡ÇÁ »ö»ó $graph[unit] = "(´ÜÀ§ : ½Ã)"; // ±×·¡ÇÁ ÇÏ´Ü ¹®±¸ $bgraph->barGraph($graph); $_expdate = explode("-", $basedate1); $_today = mktime(0, 0, 0, $_expdate[1], $_expdate[2], $_expdate[0]); switch($avetype){ case"week": $ave_vtext = "1ÁÖÀÏÆò±Õ"; $addcolumn = "sum(T00), sum(T01), sum(T02), sum(T03), sum(T04), sum(T05), sum(T06), sum(T07), sum(T08), sum(T09), "; $addcolumn .= "sum(T10), sum(T11), sum(T12), sum(T13), sum(T14), sum(T15), sum(T16), sum(T17), sum(T18), sum(T19), "; $addcolumn .= "sum(T20), sum(T21), sum(T22), sum(T23)"; $arow = $mysql->row($table, "$addcolumn", "where basedate<'$basedate1' && basedate>='".date("y-m-d", $_today-(60*60*24*7))."'"); for($i=0; $i<24; $i++){ $avalue[$i] = round($arow[$i] / 7, 2); } break; case"month": $ave_vtext = "1°³¿ùÆò±Õ"; $addcolumn = "sum(T00), sum(T01), sum(T02), sum(T03), sum(T04), sum(T05), sum(T06), sum(T07), sum(T08), sum(T09), "; $addcolumn .= "sum(T10), sum(T11), sum(T12), sum(T13), sum(T14), sum(T15), sum(T16), sum(T17), sum(T18), sum(T19), "; $addcolumn .= "sum(T20), sum(T21), sum(T22), sum(T23)"; $arow = $mysql->row($table, "$addcolumn", "where basedate<'$basedate1' && basedate>='".date("y-m-d", $_today-(60*60*24*30))."'"); for($i=0; $i<24; $i++){ $avalue[$i] = round($arow[$i] / 30, 2); } break; default: $ave_vtext = "¾îÁ¦"; $arow = $mysql->row($table, "*", "where basedate='".date("y-m-d", $_today-(60*60*24*1))."'"); for($i=0; $i<24; $i++){ $column = ($i < 10) ? "0".$i : $i; $avalue[$i] = $arow["T".$column]; } break; } echo"<br /> <div style='position:relative; margin:2px 0px'> <h3>»ó¼¼Åë°è</h3> <p style='position:absolute; top:0px; right:5px'> ºñ±³°ª : <a href='$PHP_SELF?basedate1=$basedate1&avetype=day&amode=$amode'>¾îÁ¦</a> <a href='$PHP_SELF?basedate1=$basedate1&avetype=week&amode=$amode'>1ÁÖÀÏÆò±Õ</a> <a href='$PHP_SELF?basedate1=$basedate1&avetype=month&amode=$amode'>1°³¿ùÆò±Õ</a> </p> </div> <table id='l-table'> <thead> <tr> <th width='20%'>½Ã°£</th> <th width='20%'>Ä«¿îÆ® ($basedate1)</th> <th width='20%'>$ave_vtext</th> <th width='20%'>Æò±Õ´ëºñ</th> <th width='20%'>¹éºÐÀ²</th> </tr> </thead>"; $_total = array_sum($gval); $_ave_total = array_sum($avalue); $_tcomparesum = $_total - $_ave_total; if($_tcomparesum == 0) $_tcompare = "$_tcomparesum -"; else if($_tcomparesum > 0) $_tcompare = "<font style='color:#F00'>$_tcomparesum <img src='./img/uparrow.gif' alt='' /></font>"; else if($_tcomparesum < 0) $_tcompare = "<font style='color:#00F'>$_tcomparesum <img src='./img/downarrow.gif' alt='' /></font>"; if($_total) $perc = round(($_total / $_total) * 100 , 2); else $perc = 0; echo" <tfoot> <tr> <td height='20' style='background-color:#EEE'><b>TOTAL</b></td> <td style='background-color:#EEE'><b>$_total</b></td> <td style='background-color:#EEE'><b>$_ave_total</b></td> <td style='text-align:right; padding-right:35px; background-color:#EEE'><b>$_tcompare</b></td> <td style='text-align:right; padding-right:30px; background-color:#EEE'><b>$perc %</b></td> </tr> </tfoot> <tbody>"; reset($gval); reset($avalue); while(list($key, $val) = each($gval)){ $time = ($key < 10) ? "0$key:00 ~ 0$key:59" : "$key:00 ~ $key:59"; $_count = ($val) ? $val : "0"; $comparesum = $val - $avalue[$key]; if($comparesum == 0) $compare = "$comparesum -"; else if($comparesum > 0) $compare = "<font style='color:#F00'>$comparesum <img src='./img/uparrow.gif' alt='' /></font>"; else if($comparesum < 0) $compare = "<font style='color:#00F'>$comparesum <img src='./img/downarrow.gif' alt='' /></font>"; if($_count) $perc = round(($_count / $_total) * 100 , 2); else $perc = 0; echo" <tr> <td height='20'>$time</td> <td>$_count</td> <td>$avalue[$key]</td> <td style='text-align:right; padding-right:35px'>$compare</td> <td style='text-align:right; padding-right:30px'>$perc %</td> </tr>"; } echo" </tbody> </table> "; ?>