Sorry if this is a simple task to do but I just started using the framework (its actually my first) and I’m still learning things.
Anyway, I’m trying to create a simple time-in / time-out system. I have 3 tables right now: account (holds login info), employee (misc info like first_name, last_name, timesheet_code) and timesheet (holds time_in and time_out entries). In order to record timesheet entries, the user/employee needs to first enter in a timesheet code that’s specific to this user then hit submit and the system uses the server’s timestamp to automatically grab the current time. How would I be able to validate the timesheet_code element against the employee table?
I already have the time_in part working, but it doesn’t validate the timesheet_code yet. Only validation I’ve been able to do is by passing both employee and timesheet models to the view file and using the employee model’s rules (array(‘timesheet_code’, ‘required’, ‘on’=>‘timesheet’))