0
i wanted to put a time counter ( ex: a promotion of 10% for a certain time) would be able to do this with mysql ?
Could someone give me a hand on how to start doing that? ( how to put Count inside that box )
code:
<div id="wrapper">
<section id="promo">
<?php
$consulta = $pdo->prepare("SELECT * FROM produtohome");
$consulta -> execute();
$linhas = $consulta -> rowCount();
foreach($consulta as $mostra):
?>
<div class="card">
<img class="skin"src="images/<?= $mostra['produto_img']?>" alt="Nome da Empresa:
<?= $mostra['produto_nome']?>" title="Nome da Empresa: <?= $mostra['produto_nome']?>">
<div class="info">
<p class="color-white text-center font-text-light-med font-weight-heavy bgcolor-black"><?= $mostra['produto_nome']?></p>
</div>
<p class="preccor">Por: R$ <?= number_format($mostra['produto_preco'], 2,',','.')?></p>
<button class="bgcolor-red text-center btn"><a href="comprar.php?prod=<?= $mostra['produto_id']?>">Comprar</a></button>
</div>
<?php endforeach; ?>
</section>
</div>
css:
.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
max-width: 180px;;
margin: auto;
height: 300px;
text-align: center;
font-family: arial;
box-sizing: border-box;
}
.card:hover {
box-shadow: 0 8px 12px 0 rgba(0, 0, 0, 0.2);
outline: 2px solid red;
}
.skin {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
width: 180px;
margin: auto;
text-align: center;
font-family: arial;
}
.price {
color: grey;
font-size: 10px;
}
.card button {
border: none;
outline: 0;
margin-top: 30px;
height: 30px;
color: black;
background-color: #fff;
border-top: 1px solid rgba(0, 0, 0, 0.2);
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
text-align: center;
cursor: pointer;
width: 100%;
font-size: 18px;
}
.card button:hover {
opacity: 0.7;
}
img.skin{height: 130px;width: 180px;}
p.preccor{margin-top: 30px;}
.card .info {margin-top: 30px;
opacity: 1;
height: 0px;
line-height: 0px;
background-color: #000;
color: #FF4141;
text-align: center;
transition: all 500ms;
}
i was wondering if you have how to do this with mysql determining the time there and I’m having difficulty adding inside the div .
– Ming
The database only stores information, does not serve to count time, what appears on the page has to be done with html/javascript in this case. What you could do is save the end date, take this date and do the counter on the page, there depends nothing else on the bank. Now if you are having difficulty paying a bank information and put on the screen, the doubt is a little different, is not exactly the counter itself, can explain better?
– Ricardo Pontual
I have no difficulty getting the database information, my problem is to put this counter inside this box ( html / css) this part of mysql and php I can do.
– Ming