public function curriculum_settings_add_subject()
 {
     if ($this->input->post(sha1("addsubject"))) {
         $this->form_validation->set_rules("subjectCode", "Subject Code", "trim|required|xss_xlean");
         $this->form_validation->set_rules("subjectDescription", "Subject Description", "trim|required|xss_xlean");
         if ($this->form_validation->run() == false) {
             if (form_error("subjectCode")) {
                 set_has_error("subjectCode", true);
                 set_message("subjectCode", form_error("subjectCode", " ", " "));
             }
             if (form_error("subjectDescription")) {
                 set_has_error("subjectDescription", true);
                 set_message("subjectDescription", form_error("subjectDescription", " ", " "));
             }
         } else {
             $new_subject_code = $this->input->post("subjectCode");
             $new_subject_description = $this->input->post("subjectDescription");
             if (is_subject_exist(false, $new_subject_code)) {
                 set_has_error("subjectCode", true);
                 set_message("subjectCode", "subject code already exists.");
             } else {
                 $new_subjectinfo = new Subject_Model();
                 $new_subjectinfo->setSubjectcode($new_subject_code);
                 $new_subjectinfo->setSubjectdescription($new_subject_description);
                 if ($new_subjectinfo->saveAsnew()) {
                     redirect("dashboard/curriculums/settings/subjects");
                 }
             }
         }
     }
     $this->load->view("management/dashboard/curriculums/settings/subjects/add/view", $this->data);
 }