<?php

require 'krypton.php';

$getbola1 = mysqli_real_escape_string($krypton, $_REQUEST['bola1']);
$getbola2 = mysqli_real_escape_string($krypton, $_REQUEST['bola2']);
$getbola3 = mysqli_real_escape_string($krypton, $_REQUEST['bola3']);
$getbola4 = mysqli_real_escape_string($krypton, $_REQUEST['bola4']);
$getbola5 = mysqli_real_escape_string($krypton, $_REQUEST['bola5']);
$getbola6 = mysqli_real_escape_string($krypton, $_REQUEST['bola6']);
$getbola7 = mysqli_real_escape_string($krypton, $_REQUEST['bola7']);
$getbola8 = mysqli_real_escape_string($krypton, $_REQUEST['bola8']);
$getbola9 = mysqli_real_escape_string($krypton, $_REQUEST['bola9']);
$getbola10 = mysqli_real_escape_string($krypton, $_REQUEST['bola10']);
$getbola11 = mysqli_real_escape_string($krypton, $_REQUEST['bola11']);
$getbola12 = mysqli_real_escape_string($krypton, $_REQUEST['bola12']);
$getbola13 = mysqli_real_escape_string($krypton, $_REQUEST['bola13']);
$gettodaytime = date("Y-m-d H:i:s");

$updatejam = "UPDATE workingtime SET bola_1 = '$getbola1', bola_2 = '$getbola2', bola_3 = '$getbola3', bola_4 = '$getbola4', bola_5 = '$getbola5', bola_6 = '$getbola6', bola_7 = '$getbola7', bola_8 = '$getbola8', bola_9 = '$getbola9', bola_10 = '$getbola10', bola_11 = '$getbola11', bola_12 = '$getbola12', bola_13 = '$getbola13', jam_ubah ='$gettodaytime' ";
$connect = mysqli_query($krypton, $updatejam);

if($connect) {
  
    echo '<script> 
    alert("Jam Result Berhasil diubah!!")
    window.setTimeout(function() {
        window.location = "../ubahjam.php";
      }, 2000);
    </script>';
    
} else {
    echo '<script> 
    alert("Gagal Jam diubah")
    window.setTimeout(function() {
        window.location = "../ubahjam.php";
      }, 2000);
    </script>';
}
?>

<style>
.loader {
  border: 16px solid #f3f3f3; /* Light grey */
  border-top: 16px solid #3498db; /* Blue */
  border-radius: 50%;
  width: 120px;
  height: 120px;
  animation: spin 2s linear infinite;
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 9999;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

</style>

<div class="loader"></div>