2 Replies Latest reply on Jun 13, 2010 6:15 PM by SakuyasLove

    Advanced If statements


      Hello everyone, I think this is considered advanced.


      I need a little help with my logic.  I am writing a very simple employee time clock.  I have a form with 6 buttons(clock in, clock out, on break, off break, on lunch, and off lunch)  Basically they can hit each button as much as they want as is so I want to do a little advanced logic.


      How would I shape the if statements to hide buttons once they have been clicked to only allow for the opposite button to be clicked.


      For instance, if I clock in I shouldnt be able to clock in again untill I have clocked out.  If I go on lunch I shouldnt be able to click any other button until I have came back from lunch.


      I am pulling the records from SQL (ex:

      ID    User   Type            Date

      34    31    Clocked In    2010-06-13 17:50:59
      35    31    Break Start    2010-06-13 17:51:01
      36    31    Break End    2010-06-13 17:51:01
      37    31    Lunch Start    2010-06-13 17:51:02
      38    31    Lunch End    2010-06-13 17:51:03
      39    31    Break Start    2010-06-13 17:51:04
      40    31    Break End    2010-06-13 17:51:05
      41    31    Clocked Out    2010-06-13 17:51:06



      Any help would be very helpful, even if its the terms I should use on google since I cant even seem to get the correct search query together to find an answer.