diff --git a/app/call_centers/call_center_agent_status.php b/app/call_centers/call_center_agent_status.php index 5e076d8dc2..350b0abe1a 100644 --- a/app/call_centers/call_center_agent_status.php +++ b/app/call_centers/call_center_agent_status.php @@ -67,6 +67,11 @@ //get the http post values and set them as php variables if (count($_POST) > 0) { + //debug info + //echo "
\n"; + //print_r($_POST); + //echo "\n"; + foreach($_POST['agents'] as $row) { if (strlen($row['agent_status']) > 0) { //agent set status @@ -76,7 +81,7 @@ $sql = "update v_users set "; $sql .= "user_status = '".$row['agent_status']."' "; $sql .= "where domain_uuid = '".$domain_uuid."' "; - $sql .= "and username = '".$row['agent_name']."' "; + $sql .= "and user_uuid = '".$row['user_uuid']."' "; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); } @@ -97,20 +102,20 @@ //echo $cmd."\n"; //set the agent status to available and assign the agent to the queue with the tier - if (isset($row['queue_name']) && $row['agent_status'] == 'Available') { + if (isset($row['queue_uuid']) && $row['agent_status'] == 'Available') { //set the call center status //$cmd = "api callcenter_config agent set status ".$row['agent_name']."@".$_SESSION['domain_name']." '".$row['agent_status']."'"; //$response = event_socket_request($fp, $cmd); //assign the agent to the queue - $cmd = "api callcenter_config tier add ".$row['queue_name']." ".$row['agent_uuid']." 1 1"; + $cmd = "api callcenter_config tier add ".$row['queue_uuid']." ".$row['agent_uuid']." 1 1"; //echo $cmd."
\n"; - //print_r($agents); - //echo "\n"; + echo "
\n"; + print_r($agents); + echo "\n"; //set the row style $c = 0; @@ -268,6 +272,7 @@ $html .= "