prepare("select * from site_text where (city='Yes' or college='Yes') and status='Active'"); $cities_module_query->execute(); $cities=$cities_module_query->fetchAll(); foreach ($cities as $city) { if ($_SERVER['SCRIPT_NAME']==$city->url) { if ($_SERVER['SCRIPT_NAME']=='/apo-cake-delivery.php' || $_SERVER['SCRIPT_NAME']=='/fpo-cake-delivery.php') { $_GET['category']=42; $urlextra.="military=yes&"; } else { $_GET['category']=35; } // $city_random=true; // $review_random=true; } } } if ($military) { $categories_module_query= $pdo->prepare("select * from category where id=?"); $categories_module_query->execute([$_GET['category']]); $category=$categories_module_query->fetch(); $sql = " SELECT product.* FROM product WHERE product.status = 'Active' and military='Yes' ORDER BY product.priority "; $products_module_query= $pdo->prepare($sql); $products_module_query->execute(); $products=$products_module_query->fetchAll(); } elseif($_GET['category'] != NULL && $_GET['category'] != ""){ $categories_module_query= $pdo->prepare("select * from category where id=?"); $categories_module_query->execute([$_GET['category']]); $category=$categories_module_query->fetch(); $sql = " SELECT product.* FROM category, product WHERE product.status = 'Active' and product.category_id!=53 AND category.status = 'Active' AND product.category_id = category.id AND category.id = ? ORDER BY ".($city_random==true ? "RAND()" : "product.priority_override, product.sales DESC"); $products_module_query= $pdo->prepare($sql); $products_module_query->execute([$_GET['category']]); $products=$products_module_query->fetchAll(); } elseif ($_GET['category2'] != NULL && $_GET['category2'] != ""){ $categories_module_query= $pdo->prepare("select * from category2 where id=?"); $categories_module_query->execute([$_GET['category2']]); $category=$categories_module_query->fetch(); $sql = " SELECT product.* FROM product_category2,product WHERE product.status = 'Active' and product.category_id!=53 AND product_category2.product_id = product.id AND product_category2.category2_id = ? ORDER BY product_category2.priority, product.priority_override, product.sales DESC "; $products_module_query= $pdo->prepare($sql); $products_module_query->execute([$_GET['category2']]); $products=$products_module_query->fetchAll(); } elseif ($_GET['category3'] != NULL && $_GET['category3'] != ""){ $categories_module_query= $pdo->prepare("select * from category3 where id=?"); $categories_module_query->execute([$_GET['category3']]); $category=$categories_module_query->fetch(); if ($category->image_id>0) { $category->id=$category->image_id; } $sql = " SELECT product.* FROM product_category3,product WHERE product.status = 'Active' and product.category_id!=53 AND product_category3.product_id = product.id AND product_category3.category3_id = ? and product.process_queue !='CANADA' and product.process_queue !='Postalmail' ORDER BY product_category3.priority, product.priority_override, product.sales DESC "; $products_module_query= $pdo->prepare($sql); $products_module_query->execute([$_GET['category3']]); $products=$products_module_query->fetchAll(); } elseif ($_GET['category4'] == "special"){ $categories_module_query= $pdo->prepare("select * from category3 where id=?"); $categories_module_query->execute([$_GET['category3']]); $category=$categories_module_query->fetch(); $sql = " SELECT product.* FROM product WHERE product.id in (282, 739, 784, 793 ,785) ORDER BY product.priority_override, product.sales DESC "; $products_module_query= $pdo->prepare($sql); $products_module_query->execute(); $products=$products_module_query->fetchAll(); } else { $sql = " SELECT product.* FROM product WHERE product.status = 'Active' AND product.category_id != 13 AND product.category_id != 43 AND product.category_id != 41 AND product.category_id != 53 ORDER BY product.priority_override, product.sales DESC "; $products_module_query= $pdo->prepare($sql); $products_module_query->execute(); $products=$products_module_query->fetchAll(); $category->id=0; } if ($category->meta_keywords) { $site_text->keywords=$category->meta_keywords; $site_text->meta_block=preg_replace('/\]*\>/',"",$site_text_meta_block); } if ($category->meta_description && !$site_text->description) { $site_text->description=$category->meta_description; $site_text->meta_block=preg_replace('/\]*\>/',"",$site_text_meta_block); } if (!$site_text->title) { $site_text->title=$category->title; } if (!$site_text->description) { $site_text->description=$category->description; } if (!$site_text->body2) { $site_text->body2=$category->description; } if (!$site_text->header) { $site_text->header=$category->name; } if (!$site_text->header) { $site_text->header=$category->header; } if (!$site_text->subhead) { $site_text->subhead=$category->subhead; } if (!$site_text->body) { $site_text->body=$category->body; } ?> <? if ($site_text->title) { print $site_text->title;} else { print $head_title;} ?> meta_block) { print "$site_text->meta_block\n"; } ?>
corp_id) { $corp_url.="&corp_id=".$category->corp_id; } if ($category->corp_id && $category->include_discount=='Yes') { $corporate_module_query= $pdo->prepare("select discount from corporate where id=? limit 1"); $corporate_module_query->execute([$category->corp_id]); $corporate=$corporate_module_query->fetch(); $include_corp_discount=$corporate->discount; $corp_url.="&inc_disc=yes"; } if ($category->corp_id && $category->include_shipping=='Yes') { $include_shipping='Yes'; $corp_url.="&inc_ship=yes"; } $promo_banner_module_query= $pdo->prepare("select * from promo_display where status='Active' and now()>=start_date and now()<=end_date limit 1"); $promo_banner_module_query->execute(); $promo_banner=$promo_banner_module_query->fetch(); if ($promo_banner_module_query->rowCount()>0 && $promo_banner->category=='Yes') { if ($promo_banner->url_address) { ?>