示例#1
0
        }
        echo '
            <li>
            <div class="block-images-list">
            <img src="' . $img_path . '" width="' . $width . '" height="' . $height . '"/>
            </div>                    
            
            <ul class="reviews-and-counts-list">
            <li><img src="/images/eye-icon.png"/><p>' . $row["count"] . '</p></li>
            <li><img src="/images/comment-icon.png"/><p>' . $count_reviews . '</p></li>
            </ul>
            
            <p class="style-title-list"><a href="view_content.php?id=' . $row["products_id"] . '">' . $row["title"] . '</a></p>
            
            <a class="add-cart-style-list" href="" tid="' . $row["products_id"] . '"></a>
            <p class="style-price-list"><strong>' . group_numerals($row["price"]) . '</strong> грн</p>
            <div class="style-text-list">
            ' . $row["mini_description"] . '            
            </div>
            </li>
            
            
            ';
    } while ($row = mysql_fetch_array($result));
}
echo '</ul>';
if ($page != 1) {
    $pstr_prev = '<li><a class="pstr-prev" href="index.php?page=' . ($page - 1) . '&sort=' . $sorting . '">&lt;</a></li>';
}
if ($page != $total) {
    $pstr_next = '<li><a class="pstr-next" href="index.php?page=' . ($page + 1) . '&sort=' . $sorting . '">&gt;</a></li>';
示例#2
0
         </div>
         
         </div>
         <div id="block-content-info">
         <img src="' . $img_path . '" width="' . $width . '" height="' . $height . '" />
         
         <div id="block-mini-description">
         
         <p id="content-title">' . $row1["title"] . '</p>
         
         <ul class="reviews-and-counts-content">
         <li><img src="/images/eye-icon.png"><p>' . $row1["count"] . '</p></li>
         <li><img src="/images/comment-icon.png"><p>' . $count_reviews . '</p></li>
         </ul>
         
         <p id="style-price">' . group_numerals($row1["price"]) . ' грн</p>
         
         <a class="add-cart" id="add-cart-view" tid="' . $row1["products_id"] . '"></a>
         
         <p id="content-text">' . $row1["mini_description"] . '</p>
         
         </div>
         
         </div>
         
         
         ';
 } while ($row1 = mysql_fetch_array($result1));
 $result = mysql_query("SELECT * FROM uploads_images WHERE products_id = {$id}", $link);
 if (mysql_num_rows($result) > 0) {
     $row = mysql_fetch_array($result);
        $query_reviews = mysql_query("SELECT * FROM table_reviews WHERE products_id = {$res_query["products_id"]} AND moderat='1'", $link);
        $count_reviews = mysql_num_rows($query_reviews);
        if (strlen($res_query["image"]) > 0 && file_exists("./uploads_images/" . $res_query["image"])) {
            $img_path = './uploads_images/' . $res_query["image"];
            $max_width = 120;
            $max_height = 120;
            list($width, $height) = getimagesize($img_path);
            $ratioh = $max_height / $height;
            $ratiow = $max_width / $width;
            $ratio = min($ratioh, $ratiow);
            $width = intval($ratio * $width);
            $height = intval($ratio * $height);
        } else {
            $img_path = "/images/no-image-65.png";
            $width = 65;
            $height = 118;
        }
        echo '
<li>
<img src="' . $img_path . '" width="' . $width . '" height="' . $height . '" />
<a class="random-title" href="view_content.php?id=' . $res_query["products_id"] . '">' . $res_query["title"] . '</a>
<p class="random-reviews">Отзывы ' . $count_reviews . '</p>
<p class="random-price">' . group_numerals($res_query["price"]) . '</p>
<a class="random-add-cart" tid="' . $res_query["products_id"] . '"></a>
</li>
';
    } while ($res_query = mysql_fetch_array($query_random));
}
?>
</ul>
</div>
</li>

</ul>
</div>

<div id="tovar' . $row["cart_id"] . '" class="price-product"><h5><span class="span-count" >' . $row["cart_count"] . '</span> x <span>' . $row["cart_price"] . '</span></h5><p price="' . $row["cart_price"] . '" >' . group_numerals($int) . ' руб</p></div>
<div class="delete-cart"><a  href="cart.php?id=' . $row["cart_id"] . '&action=delete" ><img src="/images/bsk_item_del.png" /></a></div>

<div id="bottom-cart-line"></div>
</div>


';
            } while ($row = mysql_fetch_array($result));
            echo '
 <h2 class="itog-price" align="right">Итого: <strong>' . group_numerals($all_price) . '</strong> руб</h2>
 <p align="right" class="button-next" ><a href="cart.php?action=confirm" >Далее</a></p> 
 ';
        } else {
            echo '<h3 id="clear-cart" align="center">Корзина пуста</h3>';
        }
        break;
}
?>

</div>

<?php 
include "include/block-footer.php";
?>
</div>
<?php

