Esempio n. 1
0
        
      <tr>
        <td valign="top">
        
        
        <?php 
#$page_list = array();
if (!empty($page_list)) {
    echo "<table width='100%' border='0' cellspacing='0' cellpadding='5'>\r\r\n        <tr>\r\r\n        <td class='listheader' width='1%'>&nbsp;</td>\r\r\n        <td class='listheader' nowrap>Date</td>\r\r\n        <td class='listheader' nowrap>Account</td>\r\r\n        <td class='listheader' nowrap>Details</td>\r\r\n        <td class='listheader' align='right' nowrap>Debit</td>\r\r\n        <td class='listheader' align='right' nowrap>Credit</td>\r\r\n        <td class='listheader' align='right' nowrap>Balance</td>\r\r\n        </tr>";
    $counter = 0;
    $total_debit = 0;
    $total_credit = 0;
    $balance = 0;
    foreach ($page_list as $row) {
        #Get the account title
        $account_info = get_db_object_details($this, 'accounts', $row['account']);
        #total debit
        if ($row['cr_dr'] == 'CR') {
            $total_credit += $row['amount'];
        }
        #total credit
        if ($row['cr_dr'] == 'DR') {
            $total_debit += $row['amount'];
        }
        $balance = $total_credit - $total_debit;
        #Show one row at a time
        echo "<tr class='listrow' style='" . get_row_color($counter, 2) . "'>\r\r\n    <td class='leftListCell rightListCell' valign='top' nowrap>";
        #if(check_user_access($this,'delete_deal')){
        echo "<a href='javascript:void(0)' onclick=\"confirmDeleteEntity('" . base_url() . "finances/delete_transaction/i/" . encryptValue($row['transid']) . "', 'Are you sure you want to remove this fee? \\nThis operation can not be undone. \\nClick OK to confirm, \\nCancel to cancel this operation and stay on this page.');\" title=\"Click to remove this fee.\"><img src='" . base_url() . "images/delete.png' border='0'/></a>";
        #}
        #if(check_user_access($this,'update_deals')){
Esempio n. 2
0
 function save_student_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', 'a', 't'));
     # Pick all assigned data
     $data = assign_to_data($urldata);
     if ($data['save']) {
         $data['formdata'] = $data;
         $required_fields = array('student', 'sponsor');
         foreach ($data as $key => $data_value) {
             $data[$key] = restore_bad_chars($data_value);
         }
         $_POST = clean_form_data($data);
         $validation_results = validate_form('', $_POST, $required_fields);
         #get the student info
         $data['student_info'] = get_db_object_details($this, 'students', decryptValue($data['m']));
         #Only proceed if the validation for required fields passes
         if ($validation_results['bool']) {
             if (!empty($data['editid'])) {
                 $result = $this->sponsorobj->update_student_sponsor(array_merge($_POST, array('id' => $data['editid'])));
             } else {
                 #check if the sponsorship details already exist
                 $sponsorship_count = count($this->db->query($this->Query_reader->get_query_by_code('student_sponsors', array('orderby' => 'sponsorlastname', 'limittext' => '', 'searchstring' => ' AND sponsor=' . $_POST['sponsor'] . ' AND sponsors.isactive="Y" AND student =' . decryptValue($_POST['student']))))->result_array());
                 if (!$sponsorship_count) {
                     #Add the school id and author to the data array
                     $_POST['student'] = decryptValue($_POST['student']);
                     $_POST = array_merge($_POST, array('author' => $this->session->userdata('userid')));
                     $result = $this->sponsorobj->add_student_sponsor($_POST);
                 }
             }
             #Format and send the errors
             if (!empty($result) && $result) {
                 $data['msg'] = empty($data['editid']) ? 'The sponsorship details have been saved ' : 'The sponsorship details have been updated.';
                 $data['formdata'] = array();
             } else {
                 if (empty($data['msg'])) {
                     $formdata = $data;
                     $data['msg'] = "ERROR: The sponsorship details could not be saved or was not saved correctly." . ($sponsorship_count ? "<br />The sponsor has already been added to " . $data['student_info']['firstname'] . '\'s sponsors.' : '');
                 }
             }
         }
         $data['requiredfields'] = $validation_results['requiredfields'];
     }
     #get the sponsors
     $data['sponsors'] = $this->sponsorobj->get_sponsors();
     $this->load->view('students/add_sponsor_form_view', $data);
 }
Esempio n. 3
0
 function manage_student_sponsors()
 {
     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);
     $data['student_info'] = get_db_object_details($this, 'students', decryptValue($data['i']));
     #Get the paginated list of the students
     $data = paginate_list($this, $data, 'student_sponsors', array('searchstring' => ' AND students.id=' . decryptValue($data['i']), 'orderby' => 'fromdate DESC', 'student' => decryptValue($data['i'])));
     $data = add_msg_if_any($this, $data);
     $this->load->view('students/manage_student_sponsors_view', $data);
 }
 $reportid = $xml->createElement("reportid");
 $report->appendChild($reportid);
 $data['registration_data'] = $registration_data = $this->Query_reader->get_row_as_array('search_register', array('limittext' => '', 'searchstring' => 'student=' . $studentid . ' AND term ="' . $termid . '"'));
 $termdetails = $this->Query_reader->get_row_as_array('search_terms_list', array('isactive' => 'Y', 'limittext' => '', 'searchstring' => ' AND id = ' . $termid));
 // Registration
 $registration_data = $registration_data = $this->Query_reader->get_row_as_array('search_register', array('limittext' => '', 'searchstring' => 'student=' . $studentid . ' AND term ="' . $termid . '"'));
 if (!empty($registration_data)) {
     $exams = $this->db->query($this->Query_reader->get_query_by_code('search_exams', array('limittext' => '', 'searchstring' => ' AND classes like "%' . $registration_data['class'] . '%" AND term ="' . $termid . '" AND isactive="Y"')))->result_array();
     //get the subject details
     $subject_arr = remove_empty_indices(explode('|', $registration_data['subjects']));
     #print_r($registration_data);
     #exit();
     if (!empty($subject_arr)) {
         $subjects = $this->db->query($this->Query_reader->get_query_by_code('search_subjects', array('limittext' => '', 'searchstring' => ' AND id IN (' . implode(',', $subject_arr) . ')', 'isactive' => 'Y')))->result_array();
         // Class Details
         $classdetails = get_db_object_details($this, 'classes', $registration_data['class']);
     }
 }
 #head information ::
 #create head element
 $head = $xml->createElement("head");
 $report->appendChild($head);
 # head element children::
 $logo1 = $xml->createElement("logo1");
 //logourl
 $thim = explode('.', $schoolid['logourl']);
 #explode('.',$schoolid['logourl']);
 $thumm = $thim[0] . '_thumb.' . $thim[1];
 #$thim[0].'_thumb.'.$thim[1];
 $titleText = $xml->createTextNode('../downloads/schools/' . $thumm);
 $logo1->appendChild($titleText);
Esempio n. 5
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);
 }
Esempio n. 6
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);
 }