I have a PHP script that checks if a user has been booked in for the last year. if they haven't then they cant be booked in, however I have an alertify JavaScript which will prompt if the user wishes to proceed/override with the booking. I know they're client and server side. So here what i have done so far.
if the $retemp is 1 then its has not been booked in for the last year, i want an alert with an override option. Im not fully understanding, I think I'm in the right direction with POST and ajax.
if($retemp == 1)
{
?>
<script type="text/javascript">
alertify.set({ labels: {
ok : "Yes",
cancel : "No"
} });
// confirm dialog
alertify.confirm("Proceed With Booking", function (e) {
if (e) {
$.ajax({
data: {confirm: 'yes'},
url: 'phpurl.php',
method: 'POST', // or GET
success: function(msg) {
alert(msg);
}
});
} else {
// user clicked "cancel"
}
});
</script>