0, "s_location" =>1, "s_status" =>17, "s_mediaType" =>19, "s_wwnn" =>3 ); $s_columnMap = array( "s_partitionName" =>0, "s_location" =>1, "s_mediaType" =>19); $a_columnMap = array( "a_partitionName" =>0, "a_location" =>1, "a_mediaType" =>19); $f_columnMap = array( "f_partitionName" =>0, "f_location" =>1, "f_mediaType" =>19); $u_columnMap = array( "u_partitionName" =>0, "u_location" =>1, "u_mediaType" =>19); $columnMap = array("partitionName"=>"name", "location"=>"location", "status"=>"status", "vendor"=>"vendor", "mediaType"=>"driveType", "wwnn"=>"wwnn"); if ($_SERVER[REQUEST_METHOD] == "GET") { $type = $_GET['type']; if( $type == 'SCSI') $sortCriteria = new SortCriteria($s_columnMap["s_partitionName"], "1"); else if( $type == 'SAS') $sortCriteria = new SortCriteria($a_columnMap["a_partitionName"], "1"); else if( $type == 'Fibre') $sortCriteria = new SortCriteria($f_columnMap["f_partitionName"], "1"); else $sortCriteria = new SortCriteria($u_columnMap["u_partitionName"], "1"); } else { error_log("_POST = ". print_r($_POST, true) ); // The user must have pressed a column header to change sorting $type = $_POST['type']; if( $type == 'SCSI') $sortCriteria = new SortCriteria($s_columnMap[$_POST['orderOn']], ($_POST['orderBy']=="ASC")?(1):(0)); else if( $type == 'SAS') $sortCriteria = new SortCriteria($a_columnMap[$_POST['orderOn']], ($_POST['orderBy']=="ASC")?(1):(0)); else if( $type == 'Fibre') $sortCriteria = new SortCriteria($f_columnMap[$_POST['orderOn']], ($_POST['orderBy']=="ASC")?(1):(0)); else $sortCriteria = new SortCriteria($u_columnMap[$_POST['orderOn']], ($_POST['orderBy']=="ASC")?(1):(0)); error_log("\n\n\n\n $sortCriteria->sortColumn = " . $sortCriteria->sortColumn ); } // Get the licensing information to know what the user has rights to do. // !?! Waiting on CMI function to give back the # of unused DPS licenses. // This licnense includes DPF, CPF and Lun Mapping. $currentType = $type; $drives = $_SESSION['drives']; $drives = columnSort($drives, $columnMap[substr($_POST['orderOn'], 2)], $_POST['orderBy']); // count the drives with this type // $numRows = 0; foreach($drives as $drive) { if( $drive->interfaceType == "$currentType" || (( !($drive->interfaceType) || ($drive->interfaceType == 'Unknown')) && ($currentType == 'unknown') )) { $numRows++; // If th4 Drive has 2 ports - count the second port //if( $drive->portCount == 2 ) // $numRows++; } } // insure that the document is empty if there are no drives of this type if( $numRows <= 0 ) { return; } $numPages = ceil($numRows / DRIVES_PER_PAGE); $lowPageList = 1; $highPageList = min($numRows, DRIVES_PER_PAGE); ?>
if( $numRows == 0 ) { // Change the text at the top of the screen to match which lists are being showed. if( $currentType == 'Fibre' ) { echo ""; } else if( $currentType == 'SCSI' ) { echo ""; } else { echo ""; } } else { echo "\n"; echo "\n"; } ?>