Esempio n. 1
0
 		</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 
	/**
	 * 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;
	}
 /**
  * Deletes a particular model.
  * If deletion is successful, the browser will be redirected to the 'admin' page.
  * @param integer $id the ID of the model to be deleted
  */
 public function actionDelete($id)
 {
     $stud_certificate = StudentCertificateDetailsTable::model()->findByAttributes(array('student_certificate_type_id' => $id));
     $emp_certificate = EmployeeCertificateDetailsTable::model()->findByAttributes(array('employee_certificate_type_id' => $id));
     if (!empty($stud_certificate) || !empty($emp_certificate)) {
         throw new CHttpException(400, 'You can not delete this record because it is used in another table.');
     } else {
         // we only allow deletion via POST request
         $this->loadModel($id)->delete();
     }
     // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
     if (!isset($_GET['ajax'])) {
         $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));
     }
 }