Created
September 23, 2021 15:57
-
-
Save estudijoanpuig/26fd7dc3c84137b24720d1530e8c6200 to your computer and use it in GitHub Desktop.
galeria voyager amb array llibreria
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section id="services" class="py-16"> | |
<div class="container"> | |
<div class="text-center"> | |
<h2 class="mb-12 section-heading wow fadeInDown" data-wow-delay="0.3s">gal.leria</h2> | |
</div> | |
<div class="uk-width-expand"> | |
<form id="search-form" action=""> | |
<div class="uk-inline uk-width-1-1"> | |
<span class="uk-form-icon uk-form-icon-flip" data-uk-icon="icon: search"></span> | |
<input class="uk-input uk-width-1-1 search-fld" type="text" placeholder="Type your search" autofocus> | |
<a hidden href="#" class="search-filter" data-uk-filter-control="[data-tags*='']">Search</a> | |
<a hidden href="#" class="search-filter-all" data-uk-filter-control>Search all</a> | |
<a hidden href="#" class="search-filter-none" data-uk-filter-control="[data-empty='']">Filter none</a> | |
</div> | |
</form> | |
</div> | |
<div class="spacer"></div> | |
<!--CARDS WRAPPER--> | |
<section class="uk-section uk-section-small uk-padding-remove-bottom"> | |
<div class="uk-container uk-container-expand uk-margin-large-bottom"> | |
<ul class="uk-subnav uk-subnav-pill"> | |
<li data-uk-filter-control><a href="#">Show All</a></li> | |
<li data-uk-filter-control=".laravel"><a href="#">laravel</a></li> | |
<li data-uk-filter-control=".codeigniter"><a href="#">codeigniter</a></li> | |
<li data-uk-filter-control=".wordpress"><a href="#">wordpress</a></li> | |
<li data-uk-filter-control=".static"><a href="#">static PHP/HTML</a></li> | |
<li data-uk-filter-control=".themes"><a href="#">themes</a></li> | |
<li data-uk-filter-control=".css"><a href="#">css</a></li> | |
<li data-uk-filter-control=".images"><a href="#">images</a></li> | |
<li data-uk-filter-control=".js"><a href="#">js</a></li> | |
<li data-uk-filter-control=".eines"><a href="#">eines</a></li> | |
</ul> | |
</div> | |
<div class="uk-grid uk-grid-medium uk-child-width-1-2@s uk-child-width-1-3@m uk-child-width-1-4@l uk-child-width-1-5@xl uk-grid-match js-filter" data-uk-grid="masonry: true" data-uk-sortable="handle: .drag-icon" > | |
<?php | |
$servername = "localhost"; | |
$username = "root"; | |
$password = ""; | |
$dbname = "voyager"; | |
// Create connection | |
$conn = new mysqli($servername, $username, $password, $dbname); | |
// Check connection | |
if ($conn->connect_error) { | |
die("Connection failed: " . $conn->connect_error); | |
} | |
$sql = "SELECT * FROM `llibreria` order by id asc"; | |
$result = $conn->query($sql); | |
if ($result->num_rows > 0) { | |
// output data of each row | |
while($row = $result->fetch_assoc()) { | |
?> | |
<!-- card --> | |
<div class='<?php echo "$row[categoria]";?>' data-tags="<?php echo "$row[nom]";?> | |
<?php echo "$row[nom]";?> <?php echo "$row[descripcio]";?>"> | |
<div class="uk-card uk-card-small uk-card-default"> | |
<div class="uk-card-media"> | |
<div class="uk-inline-clip uk-transition-toggle" tabindex="0"> | |
<a href="<?php echo "$row[img]";?>" data-fancybox="gallery" data-caption="My caption"> <img src="<?php echo "$row[img]";?>" alt="" /></a> | |
<div class="uk-transition-slide-bottom uk-position-bottom uk-overlay uk-overlay-primary"> | |
<div class="uk-grid uk-grid-small uk-grid-divider uk-flex uk-flex-middle" data-uk-grid> | |
<div class="uk-width-auto uk-text-right"> | |
<?php echo "$row[updated_at]";?>/ | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
<div class="uk-card-body"> | |
<h6 class="uk-margin-small-bottom uk-margin-remove-adjacent uk-text-bold"><?php echo "$row[nom]";?></h6> | |
<p><?php echo "$row[descripcio]";?></p> | |
</div> | |
</div> | |
</div> | |
<!-- /card --> | |
<?php } | |
} else { | |
echo "0 results"; | |
} | |
$conn->close(); | |
?> | |
</div> | |
</div> | |
</section> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment