<input type="hidden" name="cmbStatus[]" value="<?php 
                echo $record->getLeaveStatus();
                ?>
" />
  			<?php 
            }
            ?>
    	<?php 
        } else {
            if ($record->getLeaveStatus() == Leave::LEAVE_STATUS_LEAVE_WEEKEND) {
                echo $lang_Leave_Common_Weekend;
            } elseif ($record->getLeaveStatus() == 0) {
                echo $lang_Leave_Common_Cancelled;
            } else {
                $holiday = new Holidays();
                if ($holiday->isHoliday($record->getLeaveDate())) {
                    $holiday = Holidays::getHolidayForDate($record->getLeaveDate());
                    echo $holiday->getDescription();
                } else {
                    if (isset($statusArr[$record->getLeaveStatus()])) {
                        echo $statusArr[$record->getLeaveStatus()];
                    }
                }
            }
            ?>
    			<input type="hidden" name="cmbStatus[]" value="<?php 
            echo $record->getLeaveStatus();
            ?>
" />
    			<input type="hidden" name="id[]" value="<?php 
            echo $record->getLeaveId();
示例#2
0
 /**
  * @param int $i
  * @param Holidays $holidays
  * @param int[] $weekDates
  * @param int $duration
  * @return mixed[]
  */
 private function getDaysDetails($i, Holidays $holidays, array $weekDates, $duration)
 {
     $bgColor = NULL;
     $title = NULL;
     if ($i < 6) {
         $h = $holidays->isHoliday($weekDates[$i]);
         if ($h) {
             $bgColor = $h->color;
             //$bgColor = "style='background-color: #".Holidays::$defaultColor.";'";
             $title = $h->description;
         }
     } else {
         $bgColor = Holidays::$defaultColor;
     }
     return array("color" => $bgColor, "title" => $title, "duration" => $duration);
 }
示例#3
0
文件: Leave.php 项目: noikiy/owaspbwa
 /**
  * Calculates the time off for a particular date
  *
  * Return values:
  * Eg: Returns 1 for full day off, 0.5 for half day off, 0 for no off time
  *
  * @param String $date
  * @return integer $timeOff
  */
 protected function _timeOffLength($date)
 {
     $timeOff = 0;
     if (isset($this->weekends[date('N', strtotime($date)) - 1])) {
         $timeOff = $this->weekends[date('N', strtotime($date)) - 1]->getLength();
     }
     $holidaysObj = new Holidays();
     $length = $holidaysObj->isHoliday($date);
     if ($length > $timeOff) {
         $timeOff = $length;
     }
     return $timeOff / 8;
 }