| Current Path : /var/www/html/ekursus/frontend/views/application/ |
| Current File : /var/www/html/ekursus/frontend/views/application/_form3.php |
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use dosamigos\selectize\SelectizeDropDownList;
use dosamigos\selectize\SelectizeTextInput;
use yii\helpers\ArrayHelper;
use backend\models\Trainee;
use backend\models\Application;
use backend\models\course\Course;
use backend\models\contractor\Contractor;
use backend\models\timetable\Timetable;
use backend\models\reference\Reference;
use yii\db\Query;
//use \Date;
/* @var $this yii\web\View */
/* @var $model backend\models\Application */
/* @var $form yii\widgets\ActiveForm */
$this->registerJsFile("@web/js/bootstrap-colorpicker.min.js", ['depends' => [\yii\web\JqueryAsset::className()]]);
$this->registerJsFile('@web/js/chosen.jquery.js', ['depends' => [\yii\web\JqueryAsset::className()]]);
$this->registerCssFile("@web/css/bootstrap-colorpicker.min.css");
$this->registerCssFile('css/chosen.css');
$this->registerJs(
<<<JS
$(".chosen-select").chosen({no_results_text: "Maaf Tiada Data"});
JS
);
?>
<div class="content-calendar-form">
<div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox float-e-margins">
<div class="ibox-title">
<?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' => $timetable->id])->one();
$trainee = Trainee::find()->where(['kod_permohonan' => $application->id])->one();
$contractor = Contractor::find()->where(['no_spkk' => $application->no_spkk ])->one();
$reference = Reference::find()->where(['kod' => $timetable->kod_negeri ])->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><h4><b>NAMA KURSUS  : </b><?php echo strtoupper($course->keterangan) ?></h4></div>
<div><h4><b>TARIKH KURSUS : </b><?php echo $mula ?> <?php if ($mula == $tamat) { echo ''; } else { echo ' sehingga ' .$tamat;} ?></h4></div>
<div><h4><b>LOKASI     : </b><?php echo strtoupper($timetable->lokasi) ?></h4></div>
<div><h4><b>NEGERI     : </b><?php echo strtoupper($reference->keterangan) ?></h4></div>
<div><h4><b>MATA CCD    : </b><?php echo strtoupper($timetable->kod_ccd) ?></h4>
</div><br><br>
<div class="ibox-content">
<div class="content_calendar-form">
</div><b style="color:red">*** Sila masukkan Nombor PPK peserta untuk semakan</b>
<?php
$no_spkk = $_GET['no_spkk'];
$form = ActiveForm::begin([
'action' => ['check', 'kod_jadual' => $_GET['kod_jadual']],
'method' => 'get',
'options' => [
'data-pjax' => 1
],
]); ?>
<?= $form->field($model, 'no_spkk',['options'=>['class' => 'col-md-4']])->textInput(['placeholder'=> 'Nombor PPK'])->label(false) ?>
<div class="form-group">
<?= Html::submitButton('<i class="fa fa-search"></i> '.Yii::t('app', 'Cari'), ['class' => 'btn btn-primary']) ?>
<?= Html::a('<i class="fa fa-refresh"></i> '.Yii::t('app', 'Set Semula'), ['check', 'kod_jadual' => $_GET['kod_jadual']], ['class' => 'btn btn-warning']) ?>
</div>
<?= GridView::widget([
'dataProvider' => $dataProvider,
// 'filterModel' => $searchModel,
'tableOptions' =>
[
'class' => 'table table-hover table-bordered',
],
'summary' => '',
'columns' => [
['class' => 'yii\grid\SerialColumn'],
[
'attribute' => 'no_spkk',
'headerOptions' => ['style' => 'text-align:center;'],
'contentOptions' => ['style' => 'text-align:left;'],
'value' => 'no_spkk',
],
[
'attribute' => 'nama_sykt',
'headerOptions' => ['style' => 'text-align:center;'],
'contentOptions' => ['style' => 'text-align:left;'],
'value' => 'nama_sykt',
],
],
]); ?>
<?php ActiveForm::end(); ?>
</div>
</div>
</div>
</div>
</div>
<script>
function checkSpkk(){
var spkk_check;
// Get the value of the no spkk input field
var input_value = document.getElementById('register-email').value;
// Send the value to a PHP page to check
$.ajax({
url: 'checkspkk.php/',
type: 'POST',
data: {
spkk_check: input_value
},
success: function(response) {
// If we have a repsonse we need to check whether it is True or False
spkk_check = response;
if (spkk_check == 1) {
// If True add error class
$('.field-register-email').addClass('has-error');
$('.field-register-email .help-block').text('Nombor SPKK ini telah berdaftar dengan sistem eKursus');
} else {
$('.field-register-email').removeClass('has-error');
$('.field-register-email .help-block').text(' ');
}
}
});
};
</script>