function ShowAdvancedSearchScreen($filter) { $current_page = 1; $page_size = 10; ?> <div id="ResourceCentreWrapperInner"> <div id="documents-left"> <?php if ($filter != 'VideoLibrary' && $filter != 'ResearchAndInsights' && $filter != 'FormsandLegal') { if ($filter != 'LegalAndRegulatory' && $filter != 'FormsandLegal') { ShowAvailableDocuments(); ShowAdvisorOnly(); } else { ShowSpecialPages(); } } $filter_components = ShowAdvancedSearchFilter($filter); ?> </div> <div id="documents-right"> <div id="FilterResults" style="width:100%"> <?php $post_ids = GetPublicationsResultSet($filter_components); DisplayPublications($post_ids, $current_page, $page_size, $filter_components['OrderBy'], "Any", $filter_components); ?> </div> </div> </div> <?php }
case 'Popularity': $sql = "SELECT `im_my_library`.PostId FROM `im_my_library` LEFT OUTER JOIN `im_doc_popularity` ON `im_my_library`.`PostId` = `im_doc_popularity`.`PostId` where `UserId`={$UserId} ORDER BY Downloads DESC"; break; } $st = $db->query($sql); foreach ($st as $rec) { $PostIds[] = $rec['PostId']; } //LoadLightBoxHeader(); echo "<br>"; $FilterComponents = array(); ?> <div id="ResourceCentreWrapperInner"> <div id="documents-container"> <?php DisplayPublications($PostIds, $Specs['CurrentPage'], $Specs['PageSize'], $Specs['OrderBy'], "MyLibrary", $FilterComponents); ?> </div> </div> <?php $db = null; break; case 'IncreaseDocumentPopularity': $db = new PDO('mysql:host=' . $_SESSION['DB_HOST'] . ';dbname=' . $_SESSION['DB_NAME'], $_SESSION['DB_USER'], $_SESSION['DB_PASSWORD']); $PostId = $_REQUEST['PostId']; $Sql = "SELECT * FROM `im_doc_popularity` where PostId = {$PostId}"; $st = $db->query($Sql); $NumberOfDownloads = 0; foreach ($st as $Rec) { $NumberOfDownloads = intval($Rec['Downloads']); }