<?php 
require '../assets/config-data.php';

$promotxt = mysqli_real_escape_string($data, $_REQUEST['promo-page-text']);
$img = mysqli_real_escape_string($data, $_REQUEST['img-promo']);
$id = mysqli_real_escape_string($data, $_GET['row']);


$updatestatus = "UPDATE promosi_blog SET promo_content = '$promotxt', gambar_promo = '$img', promo_tgl = '$today' WHERE id = '$id'";
$bindstats = mysqli_query($data, $updatestatus);

if($bindstats) {
    echo '
    <script>
        alert("Promosi Text Successfully Change!!");
        window.location.href = "../dashboard.php?hal=promosi";
    </script>
    ';

} else {

    echo '
    <script>
        alert("ERROR on Change!!");
        window.location.href = "../dashboard.php?hal=promosi";
    </script>
    ';

}

?>