示例#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);
     }
 }
示例#2
0
文件: Schemas.php 项目: bagvendt/vaip
 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/');
     }
 }
示例#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;
 }
示例#4
0
文件: Schema.php 项目: bagvendt/vaip
 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);
     }
 }