if ($_GET['documentTypeID']) {
     $whereAdd[] = "D.documentTypeID = '" . $_GET['documentTypeID'] . "'";
 }
 if ($_GET['expressionTypeID']) {
     $whereAdd[] = "E.expressionTypeID = '" . $_GET['expressionTypeID'] . "'";
 }
 if ($_GET['qualifierID']) {
     $whereAdd[] = "E.expressionID IN (SELECT expressionID FROM ExpressionQualifierProfile WHERE  qualifierID = '" . $_GET['qualifierID'] . "')";
 }
 if ($_GET['startWith']) {
     $whereAdd[] = "TRIM(LEADING 'THE ' FROM UPPER(L.shortName)) LIKE UPPER('" . $_GET['startWith'] . "%')";
 }
 $orderBy = $_GET['orderBy'];
 //get total number of records to print out and calculate page selectors
 $totalLicenseObj = new License();
 $totalRecords = $totalLicenseObj->searchCount($whereAdd);
 //reset pagestart to 1 - happens when a new search is run but it kept the old page start
 if ($totalRecords <= $pageStart) {
     $pageStart = 1;
 }
 $limit = $pageStart - 1 . ", " . $numberOfRecords;
 $licenseObj = new License();
 $licenseArray = array();
 $licenseArray = $licenseObj->search($whereAdd, $orderBy, $limit);
 $pagination = '';
 if ($totalRecords == 0) {
     echo "<br /><br /><i>Sorry, no licenses fit your query</i>";
     $i = 0;
 } else {
     //maximum number of pages to display on screen at one time
     $maxDisplay = 25;