Beispiel #1
0
 function delete_staff()
 {
     access_control($this);
     # Get the passed details into the url data array if any
     $urldata = $this->uri->uri_to_assoc(3, array('m', 'i', 't'));
     # Pick all assigned data
     $data = assign_to_data($urldata);
     if (!empty($data['i'])) {
         $result = deactivate_row($this, 'schoolusers', decryptValue($data['i']));
     }
     if (!empty($result) && $result) {
         $data['msg'] = "The user data has been successfully deleted.";
     } else {
         if (empty($data['msg'])) {
             $data['msg'] = "ERROR: The user could not be deleted or was not deleted correctly.";
         }
     }
     if (!empty($data['t']) && $data['t'] == 'super') {
         $tstr = "/t/super";
     } else {
         $tstr = "";
     }
 }
Beispiel #2
0
 function delete_student()
 {
     access_control($this);
     # Get the passed details into the url data array if any
     $urldata = $this->uri->uri_to_assoc(3, array('m', 'i'));
     # Pick all assigned data
     $data = assign_to_data($urldata);
     if (!empty($data['i'])) {
         $result = deactivate_row($this, 'students', decryptValue($data['i']));
     }
     #Prepare appropriate message
     $msg = !empty($result) && $result ? "The student data has been removed." : "ERROR: The student data could not be removed.";
     $this->session->set_userdata('sres', $msg);
     redirect(base_url() . "students/manage_students/m/sres");
 }
Beispiel #3
0
 function delete_mark()
 {
     access_control($this);
     # Get the passed details into the url data array if any
     $urldata = $this->uri->uri_to_assoc(3, array('m', 'i', 't'));
     # Pick all assigned data
     $data = assign_to_data($urldata);
     $paper_details = get_db_object_details($this, 'subjectpapers', decryptValue($data['i']));
     if (!empty($data['i'])) {
         $result = deactivate_row($this, 'subjectpapers', decryptValue($data['i']));
     }
     if (!empty($result) && $result) {
         $data['msg'] = $paper_details['paper'] . " has has been removed.";
     } else {
         if (empty($data['msg'])) {
             $data['msg'] = "ERROR: The paper could not be deleted or was not deleted correctly.";
         }
     }
     $data['papers'] = $this->db->query($this->Query_reader->get_query_by_code('search_papers', array('isactive' => 'Y', 'limittext' => '', 'searchstring' => ' AND subject = ' . $paper_details['subject'])))->result_array();
     $data['area'] = 'subject_papers';
     $this->load->view('incl/addons', $data);
 }
Beispiel #4
0
 function delete_sponsor()
 {
     access_control($this);
     # Get the passed details into the url data array if any
     $urldata = $this->uri->uri_to_assoc(3, array('m', 'i', 't'));
     # Pick all assigned data
     $data = assign_to_data($urldata);
     if (!empty($data['i'])) {
         $result = deactivate_row($this, 'exams', decryptValue($data['i']));
     }
     if (!empty($result) && $result) {
         $this->session->set_userdata('dexam', "The exam data has been successfully deleted.");
     } else {
         if (empty($data['msg'])) {
             $this->session->set_userdata('dexam', "ERROR: The exam could not be deleted or was not deleted correctly.");
         }
     }
     if (!empty($data['t']) && $data['t'] == 'super') {
         $tstr = "/t/super";
     } else {
         $tstr = "";
     }
     redirect("sponsors/manage_exams/m/dexam" . $tstr);
 }
Beispiel #5
0
 function delete_subject()
 {
     access_control($this);
     # Get the passed details into the url data array if any
     $urldata = $this->uri->uri_to_assoc(3, array('m', 'i', 't'));
     # Pick all assigned data
     $data = assign_to_data($urldata);
     $subject_details = get_db_object_details($this, 'subjects', decryptValue($data['i']));
     if (!empty($data['i'])) {
         $result = deactivate_row($this, 'subjects', decryptValue($data['i']));
     }
     if (!empty($result) && $result) {
         $this->session->set_userdata('dsubject', $subject_details['subject'] . " has has been removed from the curriculum.");
         #Delete the papers as well
         $delete_papers_str = "UPDATE subjectpapers SET isactive = 'N' WHERE subject ='" . decryptValue($data['i']) . "'";
         $papers_result = $this->db->query($delete_papers_str);
     } else {
         if (empty($data['msg'])) {
             $this->session->set_userdata('dsubject', "ERROR: The subject could not be deleted or was not deleted correctly.");
         }
     }
     if (!empty($data['t']) && $data['t'] == 'super') {
         $tstr = "/t/super";
     } else {
         $tstr = "";
     }
     redirect("curriculum/manage_subjects/m/dsubject" . $tstr);
 }