<?php global $user, $GlobalConfig; if ($_REQUEST['warecode']) { if (!$_REQUEST['email'] || !$_REQUEST['phone']) { $note .= "Укажите e-mail или номер телефона<br>"; } if (!$_REQUEST['name']) { $note .= "Укажите Ф.И.О.<br>"; } if (!(int) $_REQUEST['yourprice']) { $note .= "Предложите Вашу цену<br>"; } if (!$_REQUEST['url']) { $note .= "Укажите ссылку на сайт с примером более низкой цены<br>"; } if (empty($_REQUEST['code']) || $_REQUEST['code'] != $_SESSION["security_code"]) { $note .= "Введенный вами код не совпадает с кодом указанным на картинке<br>"; } if (!$note) { $db = new DB_Mvideo(); $sql = "INSERT INTO yourprice\n (region_id, warecode, email, phone, name, yourprice, url, bonus_card, start_time) \n VALUES\n (" . (int) $GlobalConfig['RegionID'] . ", \n " . (int) $_REQUEST['warecode'] . ",\n '" . addslashes($_REQUEST['email']) . "', \n '" . addslashes($_REQUEST['phone']) . "', \n '" . addslashes($_REQUEST['name']) . "', \n " . (int) $_REQUEST["yourprice"] . ",\n '" . addslashes($_REQUEST['url']) . "',\n '" . addslashes($_REQUEST['bonus_card']) . "',\n NOW()\n )"; //echo $sql; $db->query($sql); $note = "Ваша заявка принята"; } header('Content-Type: text/html; charset=windows-1251'); echo $note; }
<?php $good = $_REQUEST['good']; $rid = $_REQUEST['rid']; if ($rid) { $db = new DB_Mvideo(); $db->query("update reviews_new set " . ($good == 1 ? "rew_good=rew_good+1, " : null) . "rew_total=rew_total+1 where rew_id=" . (int) $rid); // ставим куку setcookie("mvrew_" . $rid, 1, time() + 60 * 60 * 24 * 30, "/"); //30 дней } $html = "Спасибо. Ваш голос учтен."; $GLOBALS['_RESULT'] = array('html' => $html); echo $html;
if (isset($_GET['category'])) { $category = (int) $_GET['category']; } if (isset($_GET['ids'])) { $ids = (int) $_GET['ids']; } // пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ switch ($category) { case 1: $tpl->assign("type", "novelty"); $ids = array(); /** * Новинки */ $query = "\r\n\t SELECT warecode\r\n\t FROM segment_cache\r\n\t WHERE segment_name='novelty'\r\n\t AND region_id=" . $GlobalConfig['RegionID'] . "\r\n\t ORDER BY promo_hour DESC,important DESC\r\n "; $db->query($query); if (mysql_num_rows($db->Query_ID) > 0) { while ($row = mysql_fetch_assoc($db->Query_ID)) { $ids[] = $row['warecode']; } } $params = array("ids" => $ids, "homeshop" => $GlobalConfig["RegionID"] == 1 ? 1 : 0); break; case 2: $tpl->assign("type", "offers"); //$params = array("BestPrice" => 2, "homeshop" => ($GlobalConfig["RegionID"]==1?1:0)); $params = array("Hit" => 1, "homeshop" => $GlobalConfig["RegionID"] == 1 ? 1 : 0); break; case 3: $tpl->assign("type", "discounts"); if ($GlobalConfig["RegionID"] == 1) {
<?php global $GlobalConfig, $tpl; $db = new DB_Mvideo(); $page = (int) $_REQUEST['page']; $type = (int) $_REQUEST['type']; $segment_name = $_REQUEST['segment_name']; $count = 0; if ($type == 1) { $limit = 6; $offset = ($page - 1) * $limit; $sql = "\n\t\t\t SELECT count(w.warecode) as cnt\n\t\t\t FROM segment_cache\n\t\t\t JOIN warez_" . $GlobalConfig['RegionID'] . " AS w ON w.warecode = segment_cache.warecode\n\t\t\t WHERE segment_cache.segment_name = '" . $segment_name . "'\n\t\t\t AND segment_cache.region_id=" . $GlobalConfig['RegionID'] . "\n\t\t\t"; $res = $db->query($sql); if ($row = @mysql_fetch_assoc($db->Query_ID)) { $count = $row['cnt']; } $sql = "\n SELECT DISTINCT\n\t w.warecode,\n\t\t w.FullName,\n\t\t m.MarkName,\n\t\t w.InetQty,\n\t\t Discounted,\n\t InetDiscounted,\n\t OldPrice,\n\t important\n\t\t FROM segment_cache\n\t\t JOIN warez_" . $GlobalConfig['RegionID'] . " AS w ON w.warecode = segment_cache.warecode\n\t\t JOIN marks AS m ON m.MarkID = w.mark\n\t\t WHERE segment_cache.segment_name = '" . $segment_name . "'\n\t\t AND segment_cache.region_id=" . $GlobalConfig['RegionID'] . "\n ORDER BY important DESC, InetQty DESC\n LIMIT 6\n\t\t OFFSET " . $offset . "\n\t "; } else { $limit = 4; $offset = ($page - 1) * $limit; $sql = "\n\t\t\t SELECT count(w.warecode) as cnt\n\t\t\t FROM segment_cache\n\t\t\t JOIN warez_" . $GlobalConfig['RegionID'] . " AS w ON w.warecode = segment_cache.warecode\n\t\t\t WHERE segment_cache.segment_name = '" . $segment_name . "_aks'\n\t\t\t AND segment_cache.region_id=" . $GlobalConfig['RegionID'] . "\n\t\t\t"; $res = $db->query($sql); if ($row = @mysql_fetch_assoc($db->Query_ID)) { $count = $row['cnt']; } $sql = "\n SELECT DISTINCT\n\t w.warecode,\n\t\t w.FullName,\n\t\t m.MarkName,\n\t\t w.InetQty,\n\t\t Discounted,\n\t InetDiscounted,\n\t OldPrice,\n\t important\n\t\t FROM segment_cache\n\t\t JOIN warez_" . $GlobalConfig['RegionID'] . " AS w ON w.warecode = segment_cache.warecode\n\t\t JOIN marks AS m ON m.MarkID = w.mark\n\t\t WHERE segment_cache.segment_name = '" . $segment_name . "_aks'\n\t\t AND segment_cache.region_id=" . $GlobalConfig['RegionID'] . "\n ORDER BY important DESC, InetQty DESC\n LIMIT 4\n\t\t OFFSET " . $offset . "\n\t "; } $db->query($sql); $num = 1; while ($row = @mysql_fetch_assoc($db->Query_ID)) { if ($row["MarkName"] && $row["FullName"]) {