include('user_inc.htm'); // Map the column names to the constants in the CMI model $columnMap = array("u_partitionName" => 0, "u_location" => 1, "u_firmwareVersion" => 16, "u_status" => 5); $selectedDriveInfo = array(); if ($_SERVER[REQUEST_METHOD] == "POST") { $sortCriteria->sortColumn = $columnMap[$_POST['orderOn']]; $sortCriteria->ascending = $_POST['orderBy'] == "ASC"; $selectedDriveInfo = explode(",", $_POST['selectedDrivesInfo']); } else { $sortCriteria->sortColumn = $columnMap['u_partitionName']; $sortCriteria->ascending = true; } $driveType = explode(":", $_GET['driveType']); $drives = get_all_drives_by_type($user, (int)$driveType[0], (int)$driveType[1], $sortCriteria); error_log("\n\n\ndrives = ". print_r($drives, true) ); $numRows = count($drives); $numPages = ceil($numRows / ITEMS_PER_PAGE); $lowPageList = 1; $highPageList = min($numRows, ITEMS_PER_PAGE); ?>