getMessage(); $this->Message_Showing($sMessage, ""); if ($sMessage <> "") { // Message in Session, display $html .= "

" . $sMessage . "

"; $_SESSION[EW_SESSION_MESSAGE] = ""; // Clear message in Session } // Warning message $sWarningMessage = $this->getWarningMessage(); $this->Message_Showing($sWarningMessage, "warning"); if ($sWarningMessage <> "") { // Message in Session, display $html .= "
" . $sWarningMessage . "
"; $_SESSION[EW_SESSION_WARNING_MESSAGE] = ""; // Clear message in Session } // Success message $sSuccessMessage = $this->getSuccessMessage(); $this->Message_Showing($sSuccessMessage, "success"); if ($sSuccessMessage <> "") { // Message in Session, display $html .= "
" . $sSuccessMessage . "
"; $_SESSION[EW_SESSION_SUCCESS_MESSAGE] = ""; // Clear message in Session } // Failure message $sErrorMessage = $this->getFailureMessage(); $this->Message_Showing($sErrorMessage, "failure"); if ($sErrorMessage <> "") { // Message in Session, display $html .= "
" . $sErrorMessage . "
"; $_SESSION[EW_SESSION_FAILURE_MESSAGE] = ""; // Clear message in Session } echo "
" . $html . "
"; } // // Page class constructor // function __construct() { global $conn, $Language; $GLOBALS["Page"] = &$this; // Language object if (!isset($Language)) $Language = new cLanguage(); // User table object (users) if (!isset($GLOBALS["users"])) $GLOBALS["users"] = new cusers; // Page ID if (!defined("EW_PAGE_ID")) define("EW_PAGE_ID", 'custompage', TRUE); // Start timer if (!isset($GLOBALS["gTimer"])) $GLOBALS["gTimer"] = new cTimer(); // Open connection if (!isset($conn)) $conn = ew_Connect(); } // // Page_Init // function Page_Init() { global $gsExport, $gsExportFile, $UserProfile, $Language, $Security, $objForm; // Security $Security = new cAdvancedSecurity(); // Uncomment codes below for security if (!$Security->IsLoggedIn()) $Security->AutoLogin(); if (!$Security->IsLoggedIn()) $this->Page_Terminate("login.php"); // Get export parameters if (@$_GET["export"] <> "") { $this->Export = $_GET["export"]; } $gsExport = $this->Export; // Get export parameter, used in header // Global Page Loading event (in userfn*.php) Page_Loading(); // Page Load event $this->Page_Load(); } // // Page_Terminate // function Page_Terminate($url = "") { global $conn; // Page Unload event $this->Page_Unload(); // Global Page Unloaded event (in userfn*.php) Page_Unloaded(); $this->Page_Redirecting($url); // Close connection $conn->Close(); // Go to URL if specified if ($url <> "") { if (!EW_DEBUG_ENABLED && ob_get_length()) ob_end_clean(); header("Location: " . $url); } exit(); } // // Page main // function Page_Main() { global $Security, $Language; //$this->setSuccessMessage("Welcome " . CurrentUserName()); //$this->setSuccessMessage("Welcome " . CurrentUserID()); // Put your custom codes here $GLOBALS["Language"]->setProjectPhrase("bodytitle", "StarDoc - Volume Grid"); } // Page Load event function Page_Load() { //echo "Page Load"; } // Page Unload event function Page_Unload() { //echo "Page Unload"; } // Page Redirecting event function Page_Redirecting(&$url) { // Example: //$url = "your URL"; } // Message Showing event // $type = ''|'success'|'failure' function Message_Showing(&$msg, $type) { // Example: //if ($type == 'success') $msg = "your success message"; } } ?> Page_Init(); // Page main $custompage->Page_Main(); ?> ShowMessage(); ?> "; //echo "days remaining: $daysRemaining
"; // If current user level < 4 then the user can select which org they want to view if (CurrentUserLevel() < 4) { $org_id = strip_tags(substr($_GET['oi'], 0, 10)); $org_id = mysql_escape_string($org_id); if (is_null($org_id) || $org_id == '') { if (!isset($_SESSION['org_id'])) { // Default to NHSAU 03 - This is the client they want to use for demo. $org_id = 4; } else { $org_id = $_SESSION['org_id']; } } } // If current user level is >= 4 then get org ID from the user record. if (CurrentUserLevel() >= 4) { $user_id = CurrentUserID(); $org_id = ew_ExecuteScalar("SELECT org_id FROM users where user_id = " . CurrentUserID()); } $_SESSION['org_id'] = $org_id; $admins_list = ew_ExecuteScalar("SELECT Value_Char FROM system_values where Key_ID = 'FloorplanAdmins'"); $admins = explode(",",$admins_list); include_once "device_data.inc.php"; include_once "building_data.inc.php"; // Calculate savings for non-contracted devices $device_data = Get_Organization_Device_data_selected($org_id,'Both',-1,-1); if ($device_data != NULL) { //echo ""; foreach ($device_data as $device) { if (($device['is_proposed'] == 'Y' && $device['under_contract'] == 'N') || $device['under_contract'] == 'U') { /* echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; */ $savings_with_service += $device['fmc_costSavingsWithService']; $savings_without_service += $device['fmc_costSavingsWithoutService']; //echo "fmc_costSavingsWithoutService".$device['fmc_costSavingsWithoutService']."
"; } } //echo "
SN:".$device['serial_number']."Projected_black:".round($device['projected_black_year'])."Projected_color:".round($device['projected_color_year'])."savings_with_service:".round($device['savings_with_service'])."savings_without_service:".round($device['savings_without_service'])."
"; } $meterDataFeed = ew_ExecuteScalar("SELECT MeterDataFeed FROM organization where id = " . $org_id); if ($meterDataFeed != "PRESENT") { $device_data = Get_Organization_Device_data($org_id); } else { $is_proposed = 'Both'; $device_data = Get_Organization_Device_data_selected($org_id,$is_proposed,-1,-1); //Select where proposed flag = "N" or "Y". All buildings (-1) and All floorplans (-1) } //$admins_list = ew_ExecuteScalar("SELECT Value_Char FROM system_values where Key_ID = 'FloorplanAdmins'"); //$admins = explode(",",$admins_list); $reporting = $notReporting = $toner_alert = $service_needed = $non_contracted_device = 0; $firstPass = "Y"; $use_cpc = "N"; $ary_count = 0; $org_type_id_schools = array('1', '5', '6'); // Loop through the devices to calculate the total amounts if ($device_data != NULL) { //error_log(json_encode($device_data) . "\r\n\r\n", 3, "device_data.log"); //error_log("Session date = " . $_SESSION['session_date'] . "\r\n", 3, "machine_building.log"); foreach ($device_data as $key => $device) { if (!$device) { continue; } //var_dump($device);echo"

"; if ($meterDataFeed == "PRESENT") { // "U" devices are unknown devices that were created from the FMAudit feed. They are not under contact and should not be displayed. if ($device['is_proposed'] == 'U') { //echo ++$tempcount." "; unset($device_data[$key]); continue; } //if ($device['is_proposed'] <> 'Y' && (!in_array(CurrentUserName(), $admins))) { if ($device['is_proposed'] <> 'Y') { unset($device_data[$key]); continue; } // Only allow admins to view devices that are not proposed. //if ($device['is_proposed'] <> 'Y' && (!in_array(CurrentUserName(), $admins))) { // continue; //} } //echo $device['machine_id']."
"; if ($device['reporting'] == "Y") { $reporting+=1; } else { $notReporting+=1; } if ($device['toner_alert'] == "Y") { $toner_alert+=1; } if ($device['service_needed'] == "Y") { $service_needed+=1; } if ($device['under_contract'] != "Y") { $non_contracted_device+=1; } $budgeted_black_total+=$device['budgeted_black']; $budgeted_color_total+=$device['budgeted_color']; $consumed_black_total+=$device['consumed_black']; $consumed_color_total+=$device['consumed_color']; $consumed_black_estimated_total+=$device['consumed_black_estimated']; $consumed_color_estimated_total+=$device['consumed_color_estimated']; $projected_black_total+=$device['projected_black']; $projected_color_total+=$device['projected_color']; $projected_black_year_total+=$device['projected_black_year']; $projected_color_year_total+=$device['projected_color_year']; if ($firstPass == "Y") { $building_name = $device['building_name']; $org_commencement_date = $device['org_commencement_date']; $org_name = $device['org_name']; $org_message = $device['org_message']; $org_type_id = $device['org_type_id']; if (in_array($org_type_id, array('1', '5', '6'))) { $population_data = getBuildingPopulation($device['building_id']); $building_population[$ary_count] = $population_data[0]['StudentPop']; $building_population_total += $population_data[0]['StudentPop']; } $firstPass = "N"; } if ($building_name <> $device['building_name']) { $building_name = $device['building_name']; $ary_count += 1; if (in_array($org_type_id, array('1', '5', '6'))) { $population_data = getBuildingPopulation($device['building_id']); $building_population[$ary_count] = $population_data[0]['StudentPop']; $building_population_total += $population_data[0]['StudentPop']; } } //if (!isset($device['machine_id'])) { // error_log("device=" . json_encode($device) . "\r\n", 3, "machine_building.log"); //} $building_name_array[$ary_count] = $device['building_name']; $building_ID_array[$ary_count] = $device['building_id']; $total_budgeted_blk_array[$ary_count] += $device['budgeted_black']; $total_budgeted_color_array[$ary_count] += $device['budgeted_color']; $total_actual_blk_array[$ary_count] += $device['consumed_black']; $total_actual_color_array[$ary_count] += $device['consumed_color']; $total_actual_blk_estimated_array[$ary_count] += $device['consumed_black_estimated']; $total_actual_color_estimated_array[$ary_count] += $device['consumed_color_estimated']; $total_projected_black_array[$ary_count] += $device['projected_black']; $total_projected_color_array[$ary_count] += $device['projected_color']; $total_projected_black_year_array[$ary_count] += $device['projected_black_year']; $total_projected_color_year_array[$ary_count] += $device['projected_color_year']; } //error_log("Session date = " . $_SESSION['session_date'] . "\r\n" . json_encode($building_ID_array) . "\r\n\r\n", 3, "building_array.log"); } include "phpincludes/date_calc.inc.php"; ?>
'') { ?>
Commencement Date: $startDate) { echo ' (Partial Year)'; } ?>
Consumed Black (To Date) Budgeted Black (FY23) Projected Black (FY23) Avg. Per Student Next Year’s Black (FY24) Consumed Color (To Date) Budgeted Color (FY23) Projected Color (FY23) Avg. Per Student Next Year’s Color (FY24) Go to live floorplan
'; echo ''; $projected_black = round($total_projected_black_array[$X]); $projected_color = round($total_projected_color_array[$X]); echo ''; if (in_array($org_type_id, array('1', '5', '6'))) { if ($building_population[$X] > 0) { $populationText = ' (pop. '.$building_population[$X].')'; } else { $populationText = ' (pop. N/A)'; } } else { $populationText = ''; } echo ''; echo ''; echo ''; if ($projected_black > $total_budgeted_blk_array[$X]) { $spanClass = ' class="overbudget"'; } else { $spanClass = ''; } echo ''; if (in_array($org_type_id, array('1', '5', '6'))) { if ($building_population[$X] > 0) { echo ''; } else { echo ''; } } echo ''; echo ''; echo ''; if ($projected_color > $total_budgeted_color_array[$X]) { $spanClass = ' class="overbudget"'; } else { $spanClass = ''; } echo ''; if (in_array($org_type_id, array('1', '5', '6'))) { if ($building_population[$X] > 0) { echo ''; } else { echo ''; } } echo ''; echo ''; $X += 1; echo ''; echo '
'.$_building_name.$populationText.''.number_format($total_actual_blk_array[$X]).''.number_format($total_budgeted_blk_array[$X]).''.number_format($projected_black).''.number_format($total_projected_black_array[$X]/$building_population[$X]).'N/A'.number_format($total_projected_black_year_array[$X]).''.number_format($total_actual_color_array[$X]).''.number_format($total_budgeted_color_array[$X]).''.number_format($projected_color).''.number_format($total_projected_color_array[$X]/$building_population[$X]).'N/A'.number_format($total_projected_color_year_array[$X]).'Floorplan
'; echo ''; ?>
'.$device['make'].' - '.$device['model'].' ID:'.$device['5_year_id'].' '.$device['commencement_date'].' '.$color_wording.''; // testing... /* echo ''; // */ echo ''; if ($meterDataFeed != "PRESENT") { echo ''; } else { echo ''; } echo ''; echo ''; if (round($device['projected_black']) > round($device['budgeted_black'])) { $spanClass = ' class="overbudget"'; } else { $spanClass = ''; } echo ''; if (in_array($org_type_id, array('1', '5', '6'))) { echo ''; } echo ''; //if ($device['is_color'] == '1') { if ('1' == '1') { echo ''; echo ''; if (round($device['projected_color']) > round($device['budgeted_color'])) { $spanClass = ' class="overbudget"'; } else { $spanClass = ''; } echo ''; if (in_array($org_type_id, array('1', '5', '6'))) { echo ''; } echo ''; } else { echo ''; echo ''; echo ''; echo ''; echo ''; } echo ''; $Y += 1; echo ''; } } ?>
'.$device['make'].' - '.$device['model'].' '.''.$device['room_number'].''.' '.$color_wording.' '.''.$device['serial_number'].'-'.$device['machine_id'].'-'.$device['meter_timestamp'].'
'.$device['make'].' - '.$device['model'].' '.''.$device['room_number'].''.' SN: '.$device['serial_number'].' '.$color_wording.'  '.'  '.$closeout_wording.''.$device['present_make'].' - '.$device['present_model'].' '.''.$device['present_room_number'].''.' SN: '.$device['present_serial_number'].' '.$color_wording.'  '.$closeout_wording.''; if ($device['reporting'] == 'Y' && $device['no_black_usage'] == 'Y') {echo '';} echo number_format($device['consumed_black']); echo ''.number_format($device['budgeted_black']).''.number_format(round($device['projected_black'])).' '.number_format($device['projected_black_year']).''; if ($device['reporting'] == 'Y' && $device['no_color_usage'] == 'Y') {echo '';} echo number_format($device['consumed_color']); echo ''.number_format($device['budgeted_color']).''.number_format(round($device['projected_color'])).' '.number_format($device['projected_color_year']).'----- 
'.number_format($consumed_black_total).''; echo ''; if ( ($use_cpc == 'Y' && $projected_black_total_cpc > $budgeted_black_total_cpc) || ($use_cpc == 'N' && $projected_black_total > $budgeted_black_total) ) { $spanClass = ' class="overbudget"'; } else { $spanClass = ''; } if ($use_cpc == 'Y') { echo ''; $dividend = $projected_black_total_cpc; } else { echo ''; $dividend = $projected_black_total; } if (in_array($org_type_id, array('1', '5', '6'))) { if ($building_population_total > 0) { echo ''; } else { echo ''; } } echo ''; echo ''; echo ''; if ( ($use_cpc == 'Y' && $projected_color_total_cpc > $budgeted_color_total_cpc) || ($use_cpc == 'N' && $projected_color_total > $budgeted_color_total) ) { $spanClass = ' class="overbudget"'; } else { $spanClass = ''; } if ($use_cpc == 'Y') { echo ''; $dividend = $projected_color_total_cpc; } else { echo ''; $dividend = $projected_color_total; } if (in_array($org_type_id, array('1', '5', '6'))) { if ($building_population_total > 0) { echo ''; } else { echo ''; } } echo ''; ?>
'.number_format($budgeted_black_total).'$'.number_format($projected_black_total_cpc).''.number_format($projected_black_total).''.number_format($dividend/$building_population_total).'*N/A'.number_format($projected_black_year_total).''.number_format($consumed_color_total).''.number_format($budgeted_color_total).'$'.number_format($projected_color_total_cpc).''.number_format($projected_color_total).''.number_format($dividend/$building_population_total).'*N/A'.number_format($projected_color_year_total).'
Click here for the Industry Black and Color Averages for the last five years.
An amount in red indicates year-end projected overage.
Next year's projections includes devices not reporting.
Page_Terminate(); ?>