Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- # domedan_leaderboard.php
- #
- # Copyright (C) 2012 Dan <domedan@gmail.com> LICENSE: AGPLv2
- #
- # Based on:
- # AST_team_performance_detail.php
- # Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
- #
- #
- # CHANGES
- #
- # 2012-08-16 created based on AST_team_performance_detail.php and my old version
- # 2012-09-11 added ereg_replace on all user input and some small fixes
- // set starttime to check execution-time for this script
- $starttime = microtime(1);
- require("dbconnect.php");
- require("functions.php");
- mysql_select_db("asterisk");
- function utf_8_sprintf ($format) {
- # http://www.php.net/manual/en/function.sprintf.php#86304
- # Formats string using sprintf, but correctly handles %s with space paddings
- # uses conversion to iso-8859-2 and back
- # it is, however, much slower, so use only when needed!
- # @param string $format
- $args = func_get_args();
- for ($i = 1; $i < count($args); $i++) {
- $args [$i] = iconv('UTF-8', 'ISO-8859-2', $args [$i]);
- }
- return iconv('ISO-8859-2', 'UTF-8', call_user_func_array('sprintf', $args));
- }
- $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
- $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
- $PHP_SELF=$_SERVER['PHP_SELF'];
- if (isset($_GET["query_date_D"])) {$query_date_D=$_GET["query_date_D"];}
- elseif (isset($_POST["query_date_D"])) {$query_date_D=$_POST["query_date_D"];}
- if (isset($_GET["end_date_D"])) {$end_date_D=$_GET["end_date_D"];}
- elseif (isset($_POST["end_date_D"])) {$end_date_D=$_POST["end_date_D"];}
- if (isset($_GET["query_date_T"])) {$query_date_T=$_GET["query_date_T"];}
- elseif (isset($_POST["query_date_T"])) {$query_date_T=$_POST["query_date_T"];}
- if (isset($_GET["end_date_T"])) {$end_date_T=$_GET["end_date_T"];}
- elseif (isset($_POST["end_date_T"])) {$end_date_T=$_POST["end_date_T"];}
- if (isset($_GET["group"])) {$group=$_GET["group"];}
- elseif (isset($_POST["group"])) {$group=$_POST["group"];}
- if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];}
- elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];}
- if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];}
- elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];}
- if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
- elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
- if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
- elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
- if (isset($_GET["day"])) {$get_day=$_GET["day"];}
- elseif (isset($_POST["day"])) {$get_day=$_POST["day"];}
- if (isset($_GET["evening"])) {$get_evening=$_GET["evening"];}
- elseif (isset($_POST["evening"])) {$get_evening=$_POST["evening"];}
- if (isset($_GET["auto"])) {$get_auto=$_GET["auto"];}
- elseif (isset($_POST["auto"])) {$get_auto=$_POST["auto"];}
- if (isset($_GET["timeout"])) {$get_timeout=$_GET["timeout"];}
- elseif (isset($_POST["timeout"])) {$get_timeout=$_POST["timeout"];}
- if (isset($_GET["user"])) {$get_user=$_GET["user"];}
- elseif (isset($_POST["user"])) {$get_user=$_POST["user"];}
- if (isset($_GET["sort_by"])) {$get_sort=$_GET["sort_by"];}
- elseif (isset($_POST["sort_by"])) {$get_sort=$_POST["sort_by"];}
- if (isset($_GET["agentfullstats"])) {$agentfullstats=$_GET["agentfullstats"];}
- elseif (isset($_POST["agentfullstats"])) {$agentfullstats=$_POST["agentfullstats"];}
- if (isset($_GET["agentpstats"])) {$agentpstats=$_GET["agentpstats"];}
- elseif (isset($_POST["agentpstats"])) {$agentpstats=$_POST["agentpstats"];}
- if (isset($_GET["agentcc"])) {$agentcc=$_GET["agentcc"];}
- elseif (isset($_POST["agentcc"])) {$agentcc=$_POST["agentcc"];}
- $query_date_D = ereg_replace("[^0-9\-]","",$query_date_D);
- $end_date_D = ereg_replace("[^0-9\-]","",$end_date_D);
- $query_date_T = ereg_replace("[^0-9\:]","",$query_date_T);
- $end_date_T = ereg_replace("[^0-9\:]","",$end_date_T);
- #foreach($group as $replaceme) {
- # $group[]=ereg_replace("[^a-öA-Ö0-9\-]","",$replaceme);
- #}
- #foreach($user_group as $user_group_link) {
- # $user_group[]=ereg_replace("[^0-9\:]","",$user_group_link);
- #}
- $file_download = ereg_replace("[^0-9]","",$file_download);
- $DB = ereg_replace("[^0-9]","",$DB);
- $SUBMIT = ereg_replace("[^a-öA-Ö]","",$SUBMIT);
- $get_day = ereg_replace("[^y]","",$get_day);
- $get_evening = ereg_replace("[^y]","",$get_evening);
- $get_auto = ereg_replace("[^y]","",$get_auto);
- $get_timeout = ereg_replace("[^0-9]","",$get_timeout);
- $report_name = 'Leaderboard';
- $db_source = 'M';
- #############################################
- ##### START SYSTEM_SETTINGS LOOKUP #####
- $stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;";
- $rslt=mysql_query($stmt, $link);
- if ($DB) {$HTML_text.="$stmt\n";}
- if ($archive_tbl) {$agent_log_table="vicidial_agent_log_archive";} else {$agent_log_table="vicidial_agent_log";}
- $qm_conf_ct = mysql_num_rows($rslt);
- if ($qm_conf_ct > 0)
- {
- $row=mysql_fetch_row($rslt);
- $non_latin = $row[0];
- $outbound_autodial_active = $row[1];
- $slave_db_server = $row[2];
- $reports_use_slave_db = $row[3];
- }
- ##### END SETTINGS LOOKUP #####
- ###########################################
- $MT[0]='';
- $NOW_DATE = date("Y-m-d");
- $NOW_TIME = date("Y-m-d H:i:s");
- $STARTtime = date("U");
- if (!isset($group)) {$group = '';}
- if (!isset($query_date_D) || $query_date_D == '') {$query_date_D=$NOW_DATE;}
- if (!isset($end_date_D) || $end_date_D == '') {$end_date_D=$NOW_DATE;}
- if (!isset($query_date_T) || $query_date_T == '') {$query_date_T="00:00:00";}
- if (!isset($end_date_T) || $end_date_T == '') {$end_date_T="23:59:59";}
- $i=0;
- $group_string='|';
- $group_ct = count($group);
- while($i < $group_ct)
- {
- $group_string .= "$group[$i]|";
- $i++;
- }
- $stmt="select campaign_id from vicidial_campaigns order by campaign_id;";
- $rslt=mysql_query($stmt, $link);
- if ($DB) {$HTML_text.="$stmt\n";}
- $campaigns_to_print = mysql_num_rows($rslt);
- $i=0;
- while ($i < $campaigns_to_print)
- {
- $row=mysql_fetch_row($rslt);
- $groups[$i] =$row[0];
- if (ereg("-ALL",$group_string) )
- {$group[$i] = $groups[$i];}
- $i++;
- }
- #######################################
- for ($i=0; $i<count($user_group); $i++)
- {
- //echo "COUNT UG".count($user_group);
- if (eregi("--ALL--", $user_group[$i])) {$all_user_groups=1; $user_group="";}
- }
- $stmt="select user_group from vicidial_user_groups order by user_group;";
- $rslt=mysql_query($stmt, $link);
- if ($DB) {$HTML_text.="$stmt\n";}
- $user_groups_to_print = mysql_num_rows($rslt);
- $i=0;
- while ($i < $user_groups_to_print)
- {
- $row=mysql_fetch_row($rslt);
- $user_groups[$i] =$row[0];
- if ($all_user_groups) {$user_group[$i]=$row[0];}
- $i++;
- }
- $i=0;
- $group_string='|';
- $group_ct = count($group);
- while($i < $group_ct)
- {
- $group_string .= "$group[$i]|";
- $group_SQL .= "'$group[$i]',";
- $groupQS .= "&group[]=$group[$i]";
- $i++;
- }
- if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) )
- {$group_SQL = "";}
- else
- {
- $group_SQL = eregi_replace(",$",'',$group_SQL);
- $group_SQL_str=$group_SQL;
- $group_SQL = "and campaign_id IN($group_SQL)";
- }
- $i=0;
- $user_group_string='|';
- $user_group_ct = count($user_group);
- while($i < ($user_group_ct))
- {
- $user_group_string .= "$user_group[$i]|";
- $user_group_SQL .= "'$user_group[$i]',";
- $user_groupQS .= "&user_group[]=$user_group[$i]";
- $i++;
- }
- if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) )
- {$user_group_SQL = "";}
- else
- {
- $user_group_SQL = eregi_replace(",$",'',$user_group_SQL);
- $user_group_SQL_str = $user_group_SQL;
- $user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)";
- }
- ######################################
- if ($DB) {$HTML_text.="$user_group_string|$user_group_ct|$user_groupQS|$i<BR>";}
- ###########################
- ##### DOMEDAN STUFF ######
- ##########################
- // check it auto is set
- // and prevent auto from being set before 09:00 and after 21:00 (uncomment if you like that idea) (maybe i could get that info from shift-settings...)
- $minimum_auto="30"; // minimum auto in sec
- if ( ( date("H") >= '06' && date("H") <= '23') && ($query_date_D == $end_date_D) ) {
- if ($get_timeout) {
- if ($get_auto == 'y' && ($get_timeout < $minimum_auto)) {
- $timeout = $minimum_auto;
- } else {
- $timeout=$get_timeout; // else accept user input
- }
- } else {
- $timeout='60'; // default timeout when no timeout is set
- }
- $HTML_auto_refresh="<META HTTP-EQUIV=\"refresh\" CONTENT=\"".$timeout."\" charset=utf-8>\n"; // yeah i know it ain't no AJAX, but I'm gonna try it later in
- $auto='checked'; //for the data form
- } else {
- $auto='';
- $HTML_auto_refresh="";
- }
- ############################
- ?><style>
- .odd{background-color:#b7cfdc;}
- .tover{background-color:red;}
- .tover{background-color:yellow;}
- </style>
- <script>
- function updateURLParameter(url, param, paramVal)
- {
- var TheAnchor = null;
- var newAdditionalURL = "";
- var tempArray = url.split("?");
- var baseURL = tempArray[0];
- var additionalURL = tempArray[1];
- var temp = "";
- if (additionalURL)
- {
- var tmpAnchor = additionalURL.split("#");
- var TheParams = tmpAnchor[0];
- TheAnchor = tmpAnchor[1];
- if(TheAnchor)
- additionalURL = TheParams;
- tempArray = additionalURL.split("&");
- for (i=0; i<tempArray.length; i++)
- {
- if(tempArray[i].split('=')[0] != param)
- {
- newAdditionalURL += temp + tempArray[i];
- temp = "&";
- }
- }
- }
- else
- {
- var tmpAnchor = baseURL.split("#");
- var TheParams = tmpAnchor[0];
- TheAnchor = tmpAnchor[1];
- if(TheParams)
- baseURL = TheParams;
- }
- if(TheAnchor)
- paramVal += "#" + TheAnchor;
- var rows_txt = temp + "" + param + "=" + paramVal;
- return baseURL + "?" + newAdditionalURL + rows_txt;
- }
- </script>
- <?php
- function remove_querystring_var($url, $key) {
- $url = preg_replace('/(.*)(?|&)' . $key . '=[^&]+?(&)(.*)/i', '$1$2$4', $url . '&');
- $url = substr($url, 0, -1);
- return $url;
- }
- $url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
- $url = remove_querystring_var($url, "sort_by");
- function truncateString($str, $chars, $to_space, $replacement="...") {
- if($chars > strlen($str)) return $str;
- $str = substr($str, 0, $chars);
- $space_pos = strrpos($str, " ");
- if($to_space && $space_pos >= 0) {
- $str = substr($str, 0, strrpos($str, " "));
- }
- return($str . $replacement);
- }
- $HTML_head.="<HTML>\n";
- $HTML_head.="<HEAD>\n";
- $HTML_head.="<STYLE type=\"text/css\">\n";
- $HTML_head.="<!--\n";
- $HTML_head.=" .green {color: white; background-color: green}\n";
- $HTML_head.=" .red {color: white; background-color: red}\n";
- $HTML_head.=" .blue {color: white; background-color: blue}\n";
- $HTML_head.=" .purple {color: white; background-color: purple}\n";
- $HTML_head.="-->\n";
- $HTML_head.=" </STYLE>\n";
- $query_date="$query_date_D $query_date_T";
- $end_date="$end_date_D $end_date_T";
- $HTML_head.="<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n";
- $HTML_head.="<link rel=\"stylesheet\" href=\"calendar.css\">\n";
- $HTML_head.="<link rel=\"stylesheet\" href=\"horizontalbargraph.css\">\n";
- $HTML_head.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
- $HTML_head.=$HTML_auto_refresh;
- $HTML_head.="<TITLE>$report_name</TITLE></HEAD><BODY BGCOLOR=WHITE marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>$group_S\n";
- ###IF QUERY SUBMIT HIDE SELECTION OPTIONS###
- if (!$SUBMIT) {
- $HTML_text.="<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>";
- $HTML_text.="<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n";
- $HTML_text.="<TABLE CELLSPACING=3><TR><TD VALIGN=TOP> <BR>";
- $HTML_text.="<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n";
- $HTML_text.="Date Range:<BR>\n";
- $HTML_text.="<INPUT TYPE=hidden NAME=query_date ID=query_date VALUE=\"$query_date\">\n";
- $HTML_text.="<INPUT TYPE=hidden NAME=end_date ID=end_date VALUE=\"$end_date\">\n";
- $HTML_text.="<INPUT TYPE=TEXT NAME=query_date_D SIZE=11 MAXLENGTH=10 VALUE=\"$query_date_D\">";
- $HTML_text.="<script language=\"JavaScript\">\n";
- $HTML_text.="var o_cal = new tcal ({\n";
- $HTML_text.=" // form name\n";
- $HTML_text.=" 'formname': 'vicidial_report',\n";
- $HTML_text.=" // input name\n";
- $HTML_text.=" 'controlname': 'query_date_D'\n";
- $HTML_text.="});\n";
- $HTML_text.="o_cal.a_tpl.yearscroll = false;\n";
- $HTML_text.="// o_cal.a_tpl.weekstart = 1; // Monday week start\n";
- $HTML_text.="</script>\n";
- $HTML_text.=" <INPUT TYPE=TEXT NAME=query_date_T SIZE=9 MAXLENGTH=8 VALUE=\"$query_date_T\">";
- $HTML_text.="<BR> to <BR><INPUT TYPE=TEXT NAME=end_date_D SIZE=11 MAXLENGTH=10 VALUE=\"$end_date_D\">";
- $HTML_text.="<script language=\"JavaScript\">\n";
- $HTML_text.="var o_cal = new tcal ({\n";
- $HTML_text.=" // form name\n";
- $HTML_text.=" 'formname': 'vicidial_report',\n";
- $HTML_text.=" // input name\n";
- $HTML_text.=" 'controlname': 'end_date_D'\n";
- $HTML_text.="});\n";
- $HTML_text.="o_cal.a_tpl.yearscroll = false;\n";
- $HTML_text.="// o_cal.a_tpl.weekstart = 1; // Monday week start\n";
- $HTML_text.="</script>\n";
- $HTML_text.=" <INPUT TYPE=TEXT NAME=end_date_T SIZE=9 MAXLENGTH=8 VALUE=\"$end_date_T\">";
- $HTML_text.="<TD VALIGN=TOP> <BR>";
- $HTML_text.="Auto refresh: <input type=\"checkbox\" name=\"auto\" value=\"y\" ".$auto." /> <BR>";
- $HTML_text.="seconds: <input type=\"text\" name=\"timeout\" value=\"".$timeout."\" size=\"3\" /> \n";
- $HTML_text.="</TD>\n";
- $HTML_text.="</TD><TD VALIGN=TOP> Campaigns:<BR>";
- $HTML_text.="<SELECT SIZE=15 NAME=group[] multiple>\n";
- if (eregi("--ALL--",$group_string))
- {$HTML_text.="<option value=\"--ALL--\" selected>-- ALL CAMPAIGNS --</option>\n";}
- elseif ($group == '')
- {$HTML_text.="<option value=\"--ALL--\" selected>-- ALL CAMPAIGNS --</option>\n";}
- else
- {$HTML_text.="<option value=\"--ALL--\">-- ALL CAMPAIGNS --</option>\n";}
- $o=0;
- while ($campaigns_to_print > $o)
- {
- if (eregi("$groups[$o]\|",$group_string))
- {$HTML_text.="<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";}
- else
- {$HTML_text.="<option value=\"$groups[$o]\">$groups[$o]</option>\n";}
- $o++;
- }
- $HTML_text.="</SELECT>\n";
- $HTML_text.="</TD><TD VALIGN=TOP>Teams/User Groups:<BR>";
- $HTML_text.="<SELECT SIZE=15 NAME=user_group[] multiple>\n";
- if (eregi("--ALL--",$user_group_string))
- {$HTML_text.="<option value=\"--ALL--\" selected>-- ALL USER GROUPS --</option>\n";}
- elseif ($user_group == '')
- {$HTML_text.="<option value=\"--ALL--\" selected>-- ALL USER GROUPS --</option>\n";}
- else
- {$HTML_text.="<option value=\"--ALL--\">-- ALL USER GROUPS --</option>\n";}
- $o=0;
- while ($user_groups_to_print > $o)
- {
- if (eregi("\|$user_groups[$o]\|",$user_group_string))
- {$HTML_text.="<option selected value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
- else
- {$HTML_text.="<option value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
- $o++;
- }
- $HTML_text.="</SELECT>\n";
- $HTML_text.="</TD>\n";
- $HTML_text.="<TD VALIGN=TOP>\n";
- $HTML_text.="<option value='TEXT'>TEXT</option></select>\n<BR><BR>";
- $HTML_text.="<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT>\n";
- $HTML_text.="<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> \n";
- $HTML_text.="<a href=\"$PHP_SELF?DB=$DB&query_date=$query_date&end_date=$end_date&query_date_D=$query_date_D&query_date_T=$query_date_T&end_date_D=$end_date_D&end_date_T=$end_date_T$groupQS$user_groupQS&file_download=1&SUBMIT=$SUBMIT\">DOWNLOAD</a> |";
- $HTML_text.=" <a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n";
- $HTML_text.="</FONT>\n";
- $HTML_text.="</TD><TD VALIGN=BOTTOM><a href=\"$PHP_SELF\">clear</a>\n";
- $HTML_text.="</TD><TD VALIGN=TOP> ";
- $HTML_text.="</TD></TR></TABLE>";
- $HTML_text.="</FORM>\n\n";
- }
- ###END IF QUERY SUBMIT HIDE SELECTION OPTIONS###
- if ($SUBMIT=="SUBMIT")
- {
- $HTML_text.="<PRE><FONT SIZE=3>";
- ##### DOMEDAN STUFF ######
- ##########################
- $user_list=array();
- $total_dsum=array();
- $total_upsum=array();
- $sale_count=array();
- $other_HA_count=array();
- $ni_count=array();
- $upsale_count=array();
- $open_count=array();
- $ptime=array();
- if (strtotime($query_date)<=strtotime('-30 days')){
- $vl = "vicidial_log_archive";
- $val = "vicidial_agent_log_archive";
- } else {
- $vl = "vicidial_log";
- $val = "vicidial_agent_log";
- }
- if ($agentpstats) {
- $agentidSQL = "AND vl.user in ('$agentpstats')";
- }
- #### QUERY TO ALL DATA
- $stmt = "SELECT vl.call_date,vi.status,vl.user,vl.campaign_id,vi.list_id,vl.user_group,vi.lead_id
- FROM $vl vl,vicidial_list vi
- INNER JOIN asterisk.vicidial_statuses s on s.status=vi.status
- WHERE vi.lead_id=vl.lead_id
- AND vi.user=vl.user AND DATE(vi.last_local_call_time)=DATE(vl.call_date)
- AND vl.call_date >= '$query_date'
- AND vl.call_date <= '$end_date'
- AND s.human_answered = 'Y'
- AND vl.campaign_id in ($group_SQL_str)
- AND vl.user_group in ($user_group_SQL_str)
- $agentidSQL
- GROUP BY vi.lead_id
- ;";
- //$stmt="SELECT l.lead_id, l.user, l.status, l.call_date, i.list_id FROM $vl l
- //LEFT JOIN vicidial_list i on i.lead_id=l.lead_id
- //AND i.user=l.user AND DATE(i.last_local_call_time)=DATE(l.call_date) /* AND i.status='SALE' */
- //INNER JOIN asterisk.vicidial_statuses s on s.status=l.status
- //WHERE l.call_date >= '$query_date'
- //AND l.call_date <= '$end_date'
- //AND s.human_answered = 'Y'
- //AND l.campaign_id in ($group_SQL_str)
- //AND l.user_group in ($user_group_SQL_str)
- //$agentidSQL
- // /* AND l.user in ('tht') */";
- if ($DB) {$ASCII_text.="$stmt\n";}
- $rslt=mysql_query($stmt, $link_stats);
- while ($row=mysql_fetch_array($rslt)) {
- //print_r($row['user']);
- // create list of users
- if ( !in_array($row['user'], $user_list) ) {
- $full_name_stmt="SELECT full_name from vicidial_users WHERE user='".$row['user']."';";
- $full_name_rslt = mysql_query($full_name_stmt, $link_stats);
- while ($full_name_row=mysql_fetch_array($full_name_rslt)) {
- $user_list[$row['user']] = truncateString($full_name_row['full_name'], 14, false);
- $user_listid[$row['user']] = $row['user'];
- }
- }
- $numcallcount[$row['user']]++;
- if ($row['status'] == 'SALE') {
- $get_amount_stmt="SELECT d_amt, up_amt, md_amt, cc_num, bank_act from custom_$row[list_id] WHERE lead_id='".$row['lead_id']."';";
- if ($DB) {$ASCII_text.="$get_amount_stmt\n";}
- $get_amount_rslt = mysql_query($get_amount_stmt, $link_stats);
- $get_amount_row=mysql_fetch_array($get_amount_rslt);
- //echo $row[list_id]. "<br>";
- //$leads_with_SALE[]=$row['lead_id'];
- #$row['security_phrase']=$row['security_phrase']-25; // this is just a silly rule, if you dont want it you can remove it
- $SALE_time=date("H:i:s", strtotime($row['call_date'])); // get time of SALE
- $sale_count[$row['user']]++; // count SALE
- $total_dsum[$row['user']]=$total_dsum[$row['user']]+$get_amount_row['d_amt']+0; // sum Donation Sales
- $total_upsum[$row['user']]=$total_upsum[$row['user']]+$get_amount_row['up_amt']+0; // sum UpSales
- $total_msum[$row['user']]=$total_msum[$row['user']]+$get_amount_row['md_amt']+0; // sum Monthly Sales
- if ($get_amount_row['cc_num'] > 5 OR $get_amount_row['bank_act'] > 5){
- $total_vsum[$row['user']]=$total_vsum[$row['user']]+$get_amount_row['d_amt']+$get_amount_row['up_amt']+0; // sum Monthly Sales
- $v_count[$row['user']]++; // count Verified
- }
- if ($get_amount_row['up_amt'] >= 1){ // count upsales
- $upsale_count[$row['user']]++;}
- if ($get_amount_row['d_amt'] < 1){ // count OPENS
- $open_count[$row['user']]++;}
- if ($get_amount_row['md_amt'] >= 1){ // count monthly
- $md_count[$row['user']]++;}
- } elseif ($row['status'] == 'NI') {
- $ni_count[$row['user']]++; // count NI
- } else {
- $other_HA_count[$row['user']]++; // count other human answer statuses
- }
- $snitt[$row['user']]=round($total_dsum[$row['user']]/($sale_count[$row['user']]-$open_count[$row['user']])); // Calc AVG Sale
- }
- // add users that havent made any SALE
- foreach ($user_list as $user => $full_name) {
- if ( !array_key_exists($user, $sale_count) ) {
- $sale_count[$user] = "0";
- }
- if ( !array_key_exists($user, $total_dsum) ) {
- $total_dsum[$user] = "0";
- }
- if ( !array_key_exists($user, $total_upsum) ) {
- $total_upsum[$user] = "0";
- }
- if ( !array_key_exists($user, $total_msum) ) {
- $total_msum[$user] = "0";
- }
- if ( !array_key_exists($user, $total_vsum) ) {
- $total_vsum[$user] = "0";
- }
- if ( !array_key_exists($user, $md_count) ) {
- $md_count[$user] = "0";
- }
- if ( !array_key_exists($user, $open_count) ) {
- $open_count[$user] = "0";
- }
- if ( !array_key_exists($user, $upsale_count) ) {
- $upsale_count[$user] = "0";
- }
- if ( !array_key_exists($user, $v_count) ) {
- $v_count[$user] = "0";
- }
- if ( !array_key_exists($user, $SALE_HR) ) {
- $SALE_HR[$user] = "0";
- }
- if ($DB) {$ASCII_text.="USER - ".$user_list[$user]."\n";}
- }
- //$time_user_stmt="SELECT l.user, l.user_group, l.call_date FROM $vl l
- //WHERE l.call_date >= '$query_date'
- //AND l.call_date <= '$end_date'
- //AND l.user_group in ($user_group_SQL_str)
- //AND l.campaign_id in ($group_SQL_str)
- //$agentidSQL
- //GROUP BY l.user
- ///* AND l.user in ('tht') */";
- //if ($DB) {$ASCII_text.="$$agentidSQL\n";}
- //$time_user_rslt=mysql_query($time_user_stmt, $link_stats);
- //while ($time_user_row = mysql_fetch_assoc($time_user_rslt)) {
- foreach ($user_listid as $userid => $user) {
- $time_stmt="select sum(pause_sec) as psec,sum(wait_sec) as wsec,sum(talk_sec) as tsec,sum(dispo_sec) as dsec,sum(dead_sec) as dedsec
- FROM $val
- WHERE user='" . mysql_real_escape_string($user_listid[$userid]) . "'
- AND event_time >= '" . mysql_real_escape_string($query_date) . " 0:00:01'
- AND event_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59'
- AND ( (pause_sec > 0) or (wait_sec > 0) or (talk_sec > 0) or (dispo_sec > 0) )
- limit 10000;";
- if ($DB) {$ASCII_text.="agent activity|$time_stmt|\n";}
- $time_rslt=mysql_query($time_stmt, $link);
- $time_row = mysql_fetch_assoc($time_rslt);
- $ptime[$userid] = $time_row['psec'];
- $dtime[$userid] = ($time_row['dsec']+$time_row['dedsec']);
- $ttime[$userid] = ($time_row['dsec']+$time_row['psec']+$time_row['wsec']+$time_row['tsec']+$time_row['dedsec']);
- $numcallshr[$userid] = ($numcallcount[$userid]/($ttime[$userid] / 3600));
- $SALE_HR[$userid] = round((($total_dsum[$userid])+$total_upsum[$userid])/($ttime[$userid] / 3600));
- $SALE_count_HR[$userid] = (($sale_count[$userid])/($ttime[$userid] / 3600));
- $wrap_per[$userid] = ((($dtime[$userid])/($ttime[$userid]))*100);
- $percent_SALE[$userid]=round($sale_count[$userid]/($sale_count[$userid]+$ni_count[$userid])*100);
- $txteamgoal = 125;
- $user_group_stmt="SELECT user_group from vicidial_users WHERE user='".$user_listid[$userid]."';";
- $user_group_rslt = mysql_query($user_group_stmt, $link_stats);
- while ($user_group_row=mysql_fetch_array($user_group_rslt)) {
- // CAN USE IF TEAMS SPLIT AMT HR GOAL if ($user_group_row['user_group'] == 'TX-Tina' OR $user_group_row['user_group'] == 'TX-Jasey') {
- if (substr($user_group_row['user_group'],0,3) == 'TX-'){
- $amthrkey = "<br>Amount per hour goal: $$txteamgoal<br>";
- if ($SALE_HR[$userid] >= $txteamgoal) {
- $amthrunder[$userid] = "#5BFF19";
- }
- if ($SALE_HR[$userid] < $txteamgoal AND $SALE_HR[$userid] >= 100) {
- $amthrunder[$userid] = "yellow";
- }
- if ($SALE_HR[$userid] < 100) {
- $amthrunder[$userid] = "red";
- }
- }
- }
- }
- if ($get_sort) {$sorttable = $$get_sort;} else {$sorttable = $SALE_HR;}
- //echo $get_sort;
- // asort keep key
- asort($sorttable, SORT_NUMERIC);
- // reverse order, "true" keeps key
- $sorttable = array_reverse($sorttable, true);
- if ($agentfullstats){
- $resetlink = " ";
- }else{
- $resetlink = "<a href=\"$PHP_SELF\">RESET</a>";
- }
- ####START TV STATS###
- if (!$agentpstats){
- $ASCII_text.="+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+$HTMLborderheader\n";
- $ASCII_text.="|STATS FOR DATE RANGE: $query_date_D to $end_date_D FOR $user_group_string$HTMLborderheader\n";
- $ASCII_text.="+--------------------------------+------------------+------------------------+------+-----------+-----------+-----------+------+-----------------------------------------+$HTMLborderheader\n";
- $ASCII_text.="| $resetlink TOTAL | Donations | Hourly Stats | | Up Sales | Monthlys | Verified | | Time Spent |$HTMLborderheader\n";
- $ASCII_text.="+--------------------------------+-------+-----+----+----------+-------+-----+------+------+----+------+----+------+----+------+-----------+---------+-------+-----------+$HTMLborderheader\n";
- $ASCII_text.="| Agent Name ";
- $ASCII_text.=" | ".sprintf("%13s", "<b>$".round((array_sum($total_dsum)+array_sum($total_upsum)))."</b>");
- $ASCII_text.=" | <a href=\"$url&sort_by=total_dsum\">$</a> | <a href=\"$url&sort_by=sale_count\">#</a> | <a href=\"$url&sort_by=open_count\">OP</a> | <a href=\"$url&sort_by=SALE_HR\">Amt Hr</a> | <a href=\"$url&sort_by=SALE_count_HR\">SA Hr</a> | <a href=\"$url&sort_by=numcallshr\">C/H</a> | <a href=\"$url&sort_by=snitt\">Avg$</a> | <a href=\"$url&sort_by=total_upsum\">$</a> | <a href=\"$url&sort_by=upsale_count\">#</a> | <a href=\"$url&sort_by=total_msum\">$</a> | <a href=\"$url&sort_by=md_count\">#</a> | <a href=\"$url&sort_by=total_vsum\">$</a> | <a href=\"$url&sort_by=v_count\">#</a> | <a href=\"$url&sort_by=percent_SALE\">SA %</a> | Pause | Wrap | <a href=\"$url&sort_by=wrap_per\">WR%</a> | Dial |$HTMLstatusheader\n";
- $ASCII_text.="+--------------------------------+-------+-----+----+----------+-------+-----+------+------+----+------+----+------+----+------+-----------+---------+-------+-----------+$HTMLborderheader\n";
- $CSV_text.="\"Agent Name\",\"Total\",\"SALE\",\"Average\",\"Up Sale\",\"Contacts\",\"SALE %\",\"NI\",\"Other HA\"$CSVstatusheader\n";
- foreach($sorttable as $user => $amount) {
- $countusers++;
- if ($sale_count[$user] == 0) {
- $snitt[$user]=0;
- $percent_SALE[$user]=0;
- $open_count[$user] = 0;
- }
- if ($ptime[$user] >= 2700){$ptimehigh = "red";} elseif ($ptime[$user] >= 2400){$ptimehigh = "yellow"; } else { $ptimehigh = null;}
- if ($wrap_per[$user] >= 1.999){$dtimehigh = "red";} elseif ($wrap_per[$user] >= 1.499){$dtimehigh = "yellow"; } else { $dtimehigh = null;}
- if ($agentfullstats == $user){$rowoddeven = '<span style="background-color:#ff8c66;"'.(($c = !$c)?' class="odd"':'').">";
- } else {$rowoddeven = '<span'.(($c = !$c)?' class="odd"':'').">";}
- if ($countusers <= 9){$countusers = "0$countusers";}
- $firstplaces = "";
- $secondplaces = "";
- if ($countusers == 01) {$firstplaces = "<font color=green><B>"; $firstplacee = "</font></B>";}
- if ($countusers == 02) {$secondplaces = "<font color=orange><B>"; $secondplacee = "</font></B>";}
- $ASCII_text.="$rowoddeven|$firstplaces$secondplaces$countusers ".utf_8_sprintf("%-18s", $user_list[$user])."$secondplacee$firstplacee";
- $ASCII_text.=" - <b>$".sprintf("%6s", round(($total_dsum[$user])+$total_upsum[$user]));
- $ASCII_text.="</b> | ".sprintf("%6s", "$".round($total_dsum[$user]))."</b>";
- $ASCII_text.=" ".sprintf("%4s", ($sale_count[$user]+0));
- $ASCII_text.=" ".sprintf("%4s", ($open_count[$user]+0));
- $ASCII_text.=" |<span STYLE='background-color: $amthrunder[$user]'> ".sprintf("%8s", "$".$SALE_HR[$user]."/hr");
- $ASCII_text.=" </span>| ".sprintf("%5s", sprintf('%0.2f',$SALE_count_HR[$user]."/hr"));
- $ASCII_text.=" | ".sprintf("%3s", round($numcallshr[$user]));
- $ASCII_text.=" | ".sprintf("%4s", "$".$snitt[$user]);
- $ASCII_text.=" | ".sprintf("%5s", "$".$total_upsum[$user]);
- $ASCII_text.=" ".sprintf("%3s", ($upsale_count[$user]+0));
- $ASCII_text.=" | ".sprintf("%5s", "$".$total_msum[$user]);
- $ASCII_text.=" ".sprintf("%3s", ($md_count[$user]+0));
- $ASCII_text.=" | ".sprintf("%5s", "$".$total_vsum[$user]);
- $ASCII_text.=" ".sprintf("%3s", ($v_count[$user]+0));
- # $ASCII_text.=" | ".sprintf("%8s", ($other_HA_count[$user]+$sale_count[$user]+$ni_count[$user]));
- # $ASCII_text.=" | ".sprintf("%4s", ($ni_count[$user]+0));
- $ASCII_text.=" | ".sprintf("%4s", $percent_SALE[$user]."%");
- $ASCII_text.=" |<span STYLE='background-color: $ptimehigh'> ".sprintf("%9s", sprintf( "%02d:%02d:%02d", $ptime[$user] / 3600, $ptime[$user] / 60 % 60, $ptime[$user] % 60 ));
- $ASCII_text.=" </span>|<span STYLE='background-color: $dtimehigh'> ".sprintf("%8s", sprintf( "%02d:%02d:%02d", $dtime[$user] / 3600, $dtime[$user] / 60 % 60, $dtime[$user] % 60 ));
- $ASCII_text.=" ".sprintf("%5s", sprintf('%0.1f', $wrap_per[$user])."%");
- $ASCII_text.=" </span>| ".sprintf("%9s", sprintf( "%02d:%02d:%02d", $ttime[$user] / 3600, $ttime[$user] / 60 % 60, $ttime[$user] % 60 )." |");
- $ASCII_text.="</span>\n";
- $CSV_text.="\"$user_list[$user]\",\"$amount\",\"".($sale_count[$user]+0)."\",\"$snitt\",\"".($other_HA_count[$user]+$sale_count[$user]+$ni_count[$user])."\",\"$percent_SALE\",\"".($ni_count[$user]+0)."\",\"".($other_HA_count[$user]+0)."\"\n";
- $rowoddeven++;
- }
- }
- ###END TV STATS###
- ###START PERSONAL STATS###
- if ($agentpstats) {
- $ASCII_text.="<FONT SIZE=2> | |Donatio| AMT | | Up Sales | Verified | Time Spent |$HTMLborderheader\n";
- $ASCII_text.=" | TOTAL | $ | HR | Avg$ | $ | # | $ | # | Pause | Wrap | WR% |$HTMLstatusheader\n";
- $ASCII_text.="+----------+-------+------+------+------+----+------+----+-----------+---------+-------+$HTMLborderheader\n";
- foreach($sorttable as $user => $amount) {
- $countusers++;
- if ($sale_count[$user] == 0) {
- $snitt=0;
- $percent_SALE=0;
- } else {
- $snitt=round($total_dsum[$user]/($sale_count[$user]-$open_count[$user]));
- $percent_SALE=round($sale_count[$user]/($sale_count[$user]+$ni_count[$user])*100);
- }
- if ($ptime[$user] >= 2700){$ptimehigh = "red";} elseif ($ptime[$user] >= 2400){$ptimehigh = "yellow"; } else { $ptimehigh = null;}
- if ($wrap_per[$user] > 1.9){$dtimehigh = "red";} elseif ($wrap_per[$user] > 1.5){$dtimehigh = "yellow"; } else { $dtimehigh = null;}
- if ($agentfullstats == $user){$rowoddeven = '<span style="background-color:#ff8c66;"'.(($c = !$c)?' class="odd"':'').">";
- } else {$rowoddeven = '<span'.(($c = !$c)?' class="odd"':'').">";}
- $ASCII_text.="$rowoddeven| <b>$".sprintf("%7s", round(($total_dsum[$user])+$total_upsum[$user]));
- $ASCII_text.="</b> |".sprintf("%6s", "$".round($total_dsum[$user]))."</b>";
- #$ASCII_text.=" ".sprintf("%4s", ($sale_count[$user]+0));
- #$ASCII_text.=" ".sprintf("%4s", ($open_count[$user]+0));
- $ASCII_text.=" | ".sprintf("%4s", "$".$SALE_HR[$user]);
- #$ASCII_text.=" | ".sprintf("%5s", sprintf('%0.2f',$SALE_count_HR[$user]."/hr"));
- #$ASCII_text.=" | ".sprintf("%3s", round($numcallshr[$user]));
- $ASCII_text.=" | ".sprintf("%4s", "$".$snitt);
- $ASCII_text.=" | ".sprintf("%5s", "$".$total_upsum[$user]);
- $ASCII_text.=" ".sprintf("%3s", ($upsale_count[$user]+0));
- #$ASCII_text.=" | ".sprintf("%5s", "$".$total_msum[$user]);
- #$ASCII_text.=" ".sprintf("%3s", ($md_count[$user]+0));
- $ASCII_text.=" | ".sprintf("%5s", "$".$total_vsum[$user]);
- $ASCII_text.=" ".sprintf("%3s", ($v_count[$user]+0));
- # $ASCII_text.=" | ".sprintf("%8s", ($other_HA_count[$user]+$sale_count[$user]+$ni_count[$user]));
- # $ASCII_text.=" | ".sprintf("%4s", ($ni_count[$user]+0));
- #$ASCII_text.=" | ".sprintf("%4s", $percent_SALE."%");
- $ASCII_text.=" |<span STYLE='background-color: $ptimehigh'> ".sprintf("%9s", sprintf( "%02d:%02d:%02d", $ptime[$user] / 3600, $ptime[$user] / 60 % 60, $ptime[$user] % 60 ));
- $ASCII_text.=" </span>|<span STYLE='background-color: $dtimehigh'> ".sprintf("%8s", sprintf( "%02d:%02d:%02d", $dtime[$user] / 3600, $dtime[$user] / 60 % 60, $dtime[$user] % 60 ));
- $ASCII_text.=" ".sprintf("%5s", sprintf('%0.1f', $wrap_per[$user])."%");
- #$ASCII_text.=" </span>| ".sprintf("%9s", sprintf( "%02d:%02d:%02d", $ttime[$user] / 3600, $ttime[$user] / 60 % 60, $ttime[$user] % 60 )." |");
- $ASCII_text.="</span> |</span>\n";
- $CSV_text.="\"$user_list[$user]\",\"$amount\",\"".($sale_count[$user]+0)."\",\"$snitt\",\"".($other_HA_count[$user]+$sale_count[$user]+$ni_count[$user])."\",\"$percent_SALE\",\"".($ni_count[$user]+0)."\",\"".($other_HA_count[$user]+0)."\"\n";
- $rowoddeven++;
- }
- }
- ####END PERSONAL STATS#####
- if (!$agentpstats) {
- if (array_sum($sale_count) == 0) {
- $sum_snitt=0;
- $sum_percent_SALE=0;
- $sum_SALE_HR=0;
- } else {
- $sum_snitt=round(array_sum($total_dsum)/(array_sum($sale_count)-array_sum($open_count)));
- $sum_percent_SALE=round(array_sum($sale_count)/(array_sum($sale_count)+array_sum($ni_count))*100);
- $sum_SALE_HR=round((array_sum($total_dsum)+array_sum($total_upsum))/(array_sum($ttime) / 3600));
- }
- $ASCII_text.="+--------------------------------+-------+-----+----+----------+-------+-----+------+------+----+------+----+------+----+------+-----------+---------+-------+-----------+$HTMLborderheader\n";
- $ASCII_text.="<span style=\"background-color:#FFFF66;\">| Agents: $countusers".sprintf("%-11s", "");
- $ASCII_text.=" | ".sprintf("%13s", "<b>$".round((array_sum($total_dsum)+array_sum($total_upsum)))."</b>");
- $ASCII_text.=" | ".sprintf("%6s", "$".round(array_sum($total_dsum)));
- $ASCII_text.=" ".sprintf("%4s", (array_sum($sale_count)+0));
- $ASCII_text.=" ".sprintf("%4s", (array_sum($open_count)+0));
- $ASCII_text.=" | ".sprintf("%8s", "$".$sum_SALE_HR."/hr");
- $ASCII_text.=" | ".sprintf("%5s", sprintf('%0.2f',array_sum($SALE_count_HR) / $countusers."/hr"));
- $ASCII_text.=" | ".sprintf("%3s", round(array_sum($numcallshr) / $countusers));
- $ASCII_text.=" | ".sprintf("%4s", "$".$sum_snitt);
- $ASCII_text.=" | ".sprintf("%5s", "$".array_sum($total_upsum));
- $ASCII_text.=" ".sprintf("%3s", (array_sum($upsale_count)+0));
- $ASCII_text.=" | ".sprintf("%5s", "$".array_sum($total_msum));
- $ASCII_text.=" ".sprintf("%3s", (array_sum($md_count)+0));
- $ASCII_text.=" | ".sprintf("%5s", "$".array_sum($total_vsum));
- $ASCII_text.=" ".sprintf("%3s", (array_sum($v_count)+0));
- # $ASCII_text.=" | ".sprintf("%8s", (array_sum($other_HA_count)+array_sum($sale_count)+array_sum($ni_count)));
- # $ASCII_text.=" | ".sprintf("%4s", (array_sum($ni_count)+0));
- $ASCII_text.=" | ".sprintf("%4s", $sum_percent_SALE."%");
- $ASCII_text.=" | ".sprintf("%9s", sprintf( "%03d:%02d:%02d", array_sum($ptime) / 3600, array_sum($ptime) / 60 % 60, array_sum($ptime) % 60 ));
- $ASCII_text.=" | ".sprintf("%8s", sprintf( "%02d:%02d:%02d", array_sum($dtime) / 3600, array_sum($dtime) / 60 % 60, array_sum($dtime) % 60 ));
- $ASCII_text.=" ".sprintf("%5s", sprintf('%0.1f', array_sum($wrap_per) / $countusers)."%");
- $ASCII_text.=" | ".sprintf("%9s", sprintf( "%03d:%02d:%02d", array_sum($ttime) / 3600, array_sum($ttime) / 60 % 60, array_sum($ttime) % 60 )." |");
- $ASCII_text.="</span>\n";
- $CSV_text.="\"ALL:\",\"\",\"".array_sum($total_dsum)."\",\"".(array_sum($sale_count)+0)."\",\"".$sum_snitt."\",\"".(array_sum($other_HA_count)+array_sum($sale_count)+array_sum($ni_count))."\",\"$sum_percent_SALE\",\"".(array_sum($ni_count)+0)."\",\"".(array_sum($other_HA_count)+0)."\"\n";
- $CSV_text.="\n\n";
- $ASCII_text.="+--------------------------------+-------+-----+----+----------+-------+-----+------+------+----+------+----+------+----+------+-----------+---------+-------+-----------+$HTMLborderheader\n";
- $ASCII_text.="| $resetlink TOTAL | Donations | Hourly Stats | | Up Sales | Monthlys | Verified | | Time Spent |$HTMLborderheader\n";
- $ASCII_text.="+--------------------------------+------------------+------------------------+------+-----------+-----------+-----------+------+-----------------------------------------+$HTMLborderheader\n";
- // compare starttime with current time and show result
- }
- $totaltime = (microtime(1) - $starttime);
- $ASCII_text.= $amthrkey;
- if ($timeout){$ASCII_text.= "<Br>Stats refresh every $timeout Seconds<br>";}
- $ASCII_text.= "Last Update: ".DATE('m-d-Y h:i:s');
- $ASCII_text.= "<br /><br />Execution-time: ".$totaltime."S - ".$db_source."\n\n";
- $ASCII_text.="</FONT></PRE>";
- $ASCII_text.="</BODY>\n";
- $ASCII_text.="</HTML>\n";
- # for debugging and developing
- /*
- echo "<pre>";
- print_r($total_count);
- echo "\nuser_list\n";
- print_r($user_list);
- echo "\ntotal_sum\n";
- print_r($total_dsum);
- echo "\nsale_count\n";
- print_r($sale_count);
- echo "\nni_count\n";
- print_r($ni_count);
- echo "\nother_HA_count\n";
- print_r($other_HA_count);
- echo "\np1_sum\n";
- print_r($p1_sum);
- echo "\np2_sum\n";
- print_r($p2_sum);
- echo "\np3_sum\n";
- print_r($p3_sum);
- echo "\np4_sum\n";
- print_r($p4_sum);
- echo "\np5_sum\n";
- print_r($p5_sum);
- echo "\np6_sum\n";
- print_r($p6_sum);
- echo "\np7_sum\n";
- print_r($p7_sum);
- echo "\np8_sum\n";
- print_r($p8_sum);
- echo "\np0_sum\n";
- print_r($p0_sum);
- echo "</pre>";
- */
- }
- if ($file_download>0)
- {
- $FILE_TIME = date("Ymd-His");
- $CSVfilename = "domedan_leaderboard_$US$FILE_TIME.csv";
- $CSV_text=preg_replace('/\n +,/', ',', $CSV_text);
- $CSV_text=preg_replace('/ +\"/', '"', $CSV_text);
- $CSV_text=preg_replace('/\" +/', '"', $CSV_text);
- // We'll be outputting a TXT file
- header('Content-type: application/octet-stream');
- // It will be called LIST_101_20090209-121212.txt
- header("Content-Disposition: attachment; filename=\"$CSVfilename\"");
- header('Expires: 0');
- header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
- header('Pragma: public');
- ob_clean();
- flush();
- echo "$CSV_text";
- exit;
- }
- else
- {
- header("Content-type: text/html; charset=utf-8");
- $HTML_text.=$ASCII_text;
- echo $HTML_head;
- $short_header=1;
- if (!$SUBMIT){
- require("admin_header.php");
- }
- echo $HTML_text;
- flush();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement