示例#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
文件: 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);
     }
 }
示例#4
0
 function commitShift()
 {
     ShiftFactory::insertShift($this->date, $this->type, $this->empID);
 }
示例#5
0
文件: Change.php 项目: bagvendt/vaip
 function accept()
 {
     if (isset($_POST['accept'])) {
         ShiftFactory::acceptChangeOffer($_POST['shift_id']);
     }
     if (isset($_POST['reject'])) {
         ShiftFactory::rejectChangeOffer($_POST['shift_id']);
     }
     header('location: /Schemas/');
 }
示例#6
0
 function acceptChangeOffer($switch_id)
 {
     $switches = mysql_query("select * from switchdata where switch_id = {$switch_id}");
     while ($row = mysql_fetch_assoc($switches)) {
         ShiftFactory::addEmployee($row['day'], $row['type'], $row['new_emp']);
     }
     mysql_query("UPDATE switch SET status = true WHERE switch_id = {$switch_id}");
 }