11-24-2016, 03:55 PM
I can't run your code without my db being setup correctly. I actually have a /pizza install on my other computer, but I'm not there.
Javascript is normally what you would use for preventing a button from being clicked multiple times.
There are a few php hackery ways to do it though.
So, since you're storing the on_break in the users table as 0 or 1 AND refreshing the page with that redirect message after update, you should be able to go down to the button part of your form and do this.
That will just hide your button if on_break = 1.
Javascript is normally what you would use for preventing a button from being clicked multiple times.
There are a few php hackery ways to do it though.
So, since you're storing the on_break in the users table as 0 or 1 AND refreshing the page with that redirect message after update, you should be able to go down to the button part of your form and do this.
Code:
<?php
Code:
if($user->data()->on_break != 1) {
Code:
?>
Code:
//your plain submit button in html here
Code:
<?php } ?>
That will just hide your button if on_break = 1.