DBconnect(); if (!is_array( $_POST )) $_POST = array(); if (!is_array( $_GET )) $_GET = array(); $_POST = array_merge( $_POST, $_GET ); if ( !isset( $_POST['NowLang'] ) ) $_POST['NowLang'] = ""; IPCR_SessionCreate($db, $_POST['NowLang']); OnCheckPermission( $db, $_SESSION, 'Real time call monitoring' ); $xml = getXML(sprintf("../../lang/%s/agent_monitoring.xml", $_SESSION['Lang'] ? $_SESSION['Lang'] : 'en' )); $FRC_HeadTitle = $xml->data[0]->list[0]->FRC_HeadTitle[0]["Stitle"]; $FRC_RealTimeRequest = $xml->data[0]->list[0]->FRC_RealTimeRequest[0]["Stitle"]; $FRC_RealTimeStopRequest = $xml->data[0]->list[0]->FRC_RealTimeStopRequest[0]["Stitle"]; $FRC_RealTimeStart = $xml->data[0]->list[0]->FRC_RealTimeStart[0]["Stitle"]; $FRC_UserID = $xml->data[0]->list[0]->FRC_UserID[0]["Stitle"]; $FRC_UserName = $xml->data[0]->list[0]->FRC_UserName[0]["Stitle"]; $FRC_BG_Group = $xml->data[0]->list[0]->FRC_BG_Group[0]["Stitle"]; $FRC_MG_Group = $xml->data[0]->list[0]->FRC_MG_Group[0]["Stitle"]; $FRC_SG_Group = $xml->data[0]->list[0]->FRC_SG_Group[0]["Stitle"]; $FRC_EXT_NUM = $xml->data[0]->list[0]->FRC_EXT_NUM[0]["Stitle"]; $FRC_STATUS = $xml->data[0]->list[0]->FRC_STATUS[0]["Stitle"]; $FRC_CALL_NUM = $xml->data[0]->list[0]->FRC_CALL_NUM[0]["Stitle"]; $FRC_TODAYTOTAL = $xml->data[0]->list[0]->FRC_TODAYTOTAL[0]["Stitle"]; $FRC_SAND = $xml->data[0]->list[0]->FRC_SAND[0]["Stitle"]; $FRC_GIVE = $xml->data[0]->list[0]->FRC_GIVE[0]["Stitle"]; $FRC_ETC = $xml->data[0]->list[0]->FRC_ETC[0]["Stitle"]; $FRC_TIME = $xml->data[0]->list[0]->FRC_TIME[0]["Stitle"]; $FRC_Login = $xml->data[0]->list[0]->FRC_Login[0]["Stitle"]; $FRC_Logout = $xml->data[0]->list[0]->FRC_Logout[0]["Stitle"]; $FRC_Calling = $xml->data[0]->list[0]->FRC_Calling[0]["Stitle"]; $FRC_CALLING_NUM = $xml->data[0]->list[0]->FRC_CALLING_NUM[0]["Stitle"]; $FRC_Ready = $xml->data[0]->list[0]->FRC_Ready[0]["Stitle"]; $FRC_SEARCH = $xml->data[0]->list[0]->FRC_SEARCH[0]["Stitle"]; $FRC_BNT_ICON = $xml->data[0]->list[0]->FRC_BNT_ICON[0]["Stitle"]; $FRC_BNT_GRID = $xml->data[0]->list[0]->FRC_BNT_GRID[0]["Stitle"]; $FRC_RealTimeRequestAlert = $xml->data[0]->list[0]->FRC_RealTimeRequestAlert[0]["Stitle"]; $FRC_NoStatus = $xml->data[0]->list[0]->FRC_NoStatus[0]["Stitle"]; $FRC_MenuDown = $xml->data[0]->list[0]->FRC_MenuDown[0]["Stitle"]; $FRC_MenuUp = $xml->data[0]->list[0]->FRC_MenuUp[0]["Stitle"]; $query = sprintf( " SELECT SUM(case when r_call_kind1 != '' then 1 else 0 end) as total_call, SUM(case when r_call_kind1='I' then 1 else 0 end ) as in_call, SUM(case when r_call_kind1='O' then 1 else 0 end) as out_call, SUM(case when r_call_kind1='Z' then 1 else 0 end) + SUM(case when r_call_kind1='T' then 1 else 0 end) as ext_call, SUM(case when r_rec_rtime between '00' and '09' then 1 else 0 end) as call_1, SUM(case when r_rec_rtime between '10' and '11' then 1 else 0 end) as call_2, SUM(case when r_rec_rtime between '12' and '13' then 1 else 0 end) as call_3, SUM(case when r_rec_rtime between '14' and '15' then 1 else 0 end) as call_4, SUM(case when r_rec_rtime between '16' and '17' then 1 else 0 end) as call_5, SUM(case when r_rec_rtime between '18' and '24' then 1 else 0 end) as call_6 FROM rs_recfile WHERE r_rec_date = '%s' and r_v_sys_code = '%s' ", date("Ymd" ), IPCR_MySysId($db) ); $db->ExecSql($query,"S"); if($db->Num) { for($i=0;$i<$db->Num;$i++) { $row = $db->GetPosition($i); $total_call = $row['total_call']; $in_call = $row['in_call']; $out_call = $row['out_call']; $ext_call = $row['ext_call']; $call_1 = $row['call_1']; $call_2 = $row['call_2']; $call_3 = $row['call_3']; $call_4 = $row['call_4']; $call_5 = $row['call_5']; $call_6 = $row['call_6']; } // for end } // $db->Num end $szQuery = sprintf( "SELECT * FROM RS_SYS_INFO_IPCR ORDER BY R_SYS_ID ASC" ); $db->ExecSql( $szQuery, "S" ); if ( $db->Num > 0 ) { $i = 0; while( $row = $db->Fetch() ) { if ( !isset( $row['R_SYS_ID'] ) ) $row['R_SYS_ID'] = ""; if ( !isset( $row['R_DUP_SYS_IP'] ) ) $row['R_DUP_SYS_IP'] = ""; if ( !isset( $row['R_SYS_NAME'] ) ) $row['R_SYS_NAME'] = ""; if ( !isset( ${'TARGET_SERVER_IP_' . $row['R_SYS_ID']} ) ) ${'TARGET_SERVER_IP_' . $row['R_SYS_ID']} = ""; if ( !isset( ${'TARGET_SERVER_PORT_' . $row['R_SYS_ID']} ) ) ${'TARGET_SERVER_PORT_' . $row['R_SYS_ID']} = ""; if ( !isset( ${'TARGET_REC_PORT_' . $row['R_SYS_ID']} ) ) ${'TARGET_REC_PORT_' . $row['R_SYS_ID']} = ""; $arServerInfo[ $row['R_SYS_ID'] ] = array( "ID" => $row['R_SYS_ID'], "KIND" => $row['R_DUP_SYS_IP'], "NAME" => $row['R_SYS_NAME'], "IP" => sprintf( "%s", ${'TARGET_SERVER_IP_' . $row['R_SYS_ID']} ), "PORT" => sprintf( "%s", ${'TARGET_SERVER_PORT_' . $row['R_SYS_ID']} ), "REC_PORT" => sprintf( "%s", ${'TARGET_REC_PORT_' . $row['R_SYS_ID']} ), ); } $db->ResultFree(); } if ( empty( $_GET['sys_type'] ) && is_array( $arServerInfo ) ) { $arInfo = array_shift( $arServerInfo ); $_GET['sys_type'] = $arInfo['ID']; $serverIp = $arInfo['IP']; $serverPort = $arInfo['REC_PORT']; } else { $serverIp = $arServerInfo[$_GET['sys_type']]['IP']; $serverPort = $arServerInfo[$_GET['sys_type']]['REC_PORT']; } if ( !isset( ${'RECSEERM_' . $_GET['sys_type']} ) ) ${'RECSEERM_' . $_GET['sys_type']} = ""; $RECSEERM = ${'RECSEERM_' . $_GET['sys_type']}; if ( !isset( ${'RECSEERM_CLASSID_' . $_GET['sys_type']} ) ) ${'RECSEERM_CLASSID_' . $_GET['sys_type']} = ""; $RECSEERM_CLASSID = ${'RECSEERM_CLASSID_' . $_GET['sys_type']}; if ( empty( $RECSEERM ) ) $RECSEERM = "RecSeeRM.ocx"; if ( empty( $RECSEERM_CLASSID ) ) $RECSEERM_CLASSID = "42ABBA96-0660-4206-97E3-7D8FC8C67A32"; if ( empty( $_GET['ifr_link'] ) ) $_GET['ifr_link'] = "./amonitoring_icon.php?sys_type=" . $_GET['sys_type']; if ( preg_match( "/amonitoring_icon/", $_GET['ifr_link'] ) ) { $icon_tap_class = "icon_view_over"; $grid_tap_class = "grid_view"; } else { $icon_tap_class = "icon_view"; $grid_tap_class = "grid_view_over"; } if ( !isset( $_COOKIE['monitoring_level'] ) ) $_COOKIE['monitoring_level'] = ""; if ( !isset( $_SERVER['SERVER_ADDR'] ) ) $_SERVER['SERVER_ADDR'] = ""; $szMultiIPCR_Selection = MultiIPCR_Selection($db, $_SERVER['HTTP_HOST']); ?> <?php echo("$FRC_HeadTitle"); ?>
", $szFirefox, $RECSEERM ); ?>
:
:
:
:
">">