The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need a point in the right direction
#21
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.

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.
  Reply
#22
Nice, that works perfectly. Clearly I need a refresher in PHP...time to go watch some PluralSight videos lol
  Reply
#23
Great! I really want to teach a class on userspice. I'm actually not a very good programmer so I've had to learn things like that to compensate for the fact that I never had time to learn javascript well Smile
  Reply
#24
lol my problem was I could never pick a language to actually settle down into. I've done a little Java, a little JS, a little PHP, a little Python, a little Ruby, a little Swift, a little Perl, and a lot of BASH. So I know just enough in too many languages to really remember any of it worth a damn. Probably why I ended up going the Linux admin route instead, but now I'm getting bored again and picking up on DevOps....which requires programming knowledge.
  Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)