require('../resources/init.php'); require('../resources/config.php'); $config=get_config(); if (!$_GET['subscribed']) { //include('cache-top-br.php'); } $v_img=""; $today=date('Y-m-d',time()); $city_random=false; $review_random=false; $site_text=find_meta($_SERVER['PHP_SELF']); $cdata=carthead_get(); $cart_items=item_num($cdata); $_GET['occasion']=preg_replace('/[^0-9]/','',$_GET['occasion']); $_GET['category']=preg_replace('/[^0-9]/','',$_GET['category']); $_GET['category2']=preg_replace('/[^0-9]/','',$_GET['category2']); $_GET['category3']=preg_replace('/[^0-9]/','',$_GET['category3']); if ($_SERVER['SCRIPT_NAME']=='/freedom-cakes.php') { $_GET['category']=12; } elseif ($_SERVER['SCRIPT_NAME']=='/all-natural-cakes.php') { $_GET['category2']=5; } elseif ($_SERVER['SCRIPT_NAME']=='/chocolate-lovers-cakes.php') { $_GET['category2']=3; } elseif ($_SERVER['SCRIPT_NAME']=='/best-seller-cakes.php') { $_GET['category2']=2; } elseif ($_SERVER['SCRIPT_NAME']=='/best-sellers.php') { $_GET['category2']=2; } elseif ($_SERVER['SCRIPT_NAME']=='/best-selling-cakes.php') { $_GET['category2']=2; } elseif ($_SERVER['SCRIPT_NAME']=='/beyond-chocolate-cakes.php') { $_GET['category2']=6; } elseif ($_SERVER['SCRIPT_NAME']=='/giving-back-cakes.php') { $_GET['category2']=7; } elseif ($_SERVER['SCRIPT_NAME']=='/cookie-delivery.php') { $_GET['category3']=7; } elseif ($_SERVER['SCRIPT_NAME']=='/bakery-combo-gifts.php') { $_GET['category3']=4; } elseif ($_SERVER['SCRIPT_NAME']=='/cheesecake-delivery.php') { $_GET['category']=44; } elseif ($_SERVER['SCRIPT_NAME']=='/brownie-delivery.php') { $_GET['category3']=1; } elseif ($_SERVER['SCRIPT_NAME']=='/gourmet-cupcake-delivery.php') { $_GET['category']=36; } elseif ($_SERVER['SCRIPT_NAME']=='/gourmet-cake.php') { $_GET['category']=35; } elseif ($_SERVER['SCRIPT_NAME']=='/send-cookies-and-brownies.php') { $_GET['category']=75; } elseif ($_SERVER['SCRIPT_NAME']=='/gourmet-chocolate-delivery.php') { $_GET['category']=76; } elseif ($_SERVER['SCRIPT_NAME']=='/mini-cake-delivery.php') { $_GET['category']=43; } elseif ($_SERVER['SCRIPT_NAME']=='/order-cakes.php') { $_GET['category3']=6; } elseif ($_SERVER['SCRIPT_NAME']=='/send-cookies.php') { $_GET['category3']=12; } elseif ($_SERVER['SCRIPT_NAME']=='/send-pies.php') { $_GET['category3']=13; } elseif ($_SERVER['SCRIPT_NAME']=='/cupcake-delivery-near-me.php') { $_GET['category3']=14; } elseif($_SERVER['SCRIPT_NAME']=='/independence-day-gift-delivery.php') { $_GET['category3']=15; } elseif($_SERVER['SCRIPT_NAME']=='/kosher-cake-delivery.php') { $_GET['category3']=17; } elseif($_SERVER['SCRIPT_NAME']=='/birthday-gifts-delivered-for-him.php') { $_GET['category3']=18; } elseif($_SERVER['SCRIPT_NAME']=='/birthday-gifts-delivered-for-her.php') { $_GET['category3']=19; } elseif ($_SERVER['SCRIPT_NAME']=='/birthday-cake-near-me.php') { $_GET['category3']=11; } elseif ($_SERVER['SCRIPT_NAME']=='/order-birthday-cakes-online.php') { $_GET['category3']=10; } elseif ($_SERVER['SCRIPT_NAME']=='/love-and-quiches-mail-order.php') { $_GET['category3']=3; } elseif ($_SERVER['SCRIPT_NAME']=='/bakery-gifts.php') { $_GET['category3']=2; } elseif ($_SERVER['SCRIPT_NAME']=='/all-natural-food-gifts.php') { $_GET['category3']=21; } elseif ($_SERVER['SCRIPT_NAME']=='/last-minute-gift-delivery.php') { $_GET['category3']=22; } elseif ($_SERVER['SCRIPT_NAME']=='/back-to-school-gift-delivery.php') { $_GET['category3']=23; } elseif ($_SERVER['SCRIPT_NAME']=='/cartoon-cake-delivery.php') { $_GET['category3']=24; } elseif ($_SERVER['SCRIPT_NAME']=='/superhero-cake-delivery.php') { $_GET['category3']=25; } elseif ($_SERVER['SCRIPT_NAME']=='/kids-cake-delivery.php') { $_GET['category3']=26; } elseif ($_SERVER['SCRIPT_NAME']=='/overnight-cake-delivery.php') { $_GET['category3']=27; } elseif ($_SERVER['SCRIPT_NAME']=='/sports-gift-delivery.php') { $_GET['category3']=28; } elseif ($_SERVER['SCRIPT_NAME']=='/graduation-cake-delivery.php') { $_GET['category3']=29; } elseif ($_SERVER['SCRIPT_NAME']=='/online-bakery-delivery.php') { $_GET['category3']=31; } elseif ($_SERVER['SCRIPT_NAME']=='/wealth-enhancement-gifts.php') { $_GET['category3']=32; } elseif ($_SERVER['SCRIPT_NAME']=='/zscaler-gifts.php') { $_GET['category3']=33; } elseif ($_SERVER['SCRIPT_NAME']=='/new-gifts-for-delivery.php') { $_GET['category2']=25; } elseif ($_SERVER['SCRIPT_NAME']=='/gluten-free-gift-delivery.php') { $_GET['category2']=26; } elseif ($_SERVER['SCRIPT_NAME']=='/zodiac-cake-delivery.php') { $_GET['category2']=30; } elseif ($_SERVER['SCRIPT_NAME']=='/theme-cake-delivery.php') { $_GET['category2']=28; } elseif ($_SERVER['SCRIPT_NAME']=='/birthday-cupcakes.php') { $_GET['category3']=20; } elseif ($_SERVER['SCRIPT_NAME']=='/gourmet-pie-delivery.php') { $_GET['category3']=16; } elseif ($_SERVER['SCRIPT_NAME']=='/personalized-cake-delivery.php') { $_GET['category']=45; } elseif ($_SERVER['SCRIPT_NAME']=='/milestone-birthday-cake-delivery.php') { $_GET['category']=66; } elseif ($_SERVER['SCRIPT_NAME']=='/overnight-delivery-cakes.php') { $_GET['category']=35; } elseif ($_SERVER['SCRIPT_NAME']=='/pies-and-quiches.php') { $_GET['category']=40; } elseif ($_SERVER['SCRIPT_NAME']=='/gourmet-pie-delivery.php') { $_GET['category']=40; } elseif ($_SERVER['SCRIPT_NAME']=='/sheet-cake-delivery.php') { $_GET['category2']=21; } elseif ($_SERVER['SCRIPT_NAME']=='/dessert-delivery.php') { $_GET['category2']=18; } elseif ($_SERVER['SCRIPT_NAME']=='/operation-birthday-cakes.php') { $military=1; $urlextra.="military=yes&"; $_GET['category']=42; } elseif ($_SERVER['SCRIPT_NAME']=='/summer-dessert-delivery.php') { $_GET['category2']=18; } elseif ($_SERVER['SCRIPT_NAME']=='/autumn-dessert-delivery.php') { $_GET['category2']=19; } elseif ($_SERVER['SCRIPT_NAME']=='/winter-dessert-delivery.php') { $_GET['category2']=20; } elseif ($_SERVER['SCRIPT_NAME']=='/bakery-gift-towers.php') { $_GET['category']=54; } elseif ($_SERVER['SCRIPT_NAME']=='/gift-basket-delivery.php') { $_GET['category']=59; } elseif ($_SERVER['SCRIPT_NAME']=='/access-health-care.php') { $_GET['category4']='special'; } if (!$_GET['category'] && !$_GET['category2'] && !$_GET['category3']) { $cities_module_query= $pdo->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; } ?>