LICENSE: GPLv2 ### require("dbconnect.php"); $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; $group=$_GET["group"]; if (!$group) {$group=$_POST["group"];} $status=$_GET["status"]; if (!$status) {$status=$_POST["status"];} $date_with_hour=$_GET["date_with_hour"]; if (!$date_with_hour) {$date_with_hour=$_POST["date_with_hour"];} $submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} $SUBMIT=$_GET["SUBMIT"]; if (!$SUBMIT) {$SUBMIT=$_POST["SUBMIT"];} $STARTtime = date("U"); $TODAY = date("Y-m-d"); $date_with_hour_default = date("Y-m-d H"); $date_no_hour_default = $TODAY; if (!$date_with_hour) {$date_with_hour = $date_with_hour_default;} $date_no_hour = $date_with_hour; $date_no_hour = eregi_replace(" ([0-9]{2})",'',$date_no_hour); if (!$begin_date) {$begin_date = $TODAY;} if (!$end_date) {$end_date = $TODAY;} $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } else { header ("Content-type: text/html; charset=utf-8"); if($auth>0) { $office_no=strtoupper($PHP_AUTH_USER); $password=strtoupper($PHP_AUTH_PW); $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $LOGfullname=$row[0]; fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); fclose($fp); } else { fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); fclose($fp); } # $stmt="SELECT full_name from vicidial_users where user='$user';"; # $rslt=mysql_query($stmt, $link); # $row=mysql_fetch_row($rslt); # $full_name = $row[0]; } ?> VICIDIAL ADMIN: Group Hourly Stats
= '$date_with_hour:00:00' and call_date <= '$date_with_hour:59:59' and user='$VDuser[$o]';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDtotal[$o] = "$row[0]"; $stmt="select count(*) from vicidial_log where call_date >= '$date_no_hour 00:00:00' and call_date <= '$date_no_hour 23:59:59' and user='$VDuser[$o]' and status='$status';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDday[$o] = "$row[0]"; $stmt="select count(*) from vicidial_log where call_date >= '$date_with_hour:00:00' and call_date <= '$date_with_hour:59:59' and user='$VDuser[$o]' and status='$status';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDcount[$o] = "$row[0]"; $o++; } echo "
  VICIDIAL ADMIN: Group Hourly Stats  
\n"; echo "
\n"; echo "TSR HOUR COUNTS: $group | $status | $date_with_hour | $date_no_hour\n"; echo "
\n"; echo "\n"; $day_calls=0; $hour_calls=0; $total_calls=0; $o=0; while($o < $tsrs_to_print) { if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $total_calls = ($total_calls + $VDtotal[$o]); $hour_calls = ($hour_calls + $VDcount[$o]); $day_calls = ($day_calls + $VDday[$o]); $o++; } echo "\n"; } echo "
TSR ID   $status   TOTAL CALLS   $status DAY    
$VDuser[$o] $VDname[$o] $VDcount[$o] $VDtotal[$o] $VDday[$o]MODIFY | STATS
TOTAL $status $hour_calls $total_calls $day_calls
\n"; echo "

\n"; echo "
Please enter the group you want to get hourly stats for:
\n"; echo "\n"; echo "group:
\n"; echo "status:   (example: XFER)
\n"; echo "date with hour:   (example: 2004-06-25 14)
\n"; echo "\n"; echo "


\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); echo "\n\n\n


\n\n"; echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; ?>