Mini Shell
<style>
.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
width: 100%;
margin: auto;
}
</style>
<?
include"adm/conexao.php";
// executa a consulta
$sql = "SELECT * FROM `banners` ORDER BY rand() limit 01";
$res = mysqli_query($con, $sql);
$total = mysqli_num_rows($res);
while ($f = mysqli_fetch_array($res))
{
$idd = $f["id"];
$arquivoo = $f["arquivo"];
$linkk = $f["link"];
}
?>
<div id="myCarousel" data-interval="2000" class="carousel slide" data-ride="carousel">
<div class="carousel-inner" role="listbox">
<div class="item active">
<?
if(empty($linkk))
{
echo" <img src=\"adm/fotos/banner/$arquivoo\" alt=\"Miguel Pereira\" style=\"width:100%;\">
";
}
else
{
echo"
<a href = '$linkk' target = '_blank'><img src=\"adm/fotos/banner/$arquivoo\" alt=\"Miguel Pereira\" style=\"width:100%;\"> </a>";
}
?>
</div>
<?
include"adm/conexao.php";
// executa a consulta
$sql = "SELECT * FROM `banners` where id <> '$idd' ORDER BY rand()";
$res = mysqli_query($con, $sql);
$total = mysqli_num_rows($res);
while ($f = mysqli_fetch_array($res))
{
$arquivo = $f["arquivo"];
$linkk = $f["link"];
if(empty($linkk))
{
echo" <div class='item'>
<img src='adm/fotos/banner/$arquivo' alt='Sicomercio MPPA' style='width:100%;'>
</div>
";
}
else
{
echo" <div class='item'>
<a href = '$linkk' target = '_blank'> <img src='adm/fotos/banner/$arquivo' alt='Sicomercio MPPA' style='width:100%;'> </a>
</div>
";
}
}
// fecha a conexão
mysqli_close($con);
?>
<!-- Left and right controls -->
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Anterior</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Proximo</span>
</a>
</div>
</div>
<p> </p>
Zerion Mini Shell 1.0