@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/xml.grap.php
<? $color = array("#0C91FF", "#7AEFFF", "#00D5BF", "#0AFF52", "#F9E4B2", "#C7D300", "#F5DA00", "#CE1600", "#FF72CA", "#A69689", "#000000"); function get_Count_day($base1, $base2, $table, $id){ $ebase1 = explode("-", $base1); $ebase2 = explode("-", $base2); $time1 = mktime(0, 0, 0, $ebase1[1], $ebase1[2], $ebase1[0]); $time2 = mktime(0, 0, 0, $ebase2[1], $ebase2[2], $ebase2[0]); $long = ( $time2 - $time1 ) / (60*60*24); for($i=0; $i<=$long; $i++){ $where_date = date("Y-m-d", $time1+(60*60*24*$i)); $sql = "select total from $table where basedate='$where_date' "; $res = mysql_query($sql); $row = mysql_fetch_array(mysql_query($sql)); $count[] = $row[total]; } return $count; } #### ½Ã°£º° Ä«¿îÆ® ±¸Çϱâ #### function get_Count($base1, $base2, $table, $id){ if($base2){ $sql = "select sum(T00),sum(T01),sum(T02),sum(T03),sum(T04),sum(T05),sum(T06),sum(T07),sum(T08), "; $sql .= "sum(T09),sum(T10),sum(T11),sum(T12),sum(T13),sum(T14),sum(T15),sum(T16),sum(T17), "; $sql .= "sum(T18),sum(T19),sum(T20),sum(T21),sum(T22),sum(T23) from $table "; $sql .= "where basedate>='$base1' && basedate<='$base2'"; $row = mysql_fetch_array(mysql_query($sql)); return $row; } else { $sql = "select * from $table where basedate='$base1'"; $row = mysql_fetch_array(mysql_query($sql)); return array("$row[T00]","$row[T01]","$row[T02]","$row[T03]","$row[T04]","$row[T05]","$row[T06]", "$row[T07]","$row[T08]","$row[T09]","$row[T10]","$row[T11]","$row[T12]","$row[T13]", "$row[T14]","$row[T15]","$row[T16]","$row[T17]","$row[T18]","$row[T19]","$row[T20]", "$row[T21]","$row[T22]","$row[T23]"); } } #### ½Ã°£º° Æò±Õ°ª ±¸Çϱâ #### function get_Average($date, $id, $type, $table){ $ave1 = $date; if($type == "week"){ $edate = explode("-", $date); $etime = mktime(0, 0, 0, $edate[1], $edate[2], $edate[0]) - (60*60*24*7); $ave2 = date("Y-m-d", $etime); $div = 7; } else if($type == "month"){ $edate = explode("-", $date); $etime = mktime(0, 0, 0, $edate[1], $edate[2], $edate[0]) - (60*60*24*30); $ave2 = date("Y-m-d", $etime); $div = 30; } if($ave2){ $sql = "select sum(T00)/$div as A0, sum(T01)/$div as A1, sum(T02)/$div as A2, sum(T03)/$div as A3,"; $sql .= " sum(T04)/$div as A4, sum(T05)/$div as A5, sum(T06)/$div as A6, sum(T07)/$div as A7,"; $sql .= " sum(T08)/$div as A8, sum(T09)/$div as A9, sum(T10)/$div as A10, sum(T11)/$div as A11,"; $sql .= " sum(T12)/$div as A12, sum(T13)/$div as A13, sum(T14)/$div as A14, sum(T15)/$div as A15,"; $sql .= " sum(T16)/$div as A16, sum(T17)/$div as A17, sum(T18)/$div as A18, sum(T19)/$div as A19,"; $sql .= " sum(T20)/$div as A20, sum(T21)/$div as A21, sum(T22)/$div as A22, sum(T23)/$div as A23"; $sql .= " from $table where basedate<='$ave1' && basedate>'$ave2' "; $row = mysql_fetch_array(mysql_query($sql)); return array("$row[A0]","$row[A1]","$row[A2]","$row[A3]","$row[A4]","$row[A5]","$row[A6]", "$row[A7]","$row[A8]","$row[A9]","$row[A10]","$row[A11]","$row[A12]","$row[A13]", "$row[A14]","$row[A15]","$row[A16]","$row[A17]","$row[A18]","$row[A19]","$row[A20]", "$row[A21]","$row[A22]","$row[A23]"); } else { $sql = "select * from $table where basedate='$ave1'"; $row = mysql_fetch_array(mysql_query($sql)); return array("$row[T00]","$row[T01]","$row[T02]","$row[T03]","$row[T04]","$row[T05]","$row[T06]", "$row[T07]","$row[T08]","$row[T09]","$row[T10]","$row[T11]","$row[T12]","$row[T13]", "$row[T14]","$row[T15]","$row[T16]","$row[T17]","$row[T18]","$row[T19]","$row[T20]", "$row[T21]","$row[T22]","$row[T23]"); } } #### ±×·¡ÇÁ ´«±Ý ¹®ÀÚ Ç¥½Ã function text_default($s_text, $text_position, $text_distance, $end_for){ for($i=0; $i<10; $i++){ $text_position -= $text_distance; $text += $s_text; echo" <p:line style='height:30' from='-120,$text_position' to='-40,$text_position'> <p:fill on='True' color='black'/> <p:path textpathok='True'/> <p:stroke opacity='0' color='black'/> <p:textpath id='label_04' on='True' string='$text' style='font:normal normal normal 8pt Arial;v-text-align:right; v-rotate-letters:f;'/> </p:line> "; } } #### ±×·¡ÇÁ XÃà ´«±Ý ¹®ÀÚ Ç¥½Ã function xtext_default($s_text, $position, $text_distance, $end_for){ $text = $s_text; for($i=0; $i<$end_for; $i++){ $text_p1 = $position - 10; $text_p2 = $position + 10; if($text < 10) $gtext = "0".$text; else $gtext = $text; if($text % 2 == "0"){ echo" <p:line style='height:30' from='$text_p1,1085' to='$text_p2,1085'> <p:fill on='True' color='black'/> <p:path textpathok='True'/> <p:stroke opacity='0' color='black'/> <p:textpath id='label_04' on='True' string='$gtext' style='font:normal normal normal 8pt Arial;v-text-align:align; v-rotate-letters:f;'/> </p:line>"; } $position += $text_distance; $text++; } } #### ³¯Â¥º° ±×·¡ÇÁ XÃà ´«±Ý ¹®ÀÚ Ç¥½Ã function only_xtext_default($s_text, $position, $text_distance, $end_for){ $edate = explode("-", $s_text); $etime = mktime(0, 0, 0, $edate[1], $edate[2], $edate[0]); $text_offset = ceil(150 / $text_distance); $position = $position - 32; for($i=0; $i<$end_for; $i++){ $text_p1 = $position - 20; $text_p2 = $position + 20; $gtext = date("m¿ù dÀÏ", $etime); if($i % $text_offset == "0"){ echo" <p:line style='height:30' from='$text_p1,1085' to='$text_p2,1085'> <p:fill on='True' color='black'/> <p:path textpathok='True'/> <p:stroke opacity='0' color='black'/> <p:textpath id='label_04' on='True' string='$gtext' style='font:normal normal normal 8pt Arial;v-text-align:align; v-rotate-letters:f;'/> </p:line>"; } $position += $text_distance; $etime = $etime + (60*60*24); } } function get_Max($val){ rsort($val); $tmax = $val[0]; if(!$tmax || strlen($tmax) == 1) $max = 10; else if(strlen($tmax) == 2){ $tempmax = substr($tmax, 0, 1) + 1; $max = $tempmax."0"; } else { for($i=0; $i<strlen($tmax) - 2; $i++){ $tempmax2 .= "0"; } $tempmax = substr($tmax, 0, 2) + 1; $max = $tempmax.$tempmax2; } return $max; } function circle($objval, $oneval){ $nval = floor($objval * $oneval); if($nval < 90){ $tempv = $nval; $xval = $tempv; $yval = -90 + $xval; } else if($nval >= 90 && $nval < 180){ $tempv = $nval - 90; $xval = 90 - $tempv; $yval = 90 - $xval; } else if($nval >= 180 && $nval < 270){ $tempv = $nval - 180; $xval = -$tempv; $yval = 90 + $xval; } else if($nval >= 270 && $nval <= 360){ $tempv = $nval - 270; $xval = $tempv - 90; $yval = -90 - $xval; } return array("xval"=>$xval, "yval"=>$yval); } function Ave_chart_Make($ave_val, $one_height, $x_distance){ //$x_distance = 20; //$one_height = 10; //echo $ave_val; #### 30, 50 #### $start_height1 = 1000; $start_height2 = 1002; $ave_start = 40 - $x_distance; $ave_end = $ave_start + $x_distance; $x_start = 0; $x_end = $x_distance;; for($i=0; $i<sizeof($ave_val); $i++){ $now_height1 = round(1002 - ($ave_val[$i] * $one_height)); $now_height2 = $now_height1 - 2; $x_position1 = $x_start; $x_position2 = $x_end; $ave_position1 = $ave_start; $ave_position2 = $ave_end; if($i == "0" || ($start_height1 < 0 && $now_height2 < 0)){ #### ÇöÀç ³ôÀ̰¡ ±×·¡ÇÁ ÁÂÇ¥¸¦ ÃʰúÇÒ¶§ #### } else if($now_height2 < 0){ $perc = 1000 / (1025-$now_height1); $now_height3 = 25; $now_height4 = 0; $minus_x = round($x_distance - ($x_distance * $perc)); $x_position1 = $x_start; $x_position2 = $x_end - $minus_x; $ave_position1 = $ave_start; $ave_position2 = $ave_end - $minus_x; echo" <p:shape style='position:absolute;width:100%;height:100%' path='m $x_position1,$start_height1 l $x_position1,$start_height1 $ave_position1,$start_height2 $ave_position2,$now_height3 $x_position2,$now_height4 x e' fillcolor='#FF6000' id='ave_$i'> <p:stroke weight='1px' color='#FF6000' opacity='1'/></p:shape>"; #### ÀÌÀü ³ôÀ̰¡ ±×·¡ÇÁ ÁÂÇ¥¸¦ ÃʰúÇÒ¶§ #### } else if($start_height1 < 0){ $perc = 1000 / (1000-$start_height1); $start_height1 = 0; $start_height2 = 25; $plus_x = round($x_distance - ($x_distance * $perc)); $x_position1 = $x_start + $plus_x; $x_position2 = $x_end; $ave_position1 = $ave_start + $plus_x; $ave_position2 = $ave_end; echo" <p:shape style='position:absolute;width:100%;height:100%' path='m $x_position1,$start_height1 l $x_position1,$start_height1 $ave_position1,$start_height2 $ave_position2,$now_height1 $x_position2,$now_height2 x e' fillcolor='#FF6000' id='ave_$i'> <p:stroke weight='1px' color='#FF6000' opacity='1'/></p:shape>"; } else { echo" <p:shape style='position:absolute;width:100%;height:100%' path='m $x_position1,$start_height1 l $x_position1,$start_height1 $ave_position1,$start_height2 $ave_position2,$now_height1 $x_position2,$now_height2 x e' fillcolor='#FF6000' id='ave_$i'> <p:stroke weight='1px' color='#FF6000' opacity='1'/></p:shape>"; } $ave_end += $x_distance; $x_end += $x_distance; $x_start += $x_distance; $ave_start += $x_distance; $start_height1 = $now_height2; $start_height2 = $now_height1; } } function Ave_chart_Make1($ave_val, $one_height, $x_distance){ #### 30, 50 #### $start_height1 = 1000 - ($ave_val[0] * $one_height); $start_height2 = 1025 - ($ave_val[0] * $one_height); $ave_start = 25; $ave_end = $ave_start+$x_distanc; $x_start = $x_distance; $x_end = $x_distance;; for($i=1; $i<sizeof($ave_val); $i++){ $ave_end += $x_distance; $x_end += $x_distance; $now_height1 = round(1025 - ($ave_val[$i] * $one_height)); $now_height2 = round(1000 - ($ave_val[$i] * $one_height)); if($now_height1 < 25){ echo"<br><br><br><br><br><br><Br><br>"; echo $ave_val[$i] * $one_height; $perc = 1000 / (1025-$now_height1); $now_height1 = 25; $now_height2 = 0; $minus_x = round($x_distance - ($x_distance * $perc)); echo"<br>"; echo $x_position1 = $x_start; echo $x_position2 = $x_end - $minus_x; //echo $x_position2 = $x_end; /*$now_height1 = 25;*/ $ave_position1 = $ave_start; $ave_position2 = $ave_end - $minus_x; echo" <p:shape style='position:absolute;width:100%;height:100%' path='m $x_position1,$start_height1 l $x_position1,$start_height1 $ave_position1,$start_height2 $ave_position2,$now_height1 $x_position2,$now_height2 x e' fillcolor='#FF6000' id='ave_$i'> <p:stroke weight='1px' color='#FF6000' opacity='1'/></p:shape>"; } else { $x_position1 = $x_start; $x_position2 = $x_end; $ave_position1 = $ave_start; $ave_position2 = $ave_end; echo" <p:shape style='position:absolute;width:100%;height:100%' path='m $x_position1,$start_height1 l $x_position1,$start_height1 $ave_position1,$start_height2 $ave_position2,$now_height1 $x_position2,$now_height2 x e' fillcolor='#FF6000' id='ave_$i'> <p:stroke weight='1px' color='#FF6000' opacity='1'/></p:shape>"; } $x_start += $x_distance; $ave_start += $x_distance; $start_height1 = $now_height2; $start_height2 = $now_height1; } } ?>