Пример #1
0
								<button type="button" class="btn btn-default" id="choose_employee">Choose</button>
							</span>
						</div>
						<?php 
echo CHtml::error($model, 'employee_id');
?>
					</div>
				</div>

				<div class="form-group">
					<?php 
echo CHtml::activeLabelEx($model, 'shift_id', array('class' => $label_class));
?>
					<div class="col-md-6 col-xs-12">
						<?php 
echo CHtml::activeDropDownList($model, 'shift_id', CHtml::listData(ReferenceAttendanceShifts::model()->findAll(), 'id', 'name'), array('data-placeholder' => at('Please select one...'), 'prompt' => '', 'data-live-search' => 'true', 'class' => 'validate[required] form-control select'));
?>
						<?php 
echo CHtml::error($model, 'shift_id');
?>
					</div>
				</div>

				<div class="form-group">
					<?php 
echo CHtml::activeLabelEx($model, 'date', array('class' => $label_class));
?>
					<div class="col-md-6">
						<div class="input-group">
							<span class="input-group-addon"><span class="fa fa-calendar"></span></span>
							<?php 
Пример #2
0
<?php

$weekdaysShort = weekdaysShort();
$monthName = getMonthName();
$indonesianDays = indonesianDays();
$dw = date("w", strtotime($model->year . '-' . ($model->month + 1) . '-1'));
$ml = date("d", strtotime($model->year . '-' . ($model->month + 2) . '-0'));
$options = ReferenceAttendanceShifts::model()->findAll();
?>

<?php 
if ($model->department_id > 0 && $model->department_id != '') {
    ?>

<div class="panel-heading">
	<p class="note"><?php 
    echo $monthName[$model->month] . ', ' . $model->year;
    ?>
</p>
</div>

<div class="panel-body over">
	<table class="table">
	<thead>
		<tr>
		<?php 
    $day = 1;
    echo "<th>No.</th>";
    echo "<th>Nik</th>";
    echo "<th>Name</th>";
    for ($i = 0; $i <= $ml - 1; $i++) {
 public function actionEmployeeSchedulle()
 {
     header('Content-type: application/json');
     $schedulles = AttendanceSchedulles::model()->findAllByAttributes(array('employee_id' => getUser()->id));
     $data = array();
     foreach ($schedulles as $schedulle) {
         for ($i = 1; $i <= 31; $i++) {
             if (strlen($i) == 1) {
                 $date = 'date_0' . $i;
             } else {
                 $date = 'date_' . $i;
             }
             $day = $schedulle->year . '-' . $schedulle->month . '-' . $i;
             $day = strtotime($day) + 2678400;
             $day = date('Y-m-d', $day);
             if ($schedulle->{$date} != '') {
                 $shift = ReferenceAttendanceShifts::model()->findByPk($schedulle->{$date})->name;
                 $data[] = array('title' => $shift, 'start' => $day, 'allDay' => true);
             }
         }
     }
     // $c = new CDbCriteria();
     // $c->compare('employee_id', getUser()->id);
     // $schedulles = AttendanceSchedulle::model()->findAll($c);
     // $data 		= array();
     // foreach($schedulles as $schedulle)
     // {
     // 	$data[] = array('title'=>$schedulle->shift->name, 'start'=>$schedulle->schedulle_date, 'allDay'=>true);
     // }
     echo CJSON::encode($data);
 }
 public function getShift_name()
 {
     $name = '';
     if ($this->shift_id != null) {
         $name = ReferenceAttendanceShifts::model()->findByPk($this->shift_id)->name;
     }
     return $name;
 }