/** * 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=EmployeeCertificateDetailsTable::model()->findByPk($id); if($model===null) throw new CHttpException(404,'The requested page does not exist.'); return $model; }
</tr> <?php }// end for loop ?> </table> <?php } else echo "No document available"; ?> </br></br> <h4 class="title">Certificates</h4> <?php $k=0; $certificate = EmployeeCertificateDetailsTable::model()->findAll("employee_certificate_details_table_emp_id=".$_REQUEST['id']); if ($certificate != null){ ?> <table style="font-size:125%;"> <tr> <th> SN. </th> <th width="70px"> Certificate Type </th> </tr> <?php
/** * This action is used to display the employee Certificates in the employee profile. */ public function actionEmployeeCertificates() { $emp_certificate = new EmployeeCertificateDetailsTable('Employeesearch'); $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); $emp_exp = new EmployeeExperienceTrans; $address = EmployeeAddress::model()->findByPk($model->employee_transaction_emp_address_id); $emp_certificate->unsetAttributes(); // clear any default values if(isset($_GET['EmployeeCertificateDetailsTable'])) $emp_certificate->attributes=$_GET['EmployeeCertificateDetailsTable']; $this->render('update',array( 'model'=>$model,'info'=>$info,'photo'=>$photo,'address'=>$address,'lang'=>$lang,'emp_doc'=>$emp_doc,'emp_record'=>$emp_record,'emp_exp'=>$emp_exp,'flag'=>1,'emp_certificate'=>$emp_certificate )); }
public function actionSaveEmployeeCertificatedata() { $emp_certificate = new EmployeeCertificateDetailsTable(); $emp_transaction_id = $_REQUEST['emp_id']; $ctype = $_REQUEST['ctype']; $emp_certificate->employee_certificate_details_table_emp_id = $emp_transaction_id; $emp_certificate->employee_certificate_type_id = $ctype; $emp_certificate->employee_certificate_creation_date = new CDbExpression('NOW()'); $emp_certificate->employee_certificate_created_by = Yii::app()->user->id; $emp_certificate->employee_certificate_org_id = yii::app()->user->getState('org_id'); $emp_certificate->save(); $this->redirect(array('/employee/employeeCertificateDetailsTable/admin')); }