home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 October / CMCD1004.ISO / Software / Shareware / Programare / cnstats / reports / attendance.php < prev    next >
Encoding:
PHP Script  |  2004-06-21  |  18.3 KB  |  451 lines

  1. <?php
  2. $filter=$HTTP_GET_VARS["filter"];
  3. $type=intval($HTTP_GET_VARS["type"]);
  4. $day=intval($HTTP_GET_VARS["day"]);
  5. $month=intval($HTTP_GET_VARS["month"]);
  6. $year=intval($HTTP_GET_VARS["year"]);
  7. $prom=intval($HTTP_GET_VARS["prom"]);
  8. $cb_hits=$HTTP_GET_VARS["cb_hits"];
  9. $cb_hosts=$HTTP_GET_VARS["cb_hosts"];
  10. $cb_users=$HTTP_GET_VARS["cb_users"];
  11. $graph=intval($HTTP_GET_VARS["graph"]);
  12. $s=$HTTP_GET_VARS["s"];
  13.     
  14. $r=mysql_query("SHOW TABLE STATUS");
  15. $size=0;
  16. while ($a=mysql_fetch_array($r,MYSQL_ASSOC)) {
  17.     while (list ($key, $val) = each ($a)) {
  18.         if ($key=="Data_length" && (substr($tname,0,4)=="cns_")) $size+=$val;
  19.         if ($key=="Index_length" && (substr($tname,0,4)=="cns_")) $size+=$val;
  20.         if ($key=="Name") $tname=$val;
  21.         if ($key=="Rows" && $tname=="cns_log") $rows=$val;
  22.         }
  23.     }
  24.  
  25. $ADMENU=$LANG["basesize"].": <B>".cNumber($size)."</B><br>".$LANG["baserows"].":<br><B>".cNumber($rows)."</B>";
  26.  
  27. function stable($color,$text) {
  28.     return("<table cellspacing=0 cellpadding=0 border=0><tr><td><table style='width:12px;height:12px;' cellspacing=1 cellpadding=1 border=0 bgcolor='black'><tr><td bgcolor='".$color."'></td></tr></table></td><td> <B>".$text."</B></td></tr></table>");
  29.     }
  30.  
  31. // ┬⌡εΣφ√σ ∩α≡α∞σ≥≡√
  32. if ($HTTP_GET_VARS["second"]!=1) {
  33.     $cb_hosts=$cb_hits=$cb_users=$table="on";
  34.     $type=1;
  35.     }
  36.  
  37. // ═α≈αδⁿφ√σ τφα≈σφΦ 
  38. $mini=$minh=$minu=99999999;
  39. $maxi=$maxh=$maxu=0;
  40.  
  41. // ╨α±≈Φ≥√Γασ∞ τφα≈σφΦ  Σδ  π≡α⌠ΦΩεΓ
  42. $DATA["x"]=$DATA[0]=$DATA[1]=$DATA[2]=Array();
  43. $limit=44;
  44.  
  45. // ┬√ΓεΣΦ∞ ≥αßδΦ÷≤ #############################################################
  46. if ($type==0) { /* ╧ε ≈α±α∞ ############################################# */
  47.  
  48.     $tm=time()+$COUNTER["timeoffset"];
  49.     $sdate=date("Y-m-d H:i:s",mktime(0,0,0,date("m",$tm) ,date("d",$tm),date("Y",$tm)));
  50.     $edate=date("Y-m-d H:i:s",mktime(0,0,0,date("m",$tm) ,date("d",$tm)+1,date("Y",$tm)));
  51.  
  52.     $r=cnstats_sql_query("select LEFT(date,13),count(page),sum(type),sum(type1) from cns_log WHERE date>'$sdate' AND date<'$edate' GROUP BY LEFT(date,13) ORDER BY date desc");
  53.  
  54.     $html.="<table width=\"".$TW."\" cellspacing=\"1\" cellpadding=\"3\" bgcolor=\"#D4F3D7\">";
  55.     $html.="<tr class=\"tbl2\"><td align=\"center\"><b>".$LANG["date"]."</b></td><td align=\"center\"><b>".$LANG["hours"]."</b></td><td align=\"center\" width=\"100\"><b>".$LANG["hits"]."</b></td><td align=\"center\" width=\"100\"><b>".$LANG["hosts"]."</b></td><td align=\"center\" width=\"100\"><b>".$LANG["users"]."</b></td></tr>";
  56.  
  57.     if (mysql_num_rows($r)!=0) $date=substr(mysql_result($r,0,0),0,11);
  58.     else $date=date("Y-m-d H:i:s");
  59.  
  60.     for ($i=0;$i<24;$i++) {
  61.         $a_hits[$i]="-";
  62.         $a_hosts[$i]="-";
  63.         $a_users[$i]="-";
  64.         } /* of for */
  65.  
  66.     for ($i=0;$i<mysql_num_rows($r);$i++) {
  67.         $h=intval(substr(mysql_result($r,$i,0),11));
  68.         $a_hits[$h]=mysql_result($r,$i,1);
  69.         $a_hosts[$h]=mysql_result($r,$i,2);
  70.         $a_users[$h]=mysql_result($r,$i,3);
  71.  
  72.         if ($mini>$a_hits[$h]) $mini=$a_hits[$h];
  73.         if ($maxi<$a_hits[$h]) $maxi=$a_hits[$h];
  74.  
  75.         if ($minh>$a_hosts[$h]) $minh=$a_hosts[$h];
  76.         if ($maxh<$a_hosts[$h]) $maxh=$a_hosts[$h];
  77.  
  78.         if ($minu>$a_users[$h]) $minu=$a_users[$h];
  79.         if ($maxu<$a_users[$h]) $maxu=$a_users[$h];
  80.         } /* of for */
  81.  
  82.     $thi=$tho=$tus=0;
  83.     for ($i=23;$i>=0;$i--) {
  84.         if ($class!="tbl1") $class="tbl1"; else $class="tbl2";
  85.         $html.="<tr class=\"".$class."\">\n";
  86.  
  87.         $html.="\t<td align=\"center\">".date($CONFIG["date_format"],strtotime($date))."</td>\n";
  88.         $html.="\t<td align=\"center\">".$i."</td>\n";
  89.  
  90.         $t1=$t2="";
  91.         if ($a_hits[$i]==$mini) {$t1="<font color=red><B>";$t2="</font></B>";}
  92.         if ($a_hits[$i]==$maxi) {$t1="<font color=blue><B>";$t2="</font></B>";}
  93.         $html.="\t<td align=\"right\">".$t1.$a_hits[$i].$t2."</td>\n";
  94.  
  95.         $t1=$t2="";
  96.         if ($a_hosts[$i]==$minh) {$t1="<font color=red><B>";$t2="</font></B>";}
  97.         if ($a_hosts[$i]==$maxh) {$t1="<font color=blue><B>";$t2="</font></B>";}
  98.         $html.="\t<td align=\"right\">".$t1.$a_hosts[$i].$t2."</td>\n";
  99.  
  100.         $t1=$t2="";
  101.         if ($a_users[$i]==$minu) {$t1="<font color=red><B>";$t2="</font></B>";}
  102.         if ($a_users[$i]==$maxu) {$t1="<font color=blue><B>";$t2="</font></B>";}
  103.         $html.="\t<td align=\"right\">".$t1.$a_users[$i].$t2."</td>\n";
  104.  
  105.         if ($cb_hits=="on") $DATA[0][]=intval($a_hits[$i]);
  106.         if ($cb_users=="on") $DATA[1][]=intval($a_users[$i]);
  107.         if ($cb_hosts=="on") $DATA[2][]=intval($a_hosts[$i]);
  108.         $DATA["x"][]=str_pad($i,2,"0",STR_PAD_LEFT);
  109.  
  110.         if ($hits!="-") $thi+=$a_hits[$i];
  111.         if ($hosts!="-") $tho+=$a_hosts[$i];
  112.         if ($users!="-") $tus+=$a_users[$i];
  113.         $html.="</tr>\n";
  114.         } /* of for */
  115.     $html.="<tr class=\"tbl2\"><td align=\"center\" colspan=\"2\"><b>".$LANG["total"]."</b></td><td align=\"right\" width=\"100\"><b>".$thi."</b></td><td align=right width=100><b>$tho</b></td><td align=right width=100><b>$tus</b></td></tr>";
  116.     $html.="</table></center>";
  117.     } /* of if ($type==0) */
  118.  
  119. if ($type==1) { /* ╧ε Σφ ∞ ############################################## */
  120.     $r=cnstats_sql_query("select LEFT(date,10),hits,hosts,users from cns_counter_total ORDER BY date desc  LIMIT $limit;");
  121.  
  122.     $html.="<center><br><table width=".$TW." cellspacing=1 cellpadding=3 bgcolor='#D4F3D7'>";
  123.     $html.="<tr class=tbl2><td align=center><b>".$LANG["date"]."</b></td><td align=center width=100><B>".$LANG["hits"]."</b></td><td align=center width=100><b>".$LANG["hosts"]."</b></td><td align=center width=100><b>".$LANG["users"]."</b></td></tr>";
  124.  
  125.     $thi=$tho=$tus=0;
  126.     for ($i=0;$i<mysql_num_rows($r);$i++) {
  127.         $date=mysql_result($r,$i,0);
  128.         $date=substr($date,0,4).substr($date,5,2).substr($date,8,2);
  129.         $a_hits[$date]=mysql_result($r,$i,1);
  130.         $a_hosts[$date]=mysql_result($r,$i,2);
  131.         $a_users[$date]=mysql_result($r,$i,3);
  132.  
  133.         if ($mini>$a_hits[$date]) $mini=$a_hits[$date];
  134.         if ($maxi<$a_hits[$date]) $maxi=$a_hits[$date];
  135.  
  136.         if ($minh>$a_hosts[$date]) $minh=$a_hosts[$date];
  137.         if ($maxh<$a_hosts[$date]) $maxh=$a_hosts[$date];
  138.  
  139.         if ($minu>$a_users[$date]) $minu=$a_users[$date];
  140.         if ($maxu<$a_users[$date]) $maxu=$a_users[$date];
  141.         } /* of for */
  142.  
  143.     for ($i=0;$i<$limit;$i++) {
  144.         $time=time()-(86400*($i+1));
  145.         $date=date("Ymd",$time);
  146.         $pdate=date("Y-m-d",$time);
  147.         if ($class!="tbl1") $class="tbl1"; else $class="tbl2";
  148.         $html.="<tr class=$class>\n";
  149.         $html.="\t<td align=center>".date($CONFIG["date_format"],strtotime($pdate))."</td>\n";
  150.  
  151.         $hits=$a_hits[$date]; 
  152.         $hosts=$a_hosts[$date]; 
  153.         $users=$a_users[$date]; 
  154.  
  155.         if (empty($hits)) $hits="-"; else $thi+=$hits;
  156.         if (empty($hosts)) $hosts="-"; else $tho+=$hosts;
  157.         if (empty($users)) $users="-"; else $tus+=$users;
  158.  
  159.         $t1=$t2="";
  160.         if ($hits==$mini) {$t1="<font color=red><B>";$t2="</font></B>";}
  161.         if ($hits==$maxi) {$t1="<font color=blue><B>";$t2="</font></B>";}
  162.         $html.="\t<td align=right>".$t1.$hits.$t2."</td>\n";
  163.  
  164.         $t1=$t2="";
  165.         if ($hosts==$minh) {$t1="<font color=red><B>";$t2="</font></B>";}
  166.         if ($hosts==$maxh) {$t1="<font color=blue><B>";$t2="</font></B>";}
  167.         $html.="\t<td align=right>".$t1.$hosts.$t2."</td>\n";
  168.  
  169.         $t1=$t2="";
  170.         if ($users==$minu) {$t1="<font color=red><B>";$t2="</font></B>";}
  171.         if ($users==$maxu) {$t1="<font color=blue><B>";$t2="</font></B>";}
  172.         $html.="\t<td align=right>".$t1.$users.$t2."</td>\n";
  173.  
  174.         if ($cb_hits=="on") $DATA[0][]=intval($hits);
  175.         if ($cb_users=="on") $DATA[1][]=intval($users);
  176.         if ($cb_hosts=="on") $DATA[2][]=intval($hosts);
  177.         $DATA["x"][]=date($CONFIG["shortdm_format"],$time);
  178.  
  179.         $html.="</tr>\n";
  180.         } /* of for */
  181.     $html.="<tr class=tbl2><td align=center><b>".$LANG["total"]."</b></td><td align=right width=100><b>$thi</b></td><td align=right width=100><b>$tho</b></td><td align=right width=100><b>$tus</b></td></tr>";
  182.     $html.="</table></center>";
  183.     } /* of if ($type==1) */
  184.  
  185. if ($type==2) { /* ╧ε φσΣσδ ∞ ########################################### */
  186.     $r=cnstats_sql_query("select LEFT(date,10),hits,hosts,users from cns_counter_total ORDER BY date desc  LIMIT ".(7*$limit).";");
  187.  
  188.     $html.="<center><br><table width=".$TW." cellspacing=1 cellpadding=3 bgcolor='#D4F3D7'>";
  189.     $html.="<tr class=tbl2><td align=center><b>".$LANG["date"]."</b></td><td align=center width=100><b>".$LANG["hits"]."</b></td><td align=center width=100><b>".$LANG["hosts"]."</b></td><td align=center width=100><b>".$LANG["users"]."</b></td></tr>";
  190.     $thi=$tho=$tus=0;
  191.     for ($i=0;$i<mysql_num_rows($r);$i++) {
  192.         $date=mysql_result($r,$i,0);
  193.         $date=substr($date,0,4).substr($date,5,2).substr($date,8,2);
  194.         $a_hits[$date]=mysql_result($r,$i,1);
  195.         $a_hosts[$date]=mysql_result($r,$i,2);
  196.         $a_users[$date]=mysql_result($r,$i,3);
  197.         } /* of for */
  198.     $w=0;
  199.     $day_of_w=1;        
  200.     $w_hits=Array();
  201.     $w_hosts=Array();
  202.     $w_users=Array();
  203.     for ($i=0;$i<(7*$limit);$i++) {
  204.         $time=time()-(86400*($i+1));
  205.         $date=date("Ymd",$time);
  206.  
  207.         $w_hits[$w]=$w_hits[$w]+$a_hits[$date];
  208.         $w_hosts[$w]=$w_hosts[$w]+$a_hosts[$date];
  209.         $w_users[$w]=$w_users[$w]+$a_users[$date];
  210.         $day_of_w++;
  211.         if ($day_of_w>7) {$day_of_w=1;$w++;}
  212.         } /* of for */
  213.  
  214.  
  215.     for ($i=0;$i<$limit;$i++) {
  216.         if ($mini>$w_hits[$i] && $w_hits[$i]!=0) $mini=$w_hits[$i];
  217.         if ($maxi<$w_hits[$i]) $maxi=$w_hits[$i];
  218.  
  219.         if ($minh>$w_hosts[$i] && $w_hosts[$i]!=0) $minh=$w_hosts[$i];
  220.         if ($maxh<$w_hosts[$i]) $maxh=$w_hosts[$i];
  221.  
  222.         if ($minu>$w_users[$i] && $w_users[$i]!=0) $minu=$w_users[$i];
  223.         if ($maxu<$w_users[$i]) $maxu=$w_users[$i];
  224.         }
  225.  
  226.     for ($i=0;$i<$limit;$i++) {
  227.         if ($class!="tbl1") $class="tbl1"; else $class="tbl2";
  228.         $html.="<tr class=\"".$class."\">\n";
  229.         $date1=date($CONFIG["date_format"],time()-((7*($i+1))*86400));
  230.         $date2=date($CONFIG["date_format"],time()-((7*$i+1)*86400));
  231.         $html.="\t<td align=\"center\">".$date1." - ".$date2."</td>\n";
  232.  
  233.         if ($cb_hits=="on") $DATA[0][]=intval($w_hits[$i]);
  234.         if ($cb_users=="on") $DATA[1][]=intval($w_users[$i]);
  235.         if ($cb_hosts=="on") $DATA[2][]=intval($w_hosts[$i]);
  236.         $DATA["x"][]=date($CONFIG["shortdm_format"],time()-((7*($i+1))*86400));
  237.  
  238.         $hits=$w_hits[$i];
  239.         $hosts=$w_hosts[$i];
  240.         $users=$w_users[$i]; 
  241.         
  242.         if (empty($hits)) $hits="-"; else $thi+=$hits;
  243.         if (empty($hosts)) $hosts="-"; else $tho+=$hosts;
  244.         if (empty($users)) $users="-"; else $tus+=$users;
  245.  
  246.         $t1=$t2="";
  247.         if ($hits==$mini) {$t1="<font color=red><B>";$t2="</font></B>";}
  248.         if ($hits==$maxi) {$t1="<font color=blue><B>";$t2="</font></B>";}
  249.         $html.="\t<td align=right>".$t1.$hits.$t2."</td>\n";
  250.  
  251.         $t1=$t2="";     
  252.         if ($hosts==$minh) {$t1="<font color=red><B>";$t2="</font></B>";}
  253.         if ($hosts==$maxh) {$t1="<font color=blue><B>";$t2="</font></B>";}
  254.         $html.="\t<td align=right>".$t1.$hosts.$t2."</td>\n";
  255.  
  256.         $t1=$t2="";
  257.         if ($users==$minu) {$t1="<font color=red><B>";$t2="</font></B>";}
  258.         if ($users==$maxu) {$t1="<font color=blue><B>";$t2="</font></B>";}
  259.         $html.="\t<td align=right>".$t1.$users.$t2."</td>\n";
  260.  
  261.         $html.="</tr>\n";
  262.         } /* of for */
  263.     $html.="<tr class=tbl2><td align=center><b>".$LANG["total"]."</b></td><td align=right width=100><b>$thi</b></td><td align=right width=100><b>$tho</b></td><td align=right width=100><b>$tus</b></td></tr>";
  264.     $html.="</table></center>";
  265.     } /* of if ($type==2) */
  266.  
  267. if ($type==3) { /* ╧ε ∞σ± ÷α∞ ########################################### */
  268.     $r=cnstats_sql_query("select LEFT(date,7),sum(hits),sum(hosts),sum(users) from cns_counter_total GROUP BY LEFT(date,7) ORDER BY date desc LIMIT $limit;");
  269.  
  270.     $html.="<center><br><table width=".$TW." cellspacing=1 cellpadding=3 bgcolor='#D4F3D7'>";
  271.     $html.="<tr class=tbl2><td align=center><b>".$LANG["date"]."</b></td><td align=center width=100><b>".$LANG["hits"]."</b></td><td align=center width=100><b>".$LANG["hosts"]."</b></td><td align=center width=100><b>".$LANG["users"]."</b></td></tr>";
  272.     $thi=$tho=$tus=0;
  273.  
  274.     for ($i=0;$i<mysql_num_rows($r);$i++) {
  275.         $date=mysql_result($r,$i,0);
  276.         $date=substr($date,0,4).substr($date,5,2);
  277.         $a_hits[$date]=mysql_result($r,$i,1);
  278.         $a_hosts[$date]=mysql_result($r,$i,2);
  279.         $a_users[$date]=mysql_result($r,$i,3);
  280.  
  281.         if ($mini>$a_hits[$date]) $mini=$a_hits[$date];
  282.         if ($maxi<$a_hits[$date]) $maxi=$a_hits[$date];
  283.  
  284.         if ($minh>$a_hosts[$date]) $minh=$a_hosts[$date];
  285.         if ($maxh<$a_hosts[$date]) $maxh=$a_hosts[$date];
  286.  
  287.         if ($minu>$a_users[$date]) $minu=$a_users[$date];
  288.         if ($maxu<$a_users[$date]) $maxu=$a_users[$date];
  289.  
  290.         } /* of for */
  291.  
  292.     for ($i=0;$i<$limit;$i++) {
  293.         $date=date( "Ym", mktime(0,0,0,date("m")-$i,0,date("Y")));
  294.         $pdate=date( $CONFIG["shortdate_format"], mktime(0,0,0,date("m")-$i,0,date("Y")));
  295.         if ($class!="tbl1") $class="tbl1"; else $class="tbl2";
  296.         $html.="<tr class=".$class.">\n";
  297.         $html.="\t<td align=center>".$pdate."</td>\n";
  298.  
  299.         $hits=$a_hits[$date]; 
  300.         $hosts=$a_hosts[$date];
  301.         $users=$a_users[$date];
  302.  
  303.         if ($cb_hits=="on") $DATA[0][]=intval($hits);
  304.         if ($cb_users=="on") $DATA[1][]=intval($users);
  305.         if ($cb_hosts=="on") $DATA[2][]=intval($hosts);
  306.         $DATA["x"][]=$pdate;
  307.  
  308.         if (empty($hits)) $hits="-"; else $thi+=$hits;
  309.         if (empty($hosts)) $hosts="-"; else $tho+=$hosts;
  310.         if (empty($users)) $users="-"; else $tus+=$users;
  311.  
  312.         $t1=$t2="";
  313.         if ($hits==$mini) {$t1="<font color=red><B>";$t2="</font></B>";}
  314.         if ($hits==$maxi) {$t1="<font color=blue><B>";$t2="</font></B>";}
  315.         $html.="\t<td align=right>".$t1.$hits.$t2."</td>\n";
  316.  
  317.         $t1=$t2="";     
  318.         if ($hosts==$minh) {$t1="<font color=red><B>";$t2="</font></B>";}
  319.         if ($hosts==$maxh) {$t1="<font color=blue><B>";$t2="</font></B>";}
  320.         $html.="\t<td align=right>".$t1.$hosts.$t2."</td>\n";
  321.  
  322.         $t1=$t2="";
  323.         if ($users==$minu) {$t1="<font color=red><B>";$t2="</font></B>";}
  324.         if ($users==$maxu) {$t1="<font color=blue><B>";$t2="</font></B>";}
  325.         $html.="\t<td align=right>".$t1.$users.$t2."</td>\n";
  326.  
  327.         $html.="</tr>\n";
  328.         } /* of for */
  329.     $html.="<tr class=tbl2><td align=center><b>".$LANG["total"]."</b></td><td align=right width=100><b>$thi</b></td><td align=right width=100><b>$tho</b></td><td align=right width=100><b>$tus</b></td></tr>";
  330.     $html.="</table></center>";
  331.     } /* of if ($type==3) */
  332.  
  333. $DATA[0]=array_reverse($DATA[0]);
  334. $DATA[1]=array_reverse($DATA[1]);
  335. $DATA[2]=array_reverse($DATA[2]);
  336. $DATA["x"]=array_reverse($DATA["x"]);
  337.  
  338. $HTTP_SESSION_VARS["DATA"]=$DATA;
  339.  
  340. // ┼±δΦ Γ√ß≡αφ π≡α⌠ΦΩ Γ ≡≤≈φ≤■, ≥ε Φπφε≡Φ≡≤σ∞ φα±≥≡εΘΩΦ
  341. if (isset($HTTP_GET_VARS["graph"])) $CONFIG["diagram"]=intval($HTTP_GET_VARS["graph"]);
  342. else $graph=intval($CONFIG["diagram"]);
  343.  
  344. // ╬∩≡σΣσδ σ∞ ≥Φ∩ π≡α⌠ΦΩα
  345. $GDVERSION=gdVersion();
  346.  
  347. // ┼±δΦ GD 2.0, φε αφ≥Φ-αδΦα±Φφπ ε≥Ωδ■≈σφ, ≥ε Σσδασ∞ ΓΦΣ,
  348. // ≈≥ε GD 1.0 Φ ≥επΣα π≡α⌠ΦΩΦ ±πδαµΦΓα≥ⁿ±  φσ ß≤Σ≤≥
  349. if ($GDVERSION==2 && $CONFIG["antialias"]==0) $GDVERSION=1;
  350.  
  351. // ┼±δΦ φσ≥ GD, ≥ε Γ δ■ßε∞ ±δ≤≈ασ ΓΩδ■≈ασ∞ HTML π≡α⌠ΦΩ
  352. if ($GDVERSION==0) $CONFIG["diagram"]=0;
  353.  
  354. if ($CONFIG["diagram"]>0 && $CONFIG["diagram"]<4) {
  355.     switch ($CONFIG["diagram"]) {
  356.         case  2: $g="lines"; break;
  357.         case  3: $g="bar"; break;
  358.         default: $g="3d";
  359.         }
  360.     $img_smooth="s=".($s=="on"?1:0);
  361.     $img_antialias="antialias=".($GDVERSION==1?0:1);
  362.     print "<img src=\"graph/".$g.".php?".$img_smooth."&".$img_antialias."&rnd=".time()."\" width=\"".$IMGW."\" height=\"".$IMGH."\"><br>\n";
  363.     print "<img src=\"img/none.gif\" width=\"1\" height=\"5\">";
  364.     }
  365. else include "graph/html.php";
  366. ?>
  367.  
  368.  
  369. <br>
  370. <script language="JavaScript" type="text/javascript">
  371. <!--
  372. function redraw(i) {
  373.     var ge=document.getElementById('ge');ge.value=i;
  374.     var gf=document.getElementById('gf');gf.submit();
  375.     }
  376. //-->
  377. </script>
  378.  
  379. <center>
  380. <form action="index.php" method="get" class="m0" id="gf">
  381. <table width="<?=$TW;?>" cellspacing="1" cellpadding="0" bgcolor="#D4F3D7"><tr class="tbl2"><td>
  382. <table cellspacing="0" cellpadding="2" border="0" width="100%">
  383. <tr>
  384. <?php
  385. if ($GDVERSION>0) {
  386.     if ($graph==1) print "<td><img src=\"img/graph_1_s.gif\" hspace=\"6\" width=\"18\" height=\"18\" border=\"0\"></td>";
  387.     else print "<td><a href=\"javascript:redraw(1);\"><img src=\"img/graph_1.gif\" hspace=\"6\" width=\"18\" height=\"18\" border=\"0\"></a></td>";
  388.     }
  389. ?>
  390.     <td>
  391.     <table cellspacing="0" cellpadding="0" border="0"><tr><td><input type="checkbox" name="cb_hits" <?=($cb_hits=="on"?"checked":"");?>></td><td style="color:red;"><B><?=$LANG["hits"];?></B></td></tr></table>
  392.     </td>
  393.     <td>
  394.     <table cellspacing="0" cellpadding="0" border="0"><tr><td><input type="checkbox" name="s" <?=($s=="on"?"checked":"");?>></td><td><?=$LANG["smooth graphics"];?></td></tr></table>
  395.     </td>
  396. </tr>
  397. <tr>
  398. <?php
  399. if ($GDVERSION>0) {
  400.     if ($graph==2) print "<td><img src=\"img/graph_2_s.gif\" hspace=\"6\" width=\"18\" height=\"18\" border=\"0\"></td>";
  401.     else print "<td><a href=\"javascript:redraw(2);\"><img src=\"img/graph_2.gif\" hspace=\"6\" width=\"18\" height=\"18\" border=\"0\"></a></td>";
  402.     }
  403. ?>
  404.     <td>
  405.     <table cellspacing="0" cellpadding="0" border="0"><tr><td><input type="checkbox" name="cb_hosts" <?=($cb_hosts=="on"?"checked":"");?>></td><td style="color:blue;"><B><?=$LANG["hosts"];?></B></td></tr></table>
  406.     </td>
  407.     <td> </td>
  408. </tr>
  409. <tr>
  410. <?php
  411. if ($GDVERSION>0) {
  412.     if ($graph==3) print "<td><img src=\"img/graph_3_s.gif\" hspace=\"6\" width=\"18\" height=\"18\" border=\"0\"></td>";
  413.     else print "<td><a href=\"javascript:redraw(3);\"><img src=\"img/graph_3.gif\" hspace=\"6\" width=\"18\" height=\"18\" border=\"0\"></a></td>";
  414.     }
  415. ?>
  416.     <td>
  417.     <table cellspacing="0" cellpadding="0" border="0"><tr><td><input type="checkbox" name="cb_users" <?=($cb_users=="on"?"checked":"");?>></td><td style="color:green;"><B><?=$LANG["users"];?></B></td></tr></table>
  418.     </td>
  419.     <td align="right">
  420.     <table width="100%" cellspacing="0" cellpadding="0" border="0"><tr><td> 
  421.         <select name="type">
  422.         <option value="0" <?=($type==0?"selected":"");?>><?=$LANG["by hours"];?>
  423.         <option value="1" <?=($type==1?"selected":"");?>><?=$LANG["by days"];?>
  424.         <option value="2" <?=($type==2?"selected":"");?>><?=$LANG["by weeks"];?>
  425.         <option value="3" <?=($type==3?"selected":"");?>><?=$LANG["by moths"];?>
  426.         </select>
  427.     </td><td align="right">
  428.         <input type="submit" value="<?=$LANG["update"];?>">
  429.     </td></tr></table>
  430.     </td>
  431. </tr>
  432. </table>
  433. </td></tr></table>
  434. <input type=hidden name="st" value="<?=$st;?>">
  435. <input type=hidden name="stm" value="<?=$stm;?>">
  436. <input type=hidden name="ftm" value="<?=$ftm;?>">
  437. <input type=hidden name="filter" value="<?=$filter;?>">
  438. <input type=hidden name="day" value="<?=$day;?>">
  439. <input type=hidden name="month" value="<?=$month;?>">
  440. <input type=hidden name="year" value="<?=$year;?>">
  441. <input type=hidden name="graph" value="<?=$graph;?>">
  442. <input type=hidden name="prom" value="<?=$prom;?>">
  443. <input type=hidden name="second" value="1">
  444. <input type=hidden name="graph" value="<?=$graph;?>" id="ge">
  445. </form>
  446.  
  447. <?php
  448. print $html;
  449. $NOFILTER=1;
  450. ?>
  451.