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/pdf_amaranhq.php

<?php

use yii\helpers\Html;
use backend\models\TemplatSurat;
use backend\models\course\Course;
use backend\models\timetable\Timetable;
use backend\models\Application;
use backend\models\Trainee;
use backend\models\contractorstaff\ContractorStaff;
use backend\models\contractor\Contractor;
use backend\models\reference\Reference;
?>

<div class="templat-surat-view">

<div class="content-announcement-index">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="ibox float-e-margins">
            <div class="ibox-content">
                <div class="table-responsive">
                    <?php  
                           $trainee = Trainee::find()->where(['kod_permohonan' => $_GET['kod_permohonan']])->one();
                           $application = Application::find()->where(['id' => $_GET['kod_permohonan']])->one();
                           $timetable = Timetable::find()->where(['id' => $application->kod_jadual, 'kod_negeri' => 'HQ'])->one();
                           $contractorstaff = ContractorStaff::find()->where(['no_kp' => $_GET['no_kp']])->one();
                           $course = Course::find()->where(['kod' => $timetable->kod_kursus])->one();
                           $contractor = Contractor::find()->where(['no_spkk' => $application->no_spkk])->one();
                           $reference = Reference::find()->where(['kat' => 'NEG', 'kod' => $timetable->kod_negeri])->one();
                           $contractor_kod_negeri = Reference::find()->where(['kat' => 'NEG','kod' => $contractor->kod_negeri])->one();
                           $contractor_kod_bandar = Reference::find()->where(['kat' => 'BDR', 'kod' => $contractor->kod_bandar])->one();
                          
                           $format_surat = TemplatSurat::find()->where(['templat_surat_id' => 10])->one();
                           $content_amaran = $format_surat->kandungan;  

                           $content_amaran = str_replace("#nama_kursus", strtoupper($course->keterangan) , $content_amaran);
                           $content_amaran = str_replace("#nama_peserta", strtoupper($trainee->nama_peserta) , $content_amaran);
                           $content_amaran = str_replace("#no_kp", $trainee->no_kp , $content_amaran);
                           $content_amaran = str_replace("#surat_rujukan", $trainee->surat_rujukan , $content_amaran);
                           $content_amaran = str_replace("#no_spkk", strtoupper($application->no_spkk), $content_amaran);
                           $content_amaran = str_replace("#tarikh_mohon", date("d-m-Y", strtotime($application->tkh_mohon)), $content_amaran);
                           $content_amaran = str_replace("#lokasi", $timetable->lokasi, $content_amaran);
                           $content_amaran = str_replace("#masa_mula", date("h:i a", strtotime($timetable->masa_mula)), $content_amaran);
                           $content_amaran = str_replace("#masa_tamat", date("h:i a", strtotime($timetable->masa_tamat)), $content_amaran);
                           $content_amaran = str_replace("#tarikh_kursus", date("d-m-Y", strtotime($timetable->tkh_kursus)), $content_amaran);
                           $content_amaran = str_replace("#sebab", $application->sebab, $content_amaran);

                          // $content_amaran = str_replace("#tarikh_kursus", Yii::$app->formatter->asDate($timetable->tkh_kursus, 'd-M-Y', $content_amaran));

                           $content_amaran = str_replace("#negeri_kursus", ucwords($reference->keterangan), $content_amaran);
                           $content_amaran = str_replace("#no_tel", $reference->param2, $content_amaran);
                           $content_amaran = str_replace("#no_faks", $reference->param3, $content_amaran);
                           // $content_amaran = str_replace("#tarikh_kursus", Yii::$app->formatter->asDate((new \DateTime($timetable->tkh_kursus))->format('d-m-Y'), 'long'), $content_amaran);
                           $content_amaran = str_replace("#kod_ccd", $timetable->kod_ccd, $content_amaran);
                           $content_amaran = str_replace("#nama_syarikat", $contractor->nama_sykt, $content_amaran);
                           $content_amaran = str_replace("#alamat_syarikat", $contractor->alamat_sykt, $content_amaran);
                           $content_amaran = str_replace("#alamatsatu", strtoupper($contractor->alamat_sykt_1), $content_amaran);
                           $content_amaran = str_replace("#alamatdua", strtoupper($contractor->alamat_sykt_2), $content_amaran);
                           $content_amaran = str_replace("#poskod", $contractor->poskod, $content_amaran);
                           $content_amaran = str_replace("#contractor_neg", strtoupper($contractor_kod_negeri->keterangan), $content_amaran);
                           $content_amaran = str_replace("#contractor_bdr", strtoupper($contractor_kod_bandar->keterangan), $content_amaran);

                           echo $content_amaran;
                          ?>
                   
                </div>
            </div>
        </div>
    </div>
</div>

</div>