if ($_SERVER["REQUEST_METHOD"] == "POST") {
    define('myeshop', true);
    include 'db_connect.php';
    include '../functions/functions.php';
    $result = mysql_query("SELECT * FROM cart WHERE cart_ip = '{$_SERVER['REMOTE_ADDR']}'", $link);
    if (mysql_num_rows($result) > 0) {
        $row = mysql_fetch_array($result);
        do {
            $int = $int + $row["cart_price"] * $row["cart_count"];
        } while ($row = mysql_fetch_array($result));
        echo group_numerals($int);
    }
}
<?php

if ($_SERVER["REQUEST_METHOD"] == "POST") {
    define('myeshop', true);
    include "db_connect.php";
    include "../functions/functions.php";
    $result = mysql_query("SELECT * FROM cart,table_products WHERE cart.cart_ip = '{$_SERVER['REMOTE_ADDR']}' AND table_products.products_id = cart.cart_id_product", $link);
    if (mysql_num_rows($result) > 0) {
        $row = mysql_fetch_array($result);
        do {
            $count = $count + $row["cart_count"];
            $int = $int + $row["price"] * $row["cart_count"];
        } while ($row = mysql_fetch_array($result));
        if ($count == 1 or $count == 21 or $count == 31 or $count == 41 or $count == 51 or $count == 61 or $count == 71 or $count == 81) {
            $str = ' ';
        }
        if ($count == 2 or $count == 3 or $count == 4 or $count == 22 or $count == 23 or $count == 24 or $count == 32 or $count == 33 or $count == 34 or $count == 42 or $count == 43 or $count == 44 or $count == 52 or $count == 53 or $count == 54 or $count == 62 or $count == 63 or $count == 64) {
            $str = '';
        }
        if ($count == 5 or $count == 6 or $count == 7 or $count == 8 or $count == 9 or $count == 10 or $count == 11 or $count == 12 or $count == 13 or $count == 14 or $count == 15 or $count == 16 or $count == 17 or $count == 18 or $count == 19 or $count == 20 or $count == 25 or $count == 26 or $count == 27 or $count == 28 or $count == 29 or $count == 30 or $count == 35 or $count == 36 or $count == 37 or $count == 38 or $count == 39 or $count == 40 or $count == 45 or $count == 46 or $count == 47 or $count == 48 or $count == 49 or $count == 50 or $count == 55 or $count == 56 or $count == 57 or $count == 58 or $count == 59 or $count == 60 or $count == 65) {
            $str = '';
        }
        if ($count > 81) {
            $str = "";
        }
        echo '<span>' . $count . $str . '</span> to the amount of <span>' . group_numerals($int) . '</span> $';
    } else {
        echo '0';
    }
}
<?php

if ($_SERVER["REQUEST_METHOD"] == "POST") {
    define('myeshop', true);
    include "db_connect.php";
    include "../functions/functions.php";
    $result = mysql_query("SELECT * FROM cart,table_products WHERE cart.cart_ip = '{$_SERVER['REMOTE_ADDR']}' AND table_products.products_id = cart.cart_id_product", $link);
    if (mysql_num_rows($result) > 0) {
        $row = mysql_fetch_array($result);
        do {
            $count = $count + $row["cart_count"];
            $int = $int + $row["price"] * $row["cart_count"];
        } while ($row = mysql_fetch_array($result));
        if ($count == 1 or $count == 21 or $count == 31 or $count == 41 or $count == 51 or $count == 61 or $count == 71 or $count == 81) {
            $str = ' товар';
        }
        if ($count == 2 or $count == 3 or $count == 4 or $count == 22 or $count == 23 or $count == 24 or $count == 32 or $count == 33 or $count == 34 or $count == 42 or $count == 43 or $count == 44 or $count == 52 or $count == 53 or $count == 54 or $count == 62 or $count == 63 or $count == 64) {
            $str = ' товара';
        }
        if ($count == 5 or $count == 6 or $count == 7 or $count == 8 or $count == 9 or $count == 10 or $count == 11 or $count == 12 or $count == 13 or $count == 14 or $count == 15 or $count == 16 or $count == 17 or $count == 18 or $count == 19 or $count == 20 or $count == 25 or $count == 26 or $count == 27 or $count == 28 or $count == 29 or $count == 30 or $count == 35 or $count == 36 or $count == 37 or $count == 38 or $count == 39 or $count == 40 or $count == 45 or $count == 46 or $count == 47 or $count == 48 or $count == 49 or $count == 50 or $count == 55 or $count == 56 or $count == 57 or $count == 58 or $count == 59 or $count == 60 or $count == 65) {
            $str = ' товаров';
        }
        if ($count > 81) {
            $str = " тов";
        }
        echo '<span>' . $count . $str . '</span> на сумму <span>' . group_numerals($int) . '</span> руб';
    } else {
        echo '0';
    }
}