public function actionPrintrincian($id)
 {
     $model = $this->loadModel($id);
     if (isset($_REQUEST['PenggajianT'])) {
         $model->attributes = $_REQUEST['PenggajianT'];
     }
     $judulLaporan = 'Laporan Rincian Gaji';
     $caraPrint = $_REQUEST['caraPrint'];
     $data = '';
     if ($caraPrint == 'PRINT') {
         $this->layout = '//layouts/printWindows';
         $this->render('Printrincian', array('model' => $model, 'judulLaporan' => $judulLaporan, 'caraPrint' => $caraPrint));
     } else {
         if ($caraPrint == 'EXCEL') {
             $this->layout = '//layouts/printExcel';
             $this->render('Printrincian', array('model' => $model, 'judulLaporan' => $judulLaporan, 'caraPrint' => $caraPrint));
         } else {
             if ($_REQUEST['caraPrint'] == 'PDF') {
                 $ukuranKertasPDF = Yii::app()->session['ukuran_kertas'];
                 // Ukuran Kertas Pdf
                 $posisi = Yii::app()->session['posisi_kertas'];
                 // Posisi L->Landscape,P->Portait
                 $mpdf = new MyPDF('', $ukuranKertasPDF);
                 $styletable = file_get_contents(Yii::getPathOfAlias('webroot.css.core') . '/table.css');
                 $styleform = file_get_contents(Yii::getPathOfAlias('webroot.css.core') . '/form.css');
                 $stylesheet = file_get_contents(Yii::getPathOfAlias('webroot.css') . '/mws.style.css');
                 $mpdf->useOddEven = 2;
                 $mpdf->writeHtml($styletable, 1);
                 $mpdf->WriteHTML($stylesheet, 1);
                 $mpdf->WriteHTML($styleform, 1);
                 $mpdf->AddPage($posisi, '', '', '', '', 15, 15, 15, 15, 15, 15);
                 $mpdf->WriteHTML($this->renderPartial('Printrincian', array('model' => $model, 'judulLaporan' => $judulLaporan, 'caraPrint' => $caraPrint), true));
                 $mpdf->Output();
             }
         }
     }
 }
 public function actionPrintsuratperingatan()
 {
     $model = new KSuratperingatanR();
     $model->nosuratperingatan = $_GET['KSuratperingatanR']['nosuratperingatan'];
     $model->karyawan_id = $_GET['id'];
     $modSurel = new KSuratelektronikR();
     $modSurel->jenissurat_id = $_GET['KJenissuratM']['jenissurat_id'];
     $judulLaporan = 'Surat Peringatan';
     $caraPrint = $_REQUEST['caraPrint'];
     if ($caraPrint == 'PRINT') {
         $this->layout = '//layouts/printWindows';
         $this->render('PrintSp', array('model' => $model, 'judulLaporan' => $judulLaporan, 'caraPrint' => $caraPrint));
     } else {
         if ($caraPrint == 'EXCEL') {
             $this->layout = '//layouts/printExcel';
             $this->render('PrintSp', array('model' => $model, 'judulLaporan' => $judulLaporan, 'caraPrint' => $caraPrint));
         } else {
             if ($_REQUEST['caraPrint'] == 'PDF') {
                 $ukuranKertasPDF = Yii::app()->session['ukuran_kertas'];
                 // Ukuran Kertas Pdf
                 $posisi = Yii::app()->session['posisi_kertas'];
                 // Posisi L->Landscape,P->Portait
                 $mpdf = new MyPDF('', $ukuranKertasPDF);
                 $mpdf->useOddEven = 2;
                 $styletable = file_get_contents(Yii::getPathOfAlias('webroot.css.core') . '/table.css');
                 $stylesheet = file_get_contents(Yii::getPathOfAlias('webroot.css') . '/mws.style.css');
                 $mpdf->writeHtml($styletable, 1);
                 $mpdf->WriteHTML($stylesheet, 1);
                 $mpdf->AddPage($posisi, '', '', '', '', 15, 15, 15, 15, 15, 15);
                 $mpdf->WriteHTML($this->renderPartial('PrintSp', array('model' => $model, 'judulLaporan' => $judulLaporan, 'caraPrint' => $caraPrint), true));
                 $mpdf->Output();
             }
         }
     }
 }