function displayPage($date) { global $DB, $connection_string, $conn; // ****************************************************************************************************** // ***** DAILY CALL ACTIVITY REPORT ***** // ****************************************************************************************************** echo "<div id=\"tabs\" class=\"tabs\" style=\"font-size:x-small; visibility:visible\">"; echo "<h4 style=\"font-variant: small-caps; font-size:large\">daily call center flash activity report</h4>"; // ******************* Create All The Tabs ************************* echo " <ul>"; echo "\t\t<li><a href=\"#callTotal\"<span>Total</span></a></li>"; $query = "\tSELECT DISTINCT\t\tclientGroup\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tFROM\t\t\t\tusi_tbl_activequeue"; $result = mysql_query($query, $conn) or die('Query failed: ' . mysql_error()); if (mysql_num_rows($result) > 0) { while ($rows = mysql_fetch_array($result, MYSQL_NUM)) { echo "<li><a href=\"#" . "Call" . $rows[0] . "\"<span>" . $rows[0] . "</span></a></li>"; } } echo "\t</ul>"; // ****************** DISPLAY CALL TOTALS **************************** echo " <div id=\"callTotal\">"; displayHeader("Total"); displayRowFlash(-1, $date); displayEnd(); echo " </div>"; // ****************** DISPLAY ALL CLIENT DIVS ************************ $query = "\tSELECT DISTINCT\t\tclientGroup\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tFROM\t\t\t\tusi_tbl_activequeue"; $result = mysql_query($query, $conn) or die('Query failed: ' . mysql_error()); if (mysql_num_rows($result) > 0) { while ($rows = mysql_fetch_array($result, MYSQL_NUM)) { echo "\t<div id=\"" . "Call" . $rows[0] . "\">"; displayHeader($rows[0]); displayRowFlash($rows[0], $date); displayEnd(); echo "\t</div>"; } } echo "</div>"; echo "<br>"; echo "<br>"; // ****************************************************************************************************** // ***** DAILY APPT SCHEDULE REPORT ***** // ****************************************************************************************************** echo "<div id=\"tabs2\" class=\"tabs2\" style=\"font-size:x-small; visibility:visible\">"; echo "<h4 style=\"font-variant: small-caps; font-size:large\">daily appointment scheduling flash report</h4>"; // ******************* Create All The Tabs ************************* echo " <ul>"; echo "\t\t<li><a href=\"#callTotal2\"<span>Total</span></a></li>"; $employer_query = "Exec usp_USI_GetEmployerGroups"; $process = odbc_exec($connection_string, $employer_query); while (odbc_fetch_row($process)) { // Restitch and strip charactars to remove errors when choosing tabs $words = explode(' ', odbc_result($process, "employergroup_nm")); $words_sewn = implode("-", $words); $words_sewn = str_replace(",", "", $words_sewn); $words_sewn = str_replace(".", "", $words_sewn); echo "<li><a href=\"#" . "Appt" . $words_sewn . "\"<span>" . $words_sewn . "</span></a></li>"; } echo "\t</ul>"; // ****************** DISPLAY CLIENT TOTALS ************************** echo " <div id=\"callTotal2\">"; displayApptHeader("Total"); displayRowAppt(-1, $date); displayEnd(); echo " </div>"; // ****************** DISPLAY ALL CLIENT DIVS ************************ $employer_arr = array(); $employer_query = "Exec usp_USI_GetEmployerGroups"; $process = odbc_exec($connection_string, $employer_query); while (odbc_fetch_row($process)) { $words = explode(' ', odbc_result($process, "employergroup_nm")); $words_sewn = implode("-", $words); $words_sewn = str_replace(",", "", $words_sewn); $words_sewn = str_replace(".", "", $words_sewn); $employer_arr[odbc_result($process, "employergroup_id")] = $words_sewn; } foreach ($employer_arr as $empl_id => $empl_nm) { echo "\t<div id=\"" . "Appt" . $empl_nm . "\">"; displayApptHeader($empl_nm); displayRowAppt($empl_id, $date); displayEnd(); echo "\t</div>"; } echo "</div>"; echo "<br>"; echo "<br>"; // ****************************************************************************************************** // ***** DAILY APPT SCHEDULE REPORT ***** // ****************************************************************************************************** echo "<div id=\"tabs3\" class=\"tabs3\" style=\"font-size:x-small; visibility:visible\">"; echo "<h4 style=\"font-variant: small-caps; font-size:large\">daily call center flash agent report</h4>"; // ******************* Create All The Tabs ************************* echo " <ul>"; echo "\t\t<li><a href=\"#callTotal3\"<span>Total</span></a></li>"; $query = "\tSELECT \t\t\t\tconcat(substring(firstname,1,1),'-', lastname)\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tFROM\t\t\t\ttbl_callagents\n\t\t\t\t\t\t\t\t\t\tORDER BY\t\t\tagent_id"; $result = mysql_query($query, $conn) or die('Query failed: ' . mysql_error()); if (mysql_num_rows($result) > 0) { while ($rows = mysql_fetch_array($result, MYSQL_NUM)) { echo "<li><a href=\"#" . "Agent" . $rows[0] . "\"<span>" . $rows[0] . "</span></a></li>"; } } echo "\t</ul>"; // ****************** DISPLAY CLIENT TOTALS ************************** echo "\t<div id=\"callTotal3\">"; displayAgentHeader("Total"); displayRowAgent(-1, $date); displayEnd(); echo "\t</div>"; // ****************** DISPLAY ALL CLIENT DIVS ************************ $query = "\tSELECT \t\t\t\tconcat(substring(firstname,1,1),'-', lastname), agent_id\n\t\t\t\t\tFROM\t\t\t\ttbl_callagents\n\t\t\t\t\tORDER BY\t\t\tagent_id"; $result = mysql_query($query, $conn) or die('Query failed: ' . mysql_error()); if (mysql_num_rows($result) > 0) { while ($rows = mysql_fetch_array($result, MYSQL_NUM)) { echo "\t<div id=\"Agent" . $rows[0] . "\""; displayAgentHeader($rows[0]); displayRowAgent($rows[1], $date); displayEnd(); echo "\t</div>"; } } echo "</div>"; }
$words_sewn = implode("-", $words); $words_sewn = str_replace(",", "", $words_sewn); $words_sewn = str_replace(".", "", $words_sewn); $employer_arr[odbc_result($process, "employergroup_id")] = $words_sewn; } foreach ($employer_arr as $empl_id => $empl_nm) { displayRowAppt($empl_id); } // Total Agent Report displayRowAgent(-1); // Individual $query = "\tSELECT \t\t\t\tconcat(substring(firstname,1,1),'-', lastname), agent_id\n\t\t\t\tFROM\t\t\t\ttbl_callagents"; $result = mysql_query($query, $conn) or die('Query failed: ' . $query . mysql_error()); if (mysql_num_rows($result) > 0) { while ($rows = mysql_fetch_array($result, MYSQL_NUM)) { displayRowAgent($rows[1]); } } function flashAgentInsert($clientGroup) { include 'config.php'; global $DB; $DB = str_replace("\"", "", $DB); $connection_string = odbc_connect($DB, "", ""); global $curDay, $prevDay, $WTD, $MTD, $YTD, $beginWk, $endWk, $nextBizDay, $conn; global $curDay_ts, $prevDay_ts, $WTD_ts, $MTD_ts, $YTD_ts, $beginWk_ts, $endWk_ts; $empl_tbl = array(); for ($i = 0; $i < 4; $i++) { // *********************** IB OFFERED ***************************** $query = "\tSELECT count(*), sum(C.hold_time)/count(*), sum(C.duration)/count(*) \n\t\t\t\t\tFROM usi_tbl_callqueue as C\n\t\t\t\t\tJOIN usi_tbl_activequeue as Q\n\t\t\t\t\tON C.queue_label = Q.client_queue\n\t\t\t\t\tJOIN tbl_callagents as A\n\t\t\t\t\tON A.ext = substr(C.destination,12,3)\n\t\t\t\t\tAND call_type <> 'CONNECT'\n\t\t\t\t\tAND\t\t\tcall_type <> 'TRANSFER'\n\t\t\t\t\tAND Q.active = '1' \n\t\t\t\t\tAND C.end_type <> '0' "; if ($i == 0) {