assign("Title", "USMedClub - Your Non-Prescription Drugs Source"); $smarty->display('top.html'); $str = " SELECT SQL_CACHE t1.id, t1.synonym, t1.name_en as brand_name, t1.en as brand_descr, t1.img, t1.altname, t1.fr, t1.es, t1.it, t1.pt, t1.de, t1.promo_key, t1.promo_desc, t1.promo_title, t3.name_en as producer, t2.id AS categ_id, t2.name_en as categ_name, t2.promo_key as categ_promo_key, t2.promo_desc as categ_promo_desc, t2.promo_title as categ_promo_title, (ROUND((t1.price*(1-".PERCENT."*((SELECT MAX(quant)/MIN(quant) FROM drug t4 WHERE t4.brand = t1.id AND t4.sv_type = 1)-1)/100)),2)) as from_price FROM brand t1 INNER JOIN categ t2 ON t1.categ = t2.id INNER JOIN producers t3 ON t1.producer = t3.id WHERE t1.sv_type in (1) ".(strstr($_SERVER['SERVER_NAME'], 'medsmarket')?"and control!=1":"")." ".(strstr($_SERVER['SERVER_NAME'], 'buy-tabs')?"and control!=1":"")." ORDER BY rand() LIMIT 12; "; $q = mysql_query ($str); if ($q) { while ($r = mysql_fetch_array($q)) { $r[url] = "order/buy-".to_uri($r[categ_name]).'/'.to_uri($r[brand_name].'_'.$r[producer]).".html"; $product[] = $r; } $h1 = "Today's Bestsellers"; $smarty->assign("h1", $h1); $smarty->assign("product", $product); $smarty->display('product_table.html'); } $smarty->assign("brands", view_brands()); $smarty->display('rx.html'); include_once("bot.php"); ?>