/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer the ID of the model to be loaded */ public function loadModel($id) { $model = EmployeeExperienceTrans::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
public function actionEmployeeFinalViewExportToPdf($id) { $employee_transaction = EmployeeTransaction::model()->findAll(' employee_transaction_id=' . $id); $employee_docs = EmployeeDocsTrans::model()->findAll('employee_docs_trans_user_id=' . $id); $employee_qual = EmployeeAcademicRecordTrans::model()->findAll('employee_academic_record_trans_user_id=' . $id); $employee_exp = EmployeeExperienceTrans::model()->findAll('employee_experience_trans_user_id=' . $id); $html = $this->renderPartial('/employeeTransaction/employeeFinalView', array('employee_docs' => $employee_docs, 'employee_qual' => $employee_qual, 'employee_transaction' => $employee_transaction, 'emp_exp' => $employee_exp), true); $this->exporttopdf('Employee Report', 'Employee.pdf', $html); }
public function actionEmployeeFinalViewExportToPdf($id) { $employee_transaction = EmployeeTransaction::model()->findAll('employee_transaction_id='.$id); $employee_docs = EmployeeDocsTrans::model()->findAll('employee_docs_trans_user_id='.$id); $employee_qual = EmployeeAcademicRecordTrans::model()->findAll('employee_academic_record_trans_user_id='.$id); $employee_exp = EmployeeExperienceTrans::model()->findAll('employee_experience_trans_user_id='.$id); $html = $this->renderPartial('/employeeTransaction/employeeFinalView', array( 'employee_docs'=>$employee_docs, 'employee_qual'=>$employee_qual, 'employee_transaction'=>$employee_transaction, 'emp_exp'=>$employee_exp, ), true); ob_clean(); //$pdf = new TCPDF(); //$pdf->SetCreator(PDF_CREATOR); //$pdf->SetAuthor(Yii::app()->name); //$pdf->SetTitle($title); //$pdf->SetSubject($title); //$pdf->SetKeywords('example, text, report'); //$pdf->SetHeaderData('', 0, $title, ''); //$pdf->setHeaderFont(Array('helvetica', '', 8)); //$pdf->setFooterFont(Array('helvetica', '', 6)); //$pdf->SetMargins(15, 18, 15); //$pdf->SetHeaderMargin(5); //$pdf->SetFooterMargin(10); //$pdf->SetAutoPageBreak(TRUE, 15); //$pdf->SetFont('dejavusans', '', 7); //$resolution= array(150, 150); //$pdf->AddPage('P', $resolution); $html = '<style> table, th, td { border : 1px solid #000;} th {text-align: center;}</style>'.$html; //$pdf->writeHTML($html, true, false, true, false, ''); //$pdf->LastPage(); //$pdf->Output($filename, "I"); $this->exporttopdf('Employee Report','Employee.pdf',$html); }