|
|||||||||||
|
|||||||||||
|
Rockcote Brochures & Manuals (Download in PDF Format - Adobe Acrobat Reader Required) |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
| Gold Coast Design Centre |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|
|
|||||
|
"") { $sDbWhere .= "(" . $sDbWhereDetail . ") AND "; } if ($sSrchWhere <> "") { $sDbWhere .= "(" . $sSrchWhere . ") AND "; } if (strlen($sDbWhere) > 5) { $sDbWhere = substr($sDbWhere, 0, strlen($sDbWhere)-5); // Trim rightmost AND } $sWhere = ""; if ($sDefaultFilter <> "") { $sWhere .= "(" . $sDefaultFilter . ") AND "; } if ($sDbWhere <> "") { $sWhere .= "(" . $sDbWhere . ") AND "; } if (substr($sWhere, -5) == " AND ") { $sWhere = substr($sWhere, 0, strlen($sWhere)-5); } if ($sWhere != "") { $sSql .= " WHERE " . $sWhere; } if ($sGroupBy != "") { $sSql .= " GROUP BY " . $sGroupBy; } if ($sHaving != "") { $sSql .= " HAVING " . $sHaving; } // Set Up Sorting Order $sOrderBy = ""; SetUpSortOrder(); if ($sOrderBy != "") { $sSql .= " ORDER BY " . $sOrderBy; } //echo $sSql; // Uncomment to show SQL for debugging ?> SQL: ' . $sSql); $nTotalRecs = phpmkr_num_rows($rs); if ($nDisplayRecs <= 0) { // Display All Records $nDisplayRecs = $nTotalRecs; } $nStartRec = 1; SetUpStartRec(); // Set Up Start Record Position ?> "") { ?> 0) { ?> 0) { $sOrder = @$HTTP_GET_VARS["order"]; // Field date if ($sOrder == "date") { $sSortField = "`date`"; $sLastSort = @$HTTP_SESSION_VARS["news_x_date_Sort"]; if ($sLastSort == "ASC") { $sThisSort = "DESC"; } else{ $sThisSort = "ASC"; } $HTTP_SESSION_VARS["news_x_date_Sort"] = $sThisSort; } else { if (@$HTTP_SESSION_VARS["news_x_date_Sort"] <> "") { @$HTTP_SESSION_VARS["news_x_date_Sort"] = ""; } } // Field headline if ($sOrder == "headline") { $sSortField = "`headline`"; $sLastSort = @$HTTP_SESSION_VARS["news_x_headline_Sort"]; if ($sLastSort == "ASC") { $sThisSort = "DESC"; } else{ $sThisSort = "ASC"; } $HTTP_SESSION_VARS["news_x_headline_Sort"] = $sThisSort; } else { if (@$HTTP_SESSION_VARS["news_x_headline_Sort"] <> "") { @$HTTP_SESSION_VARS["news_x_headline_Sort"] = ""; } } $HTTP_SESSION_VARS["news_OrderBy"] = $sSortField . " " . $sThisSort; $HTTP_SESSION_VARS["news_REC"] = 1; } $sOrderBy = @$HTTP_SESSION_VARS["news_OrderBy"]; if ($sOrderBy == "") { $sOrderBy = $sDefaultOrderBy; $HTTP_SESSION_VARS["news_OrderBy"] = $sOrderBy; $HTTP_SESSION_VARS["news_x_date_Sort"] = "ASC"; } } //------------------------------------------------------------------------------- // Function SetUpStartRec //- Set up Starting Record parameters based on Pager Navigation // - Variables setup: nStartRec function SetUpStartRec() { // Check for a START parameter global $HTTP_SESSION_VARS; global $HTTP_GET_VARS; global $nStartRec; global $nDisplayRecs; global $nTotalRecs; if (strlen(@$HTTP_GET_VARS["start"]) > 0) { $nStartRec = @$HTTP_GET_VARS["start"]; $HTTP_SESSION_VARS["news_REC"] = $nStartRec; }elseif (strlen(@$HTTP_GET_VARS["pageno"]) > 0) { $nPageNo = @$HTTP_GET_VARS["pageno"]; if (is_numeric($nPageNo)) { $nStartRec = ($nPageNo-1)*$nDisplayRecs+1; if ($nStartRec <= 0) { $nStartRec = 1; }elseif ($nStartRec >= (($nTotalRecs-1)/$nDisplayRecs)*$nDisplayRecs+1) { $nStartRec = (($nTotalRecs-1)/$nDisplayRecs)*$nDisplayRecs+1; } $HTTP_SESSION_VARS["news_REC"] = $nStartRec; }else{ $nStartRec = @$HTTP_SESSION_VARS["news_REC"]; if (!(is_numeric($nStartRec)) || ($nStartRec == "")) { $nStartRec = 1; // Reset start record counter $HTTP_SESSION_VARS["news_REC"] = $nStartRec; } } }else{ $nStartRec = @$HTTP_SESSION_VARS["news_REC"]; if (!(is_numeric($nStartRec)) || ($nStartRec == "")) { $nStartRec = 1; //Reset start record counter $HTTP_SESSION_VARS["news_REC"] = $nStartRec; } } } //------------------------------------------------------------------------------- // Function ResetCmd // - Clear list page parameters // - RESET: reset search parameters // - RESETALL: reset search & master/detail parameters // - RESETSORT: reset sort parameters function ResetCmd() { global $HTTP_SESSION_VARS; global $HTTP_GET_VARS; // Get Reset Cmd if (strlen(@$HTTP_GET_VARS["cmd"]) > 0) { $sCmd = @$HTTP_GET_VARS["cmd"]; // Reset Search Criteria if (strtoupper($sCmd) == "RESET") { $sSrchWhere = ""; $HTTP_SESSION_VARS["news_searchwhere"] = $sSrchWhere; // Reset Search Criteria & Session Keys }elseif (strtoupper($sCmd) == "RESETALL") { $sSrchWhere = ""; $HTTP_SESSION_VARS["news_searchwhere"] = $sSrchWhere; // Reset Sort Criteria } elseif (strtoupper($sCmd) == "RESETSORT") { $sOrderBy = ""; $HTTP_SESSION_VARS["news_OrderBy"] = $sOrderBy; if (@$HTTP_SESSION_VARS["news_x_date_Sort"] <> "") { $HTTP_SESSION_VARS["news_x_date_Sort"] = ""; } if (@$HTTP_SESSION_VARS["news_x_headline_Sort"] <> "") { $HTTP_SESSION_VARS["news_x_headline_Sort"] = ""; } } // Reset Start Position (Reset Command) $nStartRec = 1; $HTTP_SESSION_VARS["news_REC"] = $nStartRec; } } ?> |
home | about us | style gallery | our products | faq’s | technical info | colours & symbols | contact us |