Ejemplo n.º 1
0
 function __construct($month)
 {
     foreach ($month as $date) {
         $this->schema[$date][0] = ShiftFactory::createShift($date, 0);
         $this->schema[$date][1] = ShiftFactory::createShift($date, 1);
         $this->schema[$date][2] = ShiftFactory::createShift($date, 2);
         $this->schema[$date][3] = ShiftFactory::createShift($date, 3);
     }
 }
Ejemplo n.º 2
0
 function shift()
 {
     if ($user = $this->models->getUser()) {
         //fix date format
         $shift = ShiftFactory::createShift($this->route->getParam(3), $this->route->getParam(4));
         $this->views->populate('shift', $shift);
         $this->views->flush('body', 'shift');
     } else {
         header('location: /Users/Login/');
     }
 }
Ejemplo n.º 3
0
 function createEmpShift($emp)
 {
     $list = array();
     $result = mysql_query("SELECT * FROM shift WHERE userid = {$emp}");
     $i = 0;
     while ($row = mysql_fetch_assoc($result)) {
         $list[$i] = ShiftFactory::createShift($row['dayid'], $row['type']);
         $i++;
     }
     return $list;
 }
Ejemplo n.º 4
0
 function __construct($startDate, $slutdate)
 {
     $this->endDate = $slutdate;
     $this->startDate = $startDate;
     $this->typePointer = 0;
     $this->datePointer = $startDate;
     $month = array();
     $i = $startDate;
     while ($i <= $slutdate) {
         $month[$i] = $i;
         $i += 86400;
     }
     foreach ($month as $date) {
         $this->schema[$date][0] = ShiftFactory::createShift($date, 0);
         $this->schema[$date][1] = ShiftFactory::createShift($date, 1);
         $this->schema[$date][2] = ShiftFactory::createShift($date, 2);
         $this->schema[$date][3] = ShiftFactory::createShift($date, 3);
     }
 }