/**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Qualifications();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Qualifications'])) {
         $model->attributes = $_POST['Qualifications'];
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->idQualification));
         }
     }
     $this->render('create', array('model' => $model));
 }
    $qualification->name_of_institutions = $_POST[$name_of_insti];
    $qualification->from_year = $_POST[$from];
    $qualification->to_year = $_POST[$to];
    $qualification->certificate_qualification_name = $_POST[$certificate];
    $qualification->grade = $_POST[$grade];
    if ($qualification->name_of_institutions == '') {
        continue;
    }
    /*obatin applicant id from session*/
    $qualification->applicant_id = $session->applicant_id;
    /*obtain $_POST[$high_id] if it is set and not empty*/
    if (isset($_POST[$qual_id]) && !empty($_POST[$qual_id])) {
        $qualification->other_qualifications_id = $_POST[$qual_id];
    }
    /*insert new record or update existing record in the Other Relevant Qualifications table*/
    if (!$qualification->save()) {
        $error_other_relevant_qualification = true;
    }
    $qualification->other_qualifications_id = null;
}
/*Update Secondary School Attended*/
$school = new SecondarySchoolUser();
$school->db_fields = array('school_id', 'applicant_id', 'school_name', 'school_address', 'from_year', 'to_year');
/*loop for number of Secondary School rows*/
for ($k = 1; $k < $_POST['num_of_sec_school_rows']; $k++) {
    /*keys for post values*/
    $name = "secondary_school_name_" . $k;
    $address = "secondary_school_address_" . $k;
    $from_y = "secondary_school_from_" . $k;
    $to_y = "secondary_school_to_" . $k;
    $sch_id = 'sch_id_' . $k;