public function actionKontrakKerja($id) { $this->layout = '//layouts/column2'; $this->setUserMenu(); $indexTab = 4; $kontrakkerja = KKontrakkaryawanR::model()->findByAttributes(array('karyawan_id' => $id)); $this->render('_formKontrakKerja', array('id' => $id, 'indexTab' => $indexTab, 'kontrakkerja' => $kontrakkerja)); }
public function actionPrintKontrak($idKontrak, $idSurel) { $judulLaporan = 'Surat_Kontrak'; $model = KKontrakkaryawanR::model()->findByPk($idKontrak); $modSurel = KSuratelektronikR::model()->findByPk($idSurel); if (isset($_POST["PRINT"])) { $this->layout = '//layouts/printWindows'; $this->render('PrintKontrak', array('model' => $model, 'judulLaporan' => $judulLaporan, 'caraPrint' => $caraPrint)); } else { if (isset($_POST["EXCEL"])) { $this->layout = '//layouts/printExcel'; $this->render('PrintKontrak', array('model' => $model, 'judulLaporan' => $judulLaporan, 'caraPrint' => $caraPrint)); } else { if (isset($_POST["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; $mpdf->WriteHTML($stylesheet, 1); $mpdf->AddPage($posisi, '', '', '', '', 15, 15, 15, 15, 15, 15); $mpdf->WriteHTML($this->renderPartial('PrintKontrak', array('modSurel' => $modSurel, 'model' => $model, 'judulLaporan' => $judulLaporan, 'caraPrint' => $caraPrint), true)); $mpdf->Output(); } } } }