by jjohnson78 » Thu Mar 10, 2016 9:11 pm
In your version of AST_agent_status_detail.php, this is a snippet of code that starts at around line 550. Note the bolded red variable:
##########
$status_rows_to_print=0;
while($status_row=mysqli_fetch_row($status_rslt))
{
$current_status=$status_row[0];
if ($show_defunct_users)
{
$stmt="SELECT count(*) as calls,'' as full_name,user,status from ".$agent_log_table." where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and status='$current_status' $group_SQL $user_group_SQL group by user,full_name,status order by full_name,user,status desc limit 500000;";
}
else
{
$stmt="SELECT count(*) as calls,full_name,vicidial_users.user,status from vicidial_users,".$agent_log_table." where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=".$agent_log_table.".user and status='$current_status' $group_SQL $user_group_SQL group by user,full_name,status order by full_name,user,status desc limit 500000;";
}
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {echo "$stmt\n";}
$status_rows_to_print = mysqli_num_rows($rslt);
$rows_to_print+=$status_rows_to_print;
$i=0; $sub_status_count=0;
while ($i < $status_rows_to_print)
{
##########
Move that one red, bolded variable to where the "$status_rows_to_print=0;" variable is printed, like so:
##########
$status_rows_to_print=0; $sub_status_count=0;
while($status_row=mysqli_fetch_row($status_rslt))
{
$current_status=$status_row[0];
if ($show_defunct_users)
{
$stmt="SELECT count(*) as calls,'' as full_name,user,status from ".$agent_log_table." where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and status='$current_status' $group_SQL $user_group_SQL group by user,full_name,status order by full_name,user,status desc limit 500000;";
}
else
{
$stmt="SELECT count(*) as calls,full_name,vicidial_users.user,status from vicidial_users,".$agent_log_table." where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=".$agent_log_table.".user and status='$current_status' $group_SQL $user_group_SQL group by user,full_name,status order by full_name,user,status desc limit 500000;";
}
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {echo "$stmt\n";}
$status_rows_to_print = mysqli_num_rows($rslt);
$rows_to_print+=$status_rows_to_print;
$i=0;
while ($i < $status_rows_to_print)
{
##########
See if that helps.