connectMySQL(); $refer = getenv("HTTP_REFERER"); if($db->isValidRetailer($_SESSION[rString])){ $header = "retailers/header1.tem.php"; $pdetail = "retailers/productCMS.detail.tem.php"; $psearch = "retailers/product.searchCMS.tem.php"; $footer = "footerCMS1.tem.php"; $retailer = 1; } else { $header = "headerCMS2.tem.php"; $pdetail = "productCMS.detail.tem.php"; $psearch = "product.searchCMS.tem.php"; $footer = "footerCMS1.tem.php"; } if($_POST[mode]=="search"){ $db->cacheHeader(); if(count($_POST[searchby])<1){ $msg = "Please check at least one search parameter"; include("$db->newTemplatePath/$header"); include("$db->newTemplatePath/product.resultsCMS.tem.php"); include("$db->newTemplatePath/$footer"); } elseif(($db->findInArray($_POST[searchby], "title") || $db->findInArray($_POST[searchby], "song") || $db->findInArray($_POST[searchby], "upc")) && strlen($_POST[keywords])<1){ $msg = "Please enter at least 1 keyword"; include("$db->newTemplatePath/$header"); include("$db->newTemplatePath/product.resultsCMS.tem.php"); include("$db->newTemplatePath/$footer"); } else { $results = $prod->searchProducts($_POST); if($results[0][id] || $results[1][id]){ include("$db->newTemplatePath/$header"); include("$db->newTemplatePath/product.resultsCMS.tem.php"); include("$db->newTemplatePath/$footer"); } else { $msg = "No results found! Please alter your search parameters"; include("$db->newTemplatePath/$header"); include("$db->newTemplatePath/product.resultsCMS.tem.php"); include("$db->newTemplatePath/$footer"); } } } elseif($_GET[mode]=="detail" && $prod->isValidProduct($_GET[pID])){ $db->cacheHeader(); $detail = $db->getProductDetail($_GET[pID]); if($detail[pManualURL]){ $url = $detail[pManualURL]; $db->jump2($url); } else { $ps_Array = $db->getProductSongDataArray($_GET[pID]); if($db->getProductArtistCount($_GET[pID])==1){ $aID_Array = $db->getProductArtistDataArray($_GET[pID]); $aID = $aID_Array[0]; $artist = $db->getArtistDetail($aID); $ot_Array = $prod->getProductArtistOtherProductsDataArray($aID, $_GET[pID]); } else { $aID = $db->getProductArtistDataArray($_GET[pID]); $artist[aName] = $db->getProductArtistString($_GET[pID]); $ot_Array = $prod->getProductArtistOtherProductsDataArray($aID, $_GET[pID]); $multipleArtist = 1; } $pm_Array = $db->getProductMerchandiseDataArray2($_GET[pID]); $rp_Array = $prod->getRelatedOtherProductsDataArray($detail[pUpc], $_GET[order]); include("$db->newTemplatePath/$header"); include("$db->newTemplatePath/$pdetail"); include("$db->newTemplatePath/$footer"); } } else { $db->cacheHeader(); include("$db->newTemplatePath/$header"); include("$db->newTemplatePath/$psearch"); include("$db->newTemplatePath/$footer"); } $db->disconnectMySQL(); ?>