Welcome Guest, Not a member yet? Register   Sign In
Coming up with a business logic helper class
#1

[eluser]afro[/eluser]
I have this requirement:
to limit the number of staff who can be on leave at
any particular to 3 staffs from the same department
I need help to come up with this functions in a helper class
where the helper class should be able to tell the user/staff
that there three staffs from your department who have applied
for leave, the system should then tell the staff when the staff
who went for the leave earlier will be reporting, then he/she
will be eligible for a leave.
i have a function to check the number of employees
Code:
function check_staff_on_leave()
               {
                $this->db->select('Department, COUNT(*) AS on_leave', FALSE);
                $this->db->from('checkoff');
                $this->db->where('Department', $this->input->post('department'));
                $this->db->group_by('Department');
                $this->db->having('COUNT(*) >', 2);  
                $result = $this->db->get();
                //echo $this->db->last_query();
                //
                if($result->num_rows() > 0)
                {
                 $rows = $result->result_array();
                
                  return FALSE;
                
                    }
                 else
                  {
                  return TRUE;
                }  
              }

I now need 1 that will be checking the staff who went on leave earlier and when he/she will
be reporting back.
please help me


Messages In This Thread
Coming up with a business logic helper class - by El Forum - 04-07-2011, 06:54 AM
Coming up with a business logic helper class - by El Forum - 04-07-2011, 10:22 PM
Coming up with a business logic helper class - by El Forum - 04-07-2011, 11:41 PM
Coming up with a business logic helper class - by El Forum - 04-07-2011, 11:53 PM
Coming up with a business logic helper class - by El Forum - 04-08-2011, 03:17 AM
Coming up with a business logic helper class - by El Forum - 04-08-2011, 10:34 AM
Coming up with a business logic helper class - by El Forum - 04-10-2011, 11:13 PM
Coming up with a business logic helper class - by El Forum - 04-10-2011, 11:45 PM
Coming up with a business logic helper class - by El Forum - 04-11-2011, 01:25 AM
Coming up with a business logic helper class - by El Forum - 04-11-2011, 01:45 AM
Coming up with a business logic helper class - by El Forum - 04-11-2011, 05:58 AM
Coming up with a business logic helper class - by El Forum - 04-11-2011, 06:11 AM
Coming up with a business logic helper class - by El Forum - 04-11-2011, 06:24 AM
Coming up with a business logic helper class - by El Forum - 04-11-2011, 06:36 AM
Coming up with a business logic helper class - by El Forum - 04-11-2011, 06:43 AM
Coming up with a business logic helper class - by El Forum - 04-11-2011, 06:56 AM
Coming up with a business logic helper class - by El Forum - 04-11-2011, 07:05 AM



Theme © iAndrew 2016 - Forum software by © MyBB