<!DOCTYPE html>
<html lang="ru">
<head>
<title>поиск</title>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="js/readmore.js"></script>
<script>
$('article').readmore({
maxHeight: 50,
moreLink: '<a href="#">Развернуть текст</a>',
lessLink: '<a href="#">Свернуть текст</a>'
});
</script>
<style>
</style>
</head>
<body>
</body>
</html>
<?php
// Кол-во элементов
$limit = 12;
// Подключение к БД
define('DB_NAME', '');
define('DB_USER', '');
define('DB_PASSWORD', '');
define('DB_HOST', 'localhost');
$dbh = new PDO ( "mysql:host=" . DB_HOST ."; charset=utf8; dbname=" . DB_NAME, DB_USER, DB_PASSWORD);
// Получение записей для текущей страницы
$page = intval(@$_GET['page']);
$page = (empty($page)) ? 1 : $page;
$start = ($page != 1) ? $page * $limit - $limit : 0;
$sth = $dbh->prepare("SELECT * FROM `products` LIMIT {$start}, {$limit}");
$sth->execute();
$items = $sth->fetchAll(PDO::FETCH_ASSOC);
foreach ($items as $row) {
?>
<div class ="brd2">
<?=$row['product_id']?> // сюда надо впихнуть функцию
</div>
<?php
}
<div>
<!-- Bootstrap 4 -->
<?php
for ($i = 1; $i <= $n; $i++) {
if ($row[‘product_image_link’ . $i . ‘_link’] !== null) {
$links[] = $row[‘product_image_link’ . $i . ‘_link’];
$links[] = $row[‘product_image2_link’ . $i . ‘_link’];
$links[] = $row[‘product_image3_link’ . $i . ‘_link’];
}
}
?>
<div id="sliderBigImages<?=$row['product_id']?>" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img src="https://275129.selcdn.ru/macaw/<?=$link?>" alt="" style="width: 100%;">
</div>
<div class="carousel-item">
<img src="https://275129.selcdn.ru/macaw/<?=$link?>" alt="" style="width: 100%;">
</div>
<div class="carousel-item">
<img src="https://275129.selcdn.ru/macaw/<?=$link?>" alt="" style="width: 100%;">
</div>
</div>
<a class="carousel-control-prev" href="#sliderBigImages<?=$row['product_id']?>" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next"href="#sliderBigImages<?=$row['product_id']?>" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<!--class='lazyload' data-src=-->
</div>
<div class="card-border mb-4 card-teaser">
<div class="row2">
<?php
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) : ?>
<div class="col-sm-12 card2 card-body card-blog card-border mb-4 card-teaser col-md-6 col-lg-4 col-xl-3">
<?php
if($row['product_video_link'] == '0'):
?>
<div>
<!-- Bootstrap 4 -->
<div id="sliderBigImages<?=$row['product_id']?>" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img src="https://275129.selcdn.ru/macaw/<?=$row['product_image_link']?>" alt="" style="width: 100%;">
</div>
<div class="carousel-item">
<img src="https://275129.selcdn.ru/macaw/<?=$row['product_image2_link']?>" alt="" style="width: 100%;">
</div>
</div>
<a class="carousel-control-prev" href="#sliderBigImages<?=$row['product_id']?>" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next"href="#sliderBigImages<?=$row['product_id']?>" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<!--class='lazyload' data-src=-->
</div>
<?php
else:
?>
<video class ="img-fluid" controls="controls">
<source src = "https://275129.selcdn.ru/macaw/<?=$row['product_video_link']?>">
</video>
<?php
endif;
?>
<div class ="brd2">
<a title="Наведите курсор мышки на макет и нажмите правую кнопку мыши, и сохранить изображение/видео как" href="https://275129.selcdn.ru/macaw/<?=((!empty($row['product_video_link']))?$row['product_video_link']:$row['product_image_link'])?>">💾 Скачать макет 💾</a>
</div>
<div class ="brd2">
<?=$row['product_id']?>
</div>
<div class ="brd2">
🎫 <?=$row['product_name']?> 🎫
</div>
<div class ="brd2">
<a>
🌍 <?=$row['price'] ?> 🌍
</a>
</div>
<div class ="brd2">
<article>
<h2></h2>
<p>
💬 <?=$row['opis']?> 💬
</p>
</article>
</div>
<div class ="brd2 ">
💻 <?=$row['socs']?> 💻
</div>
<div class ="brd2">
<a href="<?=$row['link']?>">
👉 <?=$row['link']?>
</a>
</div>
</div>
<?php
endwhile;
?>
</div>
</div>
<!-- Bootstrap 4 -->
<div id="sliderBigImages<?=$row['product_id']?>" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img src="https://275129.selcdn.ru/macaw/<?=$row['product_image_link']?>" alt="" style="width: 100%;">
</div>
<div class="carousel-item">
<img src="https://275129.selcdn.ru/macaw/<?=$row['product_image2_link']?>" alt="" style="width: 100%;">
</div>
</div>
<a class="carousel-control-prev" href="#sliderBigImages<?=$row['product_id']?>" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next"href="#sliderBigImages<?=$row['product_id']?>" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<img class ="img-fluid" src = "img/ $row['product_image_link']">