Example #1
0
 public function addEmployee($type)
 {
     $employeeSolver = new EmployeeFactory();
     $employee = $employeeSolver->solver($type);
     $employees[] = $employee;
     return $employee;
 }
Example #2
0
 function employeeList()
 {
     $list = array();
     $result = mysql_query("SELECT empid FROM employee");
     $i = 0;
     while ($row = mysql_fetch_assoc($result)) {
         $list[$i] = EmployeeFactory::createEmployee($row['empid']);
         $i++;
     }
     return $list;
 }
Example #3
0
 function begin()
 {
     if ($user = $this->models->getUser()) {
         $reciever = EmployeeFactory::createEmployee($_POST[employee]);
         $senderShifts = ShiftFactory::createEmpShift($user->getEmployeeId());
         $recieverShifts = ShiftFactory::createEmpShift($_POST[employee]);
         $this->views->populate('recieverShifts', $recieverShifts);
         $this->views->populate('senderShifts', $senderShifts);
         $this->views->populate('reciever', $reciever);
         $this->views->flush('body', 'change');
     } else {
         header('location: /Users/Login/');
     }
 }
Example #4
0
 /**
  * Returns the date (in UNIX-time)
  * @return The date of the shift (in UNIX-time)  
  */
 function get_employee()
 {
     return EmployeeFactory::createEmployee($this->empID);
 }
Example #5
0
 function getEmployee()
 {
     return EmployeeFactory::createEmployee($this->employee_id);
 }
 public function testBadInstance()
 {
     $this->setExpectedException('Exception');
     EmployeeFactory::build('BadName');
 }