0){ $IMAGE_reload = 1; } // Check for new or old traffic if($REQUEST_monitor_traffic == "yes"){ $result_idle = DATABASE_query("SELECT * FROM ".$DB_prefix."system WHERE operator='$ADMIN_operator' AND time<$TRAFFIC_idle"); $result_online = DATABASE_query("SELECT * FROM ".$DB_prefix."sounds WHERE operator='$ADMIN_operator' AND time>$TRAFFIC_idle"); if(DATABASE_fetch($result_idle)){ $IMAGE_reload = 1; } if(DATABASE_fetch($result_online)){ $IMAGE_reload = 1; } } // Check for chat requests // Loop each department that the operator belongs too $result_dep = DATABASE_query("SELECT * FROM ".$DB_prefix."departments WHERE operator='$ADMIN_operator' ORDER BY id ASC"); while($get = DATABASE_fetch($result_dep)){ $ADMIN_department = $get["department"]; $ADMIN_poll = $get["poll"]; $result_request = DATABASE_query("SELECT * FROM ".$DB_prefix."session WHERE alert='request' AND department='$ADMIN_department' AND poll='$ADMIN_poll' ORDER BY id DESC"); if($fetch = DATABASE_fetch($result_request)){ $IMAGE_reload = 1; $IMAGE_uid = $fetch["chatid"]; $IMAGE_id = $fetch["id"]; // Update request so that it does not keep refreshing the traffic monitor DATABASE_query("UPDATE ".$DB_prefix."session SET alert='received' WHERE chatid='$IMAGE_uid' AND id='$IMAGE_id'"); } $ADMIN_opchatdep = "opchat_".$ADMIN_operator; $result_opchat = DATABASE_query("SELECT * FROM ".$DB_prefix."session WHERE alert='opchat' AND department='$ADMIN_opchatdep' AND poll='0' ORDER BY id DESC"); if($fetch = DATABASE_fetch($result_opchat)){ $IMAGE_reload = 1; $IMAGE_uid = $fetch["chatid"]; $IMAGE_id = $fetch["id"]; // Update request so that it does not keep refreshing the traffic monitor DATABASE_query("UPDATE ".$DB_prefix."session SET alert='opchatreceived' WHERE chatid='$IMAGE_uid' AND id='$IMAGE_id'"); } $result_transfer = DATABASE_query("SELECT * FROM ".$DB_prefix."session WHERE alert='transfer' AND department='$ADMIN_department' AND poll='$ADMIN_poll' ORDER BY id DESC"); if($fetch = DATABASE_fetch($result_transfer)){ $IMAGE_reload = 1; $IMAGE_uid = $fetch["chatid"]; $IMAGE_id = $fetch["id"]; // Update request so that it does not keep refreshing the traffic monitor DATABASE_query("UPDATE ".$DB_prefix."session SET alert='transfering' WHERE chatid='$IMAGE_uid' AND id='$IMAGE_id'"); } } // Check if we need to reload the traffic monitor if(isset($IMAGE_reload)){ $IMAGE_file = $URL_maindir."/lh/images/pix_two.gif"; }else{ $IMAGE_file = $URL_maindir."/lh/images/pix_one.gif"; } Header("Content-type: image/gif"); readfile($IMAGE_file); ?>