Your IP : 216.73.216.79


Current Path : /var/www/html/ekursus/frontend/views/application/
Upload File :
Current File : /var/www/html/ekursus/frontend/views/application/index3.php

<?php

use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\Pjax;
use backend\models\Trainee;
use backend\models\Application;
use backend\models\course\Course;
use backend\models\contractor\Contractor;
use backend\models\timetable\Timetable;
use yii\db\Query;
//use \Date;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\course\CourseSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::t('app', 'Senarai Peserta');
$this->params['breadcrumbs'][] = $this->title;
?>
<style>
    #w1{
        text-align:center;
    }
    #w1 th {
        text-align:center;
    }
</style>
<div class="ref-index">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="ibox float-e-margins">
         <?php Pjax::begin(); ?>
            <div class="ibox-title"> <?php echo $this->render('_search', ['model' => $searchModel]); ?></div>
                <div class="ibox-content">
                    <div class="table-responsive">
                        <?php $timetable = Timetable::find()->where(['id' => $_GET['kod_jadual']])->one();
                              $course = Course::find()->where(['kod' => $timetable->kod_kursus])->one();
                              $application = Application::find()->where(['kod_jadual' => $_GET['kod_jadual']])->one();
                              $trainee =  Trainee::find()->where(['kod_permohonan' => $application->id])->one();
                              $contractor = Contractor::find()->where(['no_spkk' => $application->no_spkk ])->one();
                              $mula = date("d-m-Y", strtotime($timetable->tkh_kursus));
                              $tamat = date("d-m-Y", strtotime($timetable->tkh_tamat));
                              $diff = $tamat-$mula+1;

                              $bil_hari_kursus = $diff; ?>

                              <div><b>KURSUS: <?php echo $course->keterangan ?></b><br>
                                   <b>TARIKH: <?php echo date("d-m-Y", strtotime($timetable->tkh_kursus)) ?></b><br>
                                   <b>LOKASI: <?php echo $timetable->lokasi ?></b><br></div><br>
                                       
                    <?= GridView::widget([
                        'dataProvider' => $dataProvider,
                        // 'filterModel' => $searchModel,
                        'summary' => '',
                        'columns' => [
                            ['class' => 'yii\grid\SerialColumn'],
            		    [ 'attribute' => 'no_spkk', 'format' => 'raw', 'value' => function ($model) {
                                if (!is_null($model->trainee)) {
                                    return $model->trainee->nama_peserta;
                                } else {
                                    return '';
                                }
                             },
                              'headerOptions' => ['style' => 'text-align:center;'],
                              'contentOptions' => ['style' => 'text-align:left;'],
                              'label' => 'Nama Peserta'
                            ],
                            [ 'attribute' => 'no_spkk', 'format' => 'raw', 'value' => function ($model) {
                                if (!is_null($model->trainee)) {
                                    return $model->trainee->no_kp;
                                } else {
                                    return '';
                                }
                             },
                              'headerOptions' => ['style' => 'text-align:center;'],
                              'contentOptions' => ['style' => 'text-align:left;'],
                              'label' => 'No Kad Pengenalan'
                            ],
            		            [ 'attribute' => 'nama_sykt', 'format' => 'raw', 'value' => function ($model) {
                                if (!is_null($model->contractor)) {
                                    return $model->contractor->nama_sykt;
                                } else {
                                    return '';
                                }
                             },
                              'headerOptions' => ['style' => 'text-align:center;'],
                              'contentOptions' => ['style' => 'text-align:left;'],
                              'label' => 'Syarikat'
                            ],
                        [ 'attribute' => 'no_spkk', 'format' => 'raw', 'value' => function ($model) {
                                if (!is_null($model->contractor)) {
                                    return $model->contractor->no_spkk;
                                } else {
                                    return '';
                                }
                             },
                              'headerOptions' => ['style' => 'text-align:center;'],
                              'contentOptions' => ['style' => 'text-align:left;'],
                              'label' => 'No SPKK'
                            ],
            		   [ 'attribute' => 'status_mohon', 'format' => 'raw', 'value' => function ($model) {
                                if (!is_null($model->status_mohon)) {
                                    return \backend\models\reference\Reference::getDesc("STSMHN", $model->status_mohon);
                                } else {
                                    return '';
                                }
                             },
                              'headerOptions' => ['style' => 'text-align:left;'],
                              'contentOptions' => ['style' => 'text-align:left;'],
                              'label' => 'Status'
                            ],   
                        ],
                    ]); ?>
                    <?php Pjax::end(); ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>