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_sijil.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])->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(['kod' => $timetable->kod_negeri])->one();
                           $contractor_kod_negeri = Reference::find()->where(['kod' => $contractor->kod_negeri])->one();
                           $contractor_kod_bandar = Reference::find()->where(['kod' => $contractor->kod_bandar])->one();
                          
                           $format_surat = TemplatSurat::find()->where(['templat_surat_id' => 2])->one();
                           $content_surat = $format_surat->kandungan;  

                           $content_surat = str_replace("#nama_kursus", strtoupper($course->keterangan) , $content_surat);
                           $content_surat = str_replace("#nama_peserta", strtoupper($trainee->nama_peserta) , $content_surat);
                           $content_surat = str_replace("#no_kp", $trainee->no_kp , $content_surat);
                           $content_surat = str_replace("#no_spkk", strtoupper($application->no_spkk), $content_surat);
                           $content_surat = str_replace("#lokasi", strtoupper($timetable->lokasi), $content_surat);
                           $content_surat = str_replace("#tarikh_kursus", date("d-m-Y", strtotime($timetable->tkh_kursus)), $content_surat);
                           $content_surat = str_replace("#tahun", date("Y", strtotime($timetable->tkh_kursus)), $content_surat);
                           $content_surat = str_replace("#neg", strtoupper($reference->param1), $content_surat);
                           $content_surat = str_replace("#no_siri", str_pad($application->no_siri_sijil, 4, "0", STR_PAD_LEFT), $content_surat);
                           // $content_surat = str_replace("#tarikh_kursus", Yii::$app->formatter->asDate((new \DateTime($timetable->tkh_kursus))->format('d-m-Y'), 'long'), $content_surat);
                           $content_surat = str_replace("#kod_ccd", $timetable->kod_ccd, $content_surat);
                           $content_surat = str_replace("#nama_syarikat", $contractor->nama_sykt, $content_surat);
                           $content_surat = str_replace("#alamat_syarikat", strtoupper($contractor->alamat_sykt), $content_surat);
                           $content_surat = str_replace("#alamatsatu", strtoupper($contractor->alamat_sykt_1), $content_surat);
                           $content_surat = str_replace("#alamatdua", strtoupper($contractor->alamat_sykt_2), $content_surat);
                           $content_surat = str_replace("#poskod", $contractor->poskod, $content_surat);
                           $content_surat = str_replace("#contractor_neg", strtoupper($contractor_kod_negeri->keterangan), $content_surat);
                           $content_surat = str_replace("#contractor_bdr", strtoupper($contractor_kod_bandar->keterangan), $content_surat);

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

</div>