예제 #1
0
파일: company.php 프로젝트: j3nnn1/homework
 public function addEmployee($type)
 {
     $employeeSolver = new EmployeeFactory();
     $employee = $employeeSolver->solver($type);
     $employees[] = $employee;
     return $employee;
 }
예제 #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;
 }
예제 #3
0
파일: Change.php 프로젝트: bagvendt/vaip
 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/');
     }
 }
예제 #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);
 }
예제 #5
0
 function getEmployee()
 {
     return EmployeeFactory::createEmployee($this->employee_id);
 }
예제 #6
0
 public function testBadInstance()
 {
     $this->setExpectedException('Exception');
     EmployeeFactory::build('BadName');
 }