<?php $mutation_requests = MutationsRequest::model()->findAll(); $attendance_offs = AttendancePresencesRequestOff::model()->findAllByAttributes(array('status' => 'saved')); ?> <div class="row"> <div class="col-md-7"> <!-- START SALES BLOCK --> <div class="panel panel-default"> <div class="panel-heading"> <div class="panel-title-box"> <h3><?php echo at('Approval Notifications'); ?> </h3> <span><?php echo at('Current approval notifications'); ?> </span> </div> </div> <div class="panel-body panel-body-table"> <div class="table-responsive"> <table class="table table-bordered table-striped"> <thead> <tr> <th width="10%"><?php echo at('Type');
public function actionRotation($id) { $model = MutationsRequest::model()->findByAttributes(array('employee_id' => $id, 'status' => 'request')); if (!isset($model)) { $model = new MutationsRequest(); } else { $this->redirect(array('mutation_view', 'id' => $model->id)); } $model->fill($id); $model->is_rotation(); if (isset($_POST['MutationsRequest'])) { $model->attributes = $_POST['MutationsRequest']; $model->status = 'approved'; $model->approved_by = getUser()->role; $model->approved_at = date('Y-m-d h:i:s'); if ($model->save()) { $this->redirect(array('mutation_view', 'id' => $model->id)); } } $this->render('mutation', array('model' => $model)); }
public function delete_canceled() { $mutation = MutationsRequest::model()->findByAttributes(array('employee_id' => $this->employee_id, 'status' => 'rejected')); if ($this->status != 'rejected') { if (count($mutation) != 0) { $mutation->delete(); } } }
<?php $attendances = AttendancePresencesRecap::model()->findAllByAttributes(array('employee_id' => getUser()->employee_id)); $mutation_requests = MutationsRequest::model()->findAllByAttributes(array('employee_id' => Yii::app()->user->id)); ?> <div class="row"> <div class="col-md-7"> <!-- START SALES BLOCK --> <div class="panel panel-default"> <div class="panel-heading"> <div class="panel-title-box"> <h3><?php echo at('Attendance Presences'); ?> </h3> </div> </div> <div class="panel-body panel-body-table"> <div class="table-responsive"> <table class="table table-bordered table-striped"> <thead> <tr> <th width="10%"><?php echo at('Date'); ?> </th> <th width="10%"><?php echo at('Shift');
$absencess[] = $employee->absences; } foreach ($employees as $employee) { $attendance_offss[] = $employee->attendance_offs; } foreach ($employees as $employee) { $attendance_reqs[] = $employee->attendance_req; } $condition = 'created_by = "rm"'; if (getUser()->role == 'bm') { $condition = 'created_by = "rm" or created_by = "bm" or approved_by = "bm"'; } if (getUser()->role == 'kadept') { $condition = 'created_by = "kadept"'; } $mutation_requests = MutationsRequest::model()->findAll(array('condition' => $condition)); ?> <div class="row"> <div class="col-md-7"> <!-- START SALES BLOCK --> <div class="panel panel-default"> <div style="height:500px;overflow:scroll;"> <div class="panel-heading"> <div class="panel-title-box"> <h3><?php echo at('Attendance Incomplete'); ?>
public function actionRotation($id) { $model = MutationsRequest::model()->find(array('condition' => 'employee_id = ' . $id . ' and active_date > Now() and status <> "canceled"')); if (!isset($model)) { $model = new MutationsRequest(); } else { $this->redirect(array('mutation_view', 'id' => $model->id)); } $model->fill($id); $model->is_rotation(); if (isset($_POST['MutationsRequest'])) { $model->attributes = $_POST['MutationsRequest']; if ($model->save()) { $this->redirect(array('mutation_view', 'id' => $model->id)); } } $this->render('mutation', array('model' => $model)); }