<?php
include 'includes/translate_inc.php';
include 'includes/dbcon_inc.php'; $success = false; $found = false;
echo '<h2>Промоции</h2>'; error_reporting(E_ERROR); $connect = mysql_connect($hostname, $username, $password);
if ($connect) { $select = mysql_select_db($dbName); if ($select) { $success = true; } else { echo '<br/><h3>В момента няма връзка с базата данни. Моля опитайте по-късно.</h3>'; } } else { echo '<br/><h3>В момента няма връзка с базата данни. Моля опитайте по-късно.</h3>'; }
if ($success) { for ($i = 1; $i < 60; $i++) { $categoryName = translateNumToCategory($i); $dbProducts = mysql_query('SELECT * FROM ' . $categoryName . " WHERE Promo = 1");
if (!empty($dbProducts)) if (mysql_num_rows($dbProducts) > 0) { $found = true; while ($product = mysql_fetch_array($dbProducts)) { echo '<div class = "articule">'; echo "\n\t"; echo '<div class = "articule_name"><a href="product.php?cat=' . $i . '&id=' . $product['ID'] . '">'; echo $product['Name'] . '</a></div>' . "\n\t" . "\n\t" . '<center>'; echo '<div class="imagecon"><a href="product.php?cat=' . $i . '&id=' . $product['ID'] . '"><div class="originalimage"><img src="product_images/' . $product['Image'] . '"/></div>'; if (isset($product['Promo'])) { if ($product['Promo'] == 1) { echo '<div class="promoimage"><img src="images/Promotion.png"/></div>'; } } if (isset($product['New'])) { if ($product['New'] == 1) { echo '<div class = "newproduct"><img src="images/new.png"/></div>'; } } echo '</a></div>' . "\n\t" . '<table>' . "\n\t"; echo '<tr><td><b>Арт.№</b></td><td>' . $product['No']; echo '</td></tr>' . "\n\t"; echo '<tr><td><b>Цена: </b></td><td>' . $product['Value']; echo '</td></tr>' . "\n\t" . '</table>' . "\n\t" . '</center>' . "\n" . '</div>' . "\n"; } } } } if ($found == false) { echo '<h3>В момента няма активни промоции.</h3>'; } else { echo '<div class="pages">1 2 3 4</div>'; } ?> </div> </div> <div id="collection"> <div class="inner"> <div id="minigal"><?php if ($success) { for ($i = 1; $i <= 6; $i++) { $categoryName = translateNumToCategory($i); $dbProducts = mysql_query('SELECT * FROM ' . $categoryName . " WHERE Promo = 1 LMIT 6"); while ($product = mysql_fetch_array($dbProducts)) { $promoimg = '<div><img src="product_images/' . $product['Image'] . '" width="57" height="53" alt="Pic" /></div>'; echo $promoimg;}
} }?> </div> <h2>ГОРЕЩИ ОФЕРТИ</h2> <ul> <li>Панти</li> <li>Водачи</li> </ul> </div> </div>