/**
  * 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 $id the ID of the model to be loaded
  * @return FamilyPlanningService the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = FamilyPlanningService::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
 public static function getTypeOfAcceptor()
 {
     $types = ZHtml::enumItem(FamilyPlanningService::model(), 'type_of_acceptor');
     $types[''] = '';
     asort($types);
     return $types;
 }
<script language="javascript">
    document.getElementById('menu_health').className = 'active';
    document.getElementById('menu_health_patients').className = 'active';
</script>
<?php 
/* @var $this PatientController */
/* @var $model Patient */
$this->breadcrumbs = array('Health', 'Patients' => array('index'), 'View Patient');
if (!ChildHealth::model()->findByAttributes(array('patient_id' => $model->id))) {
    echo CHtml::button("Create Child Health Record", array('submit' => array('childhealth/create', 'id' => $model->id), 'class' => 'btn btn-sm btn-primary'));
    echo "<br/>";
    echo "<br/>";
}
if (!FamilyPlanningService::model()->findByAttributes(array('patient_id' => $model->id))) {
    echo CHtml::button("Create Family Planning Service Record", array('submit' => array('familyplanningservice/create', 'id' => $model->id), 'class' => 'btn btn-sm btn-primary'));
    echo "<br/>";
    echo "<br/>";
}
echo CHtml::button("Create Maternal Health Record", array('submit' => array('maternalhealth/create', 'id' => $model->id), 'class' => 'btn btn-sm btn-primary'));
echo "<br/>";
echo "<br/>";
echo CHtml::button("Create NTP Laboratory Request", array('submit' => array('ntplaboratoryrequest/create', 'id' => $model->id), 'class' => 'btn btn-sm btn-primary'));
echo "<br/>";
echo "<br/>";
echo CHtml::button("Create NTP Treatment Card", array('submit' => array('ntptreatmentcard/create', 'id' => $model->id), 'class' => 'btn btn-sm btn-primary'));
echo "<br/>";
echo "<br/>";
?>

<div class="panel panel-primary">
    <div class="panel-heading">