registerFunction("checkIOBStatus"); session_start(); $user = $_SESSION['user']; $in_xAjax = false; $xAjax_objResponse; $NoInactivityTimer = true; // Set so the xajax calls don't look at the inactivity timer. include('common_admin_inc.htm'); include('IOB_inc.htm'); // Function to check the status off all blades if any are not ready or powered down a timer is set to rerun the function. function checkIOBStatus() { global $in_xAjax; global $xAjax_objResponse; global $IOB_bladeStatus; $user = $_SESSION['user']; $xAjax_objResponse = new xajaxResponse(); $in_xAjax = true; // This must be called because we set NoInactivityTimer to true because of xajax loading the page behind the sheets. // Which causes an xajax XML error if the user is redirected to the login page durring the xajax call setup. // If we are logged out this function will reload the page which will take the user back to the login page. CheckLoggedOut(); error_log("Reloading I/O Blade Status"); //$xAjax_objResponse->script('alert(xajax.$("testlevel[1]").value);'); $iobs = get_blades($user); //error_log("In XAjaX - iobs = ". print_r($iobs,true) ); //error_log("=========================================================================="); $doItAgain = false; foreach($iobs as $iob) { if( $iob->status == 6 ) $xAjax_objResponse->assign("IOBStat_".$iob->id, "innerHTML", $IOB_bladeStatus[$iob->status]); else $xAjax_objResponse->assign("IOBStat_".$iob->id, "innerHTML", "".$IOB_bladeStatus[$iob->status].""); $xAjax_objResponse->assign("IOBStat", "innerHTML", "Note: One or more I/O Blades are not ready. The page will auto re-load when all the I/O Blades are ready."); if( $iob->status != 6 ) { // This blade is NOT ready so set a timer to try this again. $doItAgain = true; } } if( $doItAgain ) $xAjax_objResponse->script('setTimeout("xajax_checkIOBStatus()",20000);'); else $xAjax_objResponse->script('setTimeout("location.reload(true)",10);'); $in_xAjax = false; return $xAjax_objResponse; } $xajax->processRequest(); /*******************************************************************************************/ // Handle the progress screen if opened and get the NEW data if ($_SERVER[REQUEST_METHOD] == "POST") { $operationInProgress = true; $status = new ReturnStatus(); //... print $status->out(); return; } ?>
printJavascript(); ?>