public function actionFinal_view($id)
 {
     $emp_doc = new EmployeeDocsTrans('mysearch');
     $emp_doc->unsetAttributes();
     // clear any default values
     if (isset($_GET['EmployeeDocsTrans'])) {
         $emp_doc->attributes = $_GET['EmployeeDocsTrans'];
     }
     $emp_exp = new EmployeeExperienceTrans('mysearch');
     $emp_exp->unsetAttributes();
     // clear any default values
     if (isset($_GET['EmployeeExperienceTrans'])) {
         $emp_exp->attributes = $_GET['EmployeeDocsTrans'];
     }
     $emp_record = new EmployeeAcademicRecordTrans('mysearch');
     $emp_record->unsetAttributes();
     // clear any default values
     if (isset($_GET['EmployeeAcademicRecordTrans'])) {
         $emp_record->attributes = $_GET['EmployeeAcademicRecordTrans'];
     }
     $this->render('final_view', array('model' => $this->loadModel($id), 'emp_doc' => $emp_doc, 'emp_exp' => $emp_exp, 'emp_record' => $emp_record));
 }
 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);
 }
 /**
  * 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);
		
		
		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);	              
	}
	/**
	* This action is used to display the employee Experience in the employee profile.
	*/
	public function actionEmployeeExperience()
	{
		$emp_exp=new EmployeeExperienceTrans('mysearch');
		
		$emp_certificate = new EmployeeCertificateDetailsTable;
		$emp_doc=new EmployeeDocsTrans;
		$emp_record=new EmployeeAcademicRecordTrans;
		$model=EmployeeTransaction::model()->resetScope()->findByPk($_REQUEST['id']);
		$info = EmployeeInfo::model()->findByPk($model->employee_transaction_employee_id);
		$photo = EmployeePhotos::model()->findByPk($model->employee_transaction_emp_photos_id);
		$lang = LanguagesKnown::model()->findByPk($model->employee_transaction_languages_known_id);
		$address = EmployeeAddress::model()->findByPk($model->employee_transaction_emp_address_id);
		
		$emp_exp->unsetAttributes();  // clear any default values
		if(isset($_GET['EmployeeExperienceTrans']))
			$emp_exp->attributes=$_GET['EmployeeExperienceTrans'];

		$this->render('/employeeExperienceTrans/employeeexperience',array(
			'model'=>$model,'info'=>$info,'photo'=>$photo,'address'=>$address,'lang'=>$lang,'emp_doc'=>$emp_doc,'emp_record'=>$emp_record,'employeeexperience'=>$emp_exp,'flag'=>1,'emp_certificate'=>$emp_certificate
		));
	}