Update call_center_agent_status.php

This commit is contained in:
AlexanderDCrane 2019-06-01 12:30:20 -06:00 committed by GitHub
parent ed43a99129
commit 903c29efb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 24 deletions

View File

@ -49,17 +49,16 @@
//get the agents from the database //get the agents from the database
$sql = "select * from v_call_center_tiers "; $sql = "select * from v_call_center_tiers ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; $sql .= "where domain_uuid = :domain_uuid ";
$prep_statement = $db->prepare(check_sql($sql)); $database = new database;
$prep_statement->execute(); $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$tiers = $prep_statement->fetchAll(PDO::FETCH_NAMED); $tiers = $database->select($sql, $parameters, 'all');
if (count($tiers) == 0) { if (count($tiers) == 0) {
$per_queue_login = true; $per_queue_login = true;
} }
else { else {
$per_queue_login = false; $per_queue_login = false;
} }
unset($prep_statement, $sql);
//setup the event socket connection //setup the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
@ -79,11 +78,13 @@
//set the user_status //set the user_status
if (!isset($row['queue_name'])) { if (!isset($row['queue_name'])) {
$sql = "update v_users set "; $sql = "update v_users set ";
$sql .= "user_status = '".$row['agent_status']."' "; $sql .= "user_status = :row['agent_status'] ";
$sql .= "where domain_uuid = '".$domain_uuid."' "; $sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and user_uuid = '".$row['user_uuid']."' "; $sql .= "and user_uuid = :row['user_uuid'] ";
$prep_statement = $db->prepare(check_sql($sql)); $parameters['agent_uuid'] = $row['agent_uuid'];
$prep_statement->execute(); $parameters['agent_status'] = $row['agent_status'];
$database = new database;
$database->select($sql, $parameters);
} }
//set the call center status //set the call center status
@ -124,11 +125,11 @@
//set the blf status //set the blf status
//get the agents from the database //get the agents from the database
$sql = "select agent_name from v_call_center_agents "; $sql = "select agent_name from v_call_center_agents ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; $sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and call_center_agent_uuid = '".$row['agent_uuid']."' "; $sql .= "and call_center_agent_uuid = :row['agent_uuid'] ";
$prep_statement = $db->prepare(check_sql($sql)); $database = new database;
$prep_statement->execute(); $parameters['agent_uuid'] = $row['agent_uuid'];
$agent_name = $prep_statement->fetchAll(PDO::FETCH_NAMED); $agent_name = $database->select($sql, $parameters, 'all');
if ($row['agent_status'] == 'Available') { if ($row['agent_status'] == 'Available') {
$answer_state = 'confirmed'; $answer_state = 'confirmed';
@ -151,11 +152,10 @@
//get the agents from the database //get the agents from the database
$sql = "select * from v_call_center_agents "; $sql = "select * from v_call_center_agents ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; $sql .= "where domain_uuid = :domain_uuid ";
$sql .= "order by agent_name ASC "; $sql .= "order by agent_name ASC ";
$prep_statement = $db->prepare(check_sql($sql)); $database = new database;
$prep_statement->execute(); $agents = $database->select($sql, $parameters, 'all');
$agents = $prep_statement->fetchAll(PDO::FETCH_NAMED);
//get the agent list from event socket //get the agent list from event socket
$switch_cmd = 'callcenter_config agent list'; $switch_cmd = 'callcenter_config agent list';
@ -169,12 +169,10 @@
//get the call center queues from the database //get the call center queues from the database
$sql = "select * from v_call_center_queues "; $sql = "select * from v_call_center_queues ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; $sql .= "where domain_uuid = :domain_uuid ";
$sql .= "order by queue_name asc "; $sql .= "order by queue_name asc ";
$prep_statement = $db->prepare(check_sql($sql)); $database = new database;
$prep_statement->execute(); $call_center_queues = $database->select($sql, $parameters, 'all');
$call_center_queues = $prep_statement->fetchAll(PDO::FETCH_NAMED);
unset ($prep_statement, $sql);
//add the status to the call_center_queues array //add the status to the call_center_queues array
$x = 0; $x = 0;