$isReportPopup = 1; // Set so we do not release the Service menu RAS Token when bringing up a report. include('user_inc.htm'); // Map the column names to the constants in the CMI model $columnMap = array( "slotType" => 6, "barcode" => 4, "partitionName" => 2, "location" => 3, "logicalAddress" => 8); if ($_SERVER[REQUEST_METHOD] == "POST") { $sortCriteria->sortColumn = $columnMap[$_POST['orderOn']]; $sortCriteria->ascending = $_POST['orderBy'] == "ASC"; $sortCriteria->filterPattern = $_POST['filterPattern']; } else { // Default sorting is on the first column in the table $sortCriteria->sortColumn = $columnMap['slotType']; $sortCriteria->ascending = true; } $slots = get_slot_statistics($user, $sortCriteria); error_log( "Size of slots is ". sizeof($slots) ); //error_log( print_r( $slots, true ) ); // This is too large to print everything in it. It gets trunkated. if( $_POST['filterPattern'] != null && strlen($_POST['filterPattern']) > 0 ) { $slots = filter($slots, 'barcode', $_POST['filterPattern'] ); } $orderOn = $_POST['orderOn']; if( $orderOn == null || strlen($orderOn) == 0 ) $orderOn = 'slotType'; $orderBy = $_POST['orderBy']; if( $orderBy == null || strlen($orderBy) == 0 ) $orderBy = 'ASC'; if( $orderOn == 'partitionName' ) $orderOn = 'name'; $numRows = count($slots); $numPages = ceil($numRows / ITEMS_PER_PAGE); $lowPageList = 1; $highPageList = min($numRows, ITEMS_PER_PAGE); ?>