I need your help. I have an auction scenario. I wrote two functions in javascript code. In this way, two counts are made according to the beginning and end of the auction. I want it to be "arac_durum" -> "Aktif" in my database when the first count is completed and "arac_durum" -> "Pasif" when the second count is completed. How can I do it, can you help?
<script>
function createCountDown(elementId, date, dateiki) {
var countDownDate = new Date(date).getTime();
var x = setInterval(function() {
var now = new Date().getTime();
var distance = countDownDate - now;
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
document.getElementById(elementId).innerHTML = "Süre ►" + days + ": " + hours + ": " + minutes + ": " + seconds;
if (distance < 0) {
clearInterval(x);
document.getElementById(elementId).innerHTML = "Started !";
// Here I want the "arac_durum" item to be "Aktif".
var bitistarihi = new Date(dateiki).getTime();
var y = setInterval(function() {
var simdi = new Date().getTime();
var distance = bitistarihi - simdi;
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
document.getElementById(elementId).innerHTML = "Süre ►" + days + ": " + hours + ": " + minutes + ": " + seconds;
if (distance < 0) {
clearInterval(y);
document.getElementById(elementId).innerHTML = "Finish !";
// Here I want the "arac_durum" item to be "Pasif".
}
}, 1000);
}
}, 1000);
}
createCountDown("<?=$araccek['arac_id']?>", "<?=$araccek['arac_gerisayim']?>", "<?=$araccek['arac_tarih']?>")
</script>
<p id="<?=$araccek['arac_id']?>"></p>


fetch('update.php?value=123')will runupdate.phpon the server, passing$_GET['value'] = 123