if (!empty($page_list)) { echo "<table class='datatable' width='100%' border='0' cellspacing='0' cellpadding='5'>\r\r\n \t<tr>\r\r\n\t\t\t<td class='listheader' width='1%'> </td>\r\r\n \t<td class='listheader' nowrap>Student <a class='fancybox fancybox.ajax' href='" . base_url() . "students/load_student_form' title='Click to add a student'><img src='" . base_url() . "images/add_item.png' border='0'/></a></td>\r\r\n\t\t\t<td class='listheader' nowrap>Sponsor</td>\r\r\n\t\t\t<td class='listheader' nowrap>Student No</td>\r\r\n \t<td class='listheader' nowrap>Age</td>" . ($view_leave ? "<td class='listheader' nowrap>Current Class</td>" . "<td class='listheader' nowrap>Leaves taken</td></tr>" : "<td class='listheader' nowrap>Admission Class</td>\r\r\n\t\t\t<td class='listheader' nowrap>Current Class</td>\r\r\n\t\t\t<td class='listheader' nowrap>Date Added</td>\r\r\n\t\t\t</tr>"); $counter = 0; $current_student = 0; #check if user has delete rights $delete_students = check_user_access($this, 'delete_students'); foreach ($page_list as $row) { #Show one row at a time #Get the admission term title and year if (!$view_leave) { $admitterminfo = get_term_name_year($this, $row['admissionterm']); #Get the admission class $admitclass = get_class_title($this, $row['admissionclass']); } #Get the current class details $current_class = current_class($this, $row['id']); echo "<tr class='listrow " . ($counter % 2 ? '' : 'grey_list_row') . "' id='student-list-row-" . $row['id'] . "'>\r\r\n\t\t<td class='leftListCell rightListCell' valign='top' nowrap>"; if ($view_leave) { echo " <a href='" . base_url() . "students/load_leave_form/s/" . encryptValue($row['id']) . "' title=\"Click to assign " . $row['firstname'] . " leave.\">Assign leave</a>"; } else { #if(check_user_access($this,'delete_deal')){ echo "<input class=\"list_checkbox\" type=\"checkbox\" name=\"selected_student[]\" id=\"selected_student_" . $row['id'] . "\" />"; #} if ($delete_students) { echo " <a href='javascript:void(0)' onclick=\"asynchDelete('" . base_url() . "students/delete_student/i/" . encryptValue($row['id']) . "', 'Are you sure you want to delete this student? \\nThis operation can not be undone. \\nClick OK to confirm, \\nCancel to cancel this operation and stay on this page.','student-list-row-" . $row['id'] . "');\" title=\"Click to remove this student.\"><img src='" . base_url() . "images/delete.png' border='0'/></a>"; } #if(check_user_access($this,'update_deals')){ //echo " <a onclick=\"updateFieldLayer('".base_url()."students/student_profile/i/".encryptValue($row['id'])."','','','contentdiv','');\" href='javascript:void(0)' title=\"Click to edit ".$row['firstname']."'s details.\"><img src='".base_url()."images/edit.png' border='0'/></a>"; #} } echo "</td>\t\t\r\r\n\t\t<td valign='top' id='std_name_" . $row['id'] . "'><a onclick=\"updateFieldLayer('" . base_url() . "students/student_profile/i/" . encryptValue($row['id']) . "','','','contentdiv','');\" href='javascript:void(0)' title=\"Click to edit " . $row['firstname'] . "'s details.\">" . $row['firstname'] . " " . $row['lastname'] . "</a></td>\t\r\r\n\t\t<td valign='top'>" . $row['sponsorfullname'] . "</td>\t\r\r\n\t\t<td valign='top'>" . $row['studentno'] . "</td>\r\r\n\t\t<td valign='top' nowrap>" . number_format(get_date_diff($row['dob'], date('m/d/Y h:i:s a', time()), 'days') / 365, 0) . "</td>" . ($view_leave ? "<td valign='top' nowrap id='std_class_" . $row['id'] . "'>" . $current_class['class'] . ", " . $current_class['term'] . " [" . $current_class['year'] . "]</td>" . "<td>" . (empty($row['leaves']) ? '<i>N/A</i>' : '<a href="' . base_url() . 'students/student_leave_list/i/' . encryptValue($row['id']) . '" title="click to view ' . $row['firstname'] . '\' leaves.">' . $row['leaves'] . '</a>') . "</td></tr>" : "<td valign='top'>" . $admitclass . ", " . $admitterminfo['term'] . " [" . $admitterminfo['year'] . "]</td>\r\r\n\t\t<td valign='top' id='std_class_" . $row['id'] . "' nowrap>" . $current_class['class'] . ", " . $current_class['term'] . " [" . $current_class['year'] . "]</td>\r\r\n\t\t<td class='rightListCell' valign='top'>" . date("j M, Y", GetTimeStamp($row['dateadded'])) . "</td>\t\t\r\r\n\t\t</tr>");
<td valign="top"> <div id="student_account_details"> </div> <div id="student_accounts_list"> <?php #$page_list = array(); if (!empty($page_list)) { echo "<table width='100%' border='0' cellspacing='0' cellpadding='5'>\r\r\n\t\t\t\t\t\t\t <tr>\r\r\n\t\t\t\t\t\t\t <td class='listheader'> </td>\r\r\n\t\t\t\t\t\t\t <td class='listheader'>Student</td>\r\r\n\t\t\t\t\t\t\t <td class='listheader' nowrap>Current Class</td>\r\r\n\t\t\t\t\t\t\t <td class='listheader' nowrap align='right'>Total Debit</td>\r\r\n\t\t\t\t\t\t\t <td class='listheader' nowrap align='right'>Total Credit</td>\r\r\n\t\t\t\t\t\t\t <td class='listheader' nowrap align='right'>Balance</td>\r\r\n\t\t\t\t\t\t\t </tr>"; $counter = 0; $total_debit = 0; $total_credit = 0; foreach ($page_list as $row) { $total_debit += $row['studentdebit']; $total_credit += $row['studentcredit']; $studentclass = current_class($this, $row['studentid']); echo "<tr class='listrow " . ($counter % 2 ? '' : 'grey_list_row') . "'>\r\r\n\t\t\t\t\t\t <td class='leftListCell rightListCell' valign='top' nowrap>"; #if(check_user_access($this,'update_deals')){ echo " <a onClick=\"updateFieldLayer('" . base_url() . "students/get_student_finances/i/" . encryptValue($row['studentid']) . "','','','student_account_details','');hideTbody('student_accounts_list');\" href='javascript:void(0)' title=\"Click to view " . $row['firstname'] . "'s financial details.\"><img src='" . base_url() . "images/details.png' border='0'/></a>"; #} echo "</td>\t\t\r\r\n\t\t\t\t\t\t\t\t <td valign='top'>" . $row['firstname'] . " " . $row['lastname'] . "</td>\r\r\n\t\t\t\t\t\t\t\t <td valign='top'>" . $studentclass['class'] . "</td>\t\t\r\r\n\t\t\t\t\t\t\t\t <td valign='top' align='right'>" . number_format($row['studentdebit'], 0, '.', ',') . "</td>\r\r\n\t\t\t\t\t\t\t\t <td valign='top' align='right'>" . number_format($row['studentcredit'], 0, '.', ',') . "</td>\t\t\t\t\r\r\n\t\t\t\t\t\t\t\t <td valign='top' class='rightListCell' nowrap align='right'>" . number_format($row['studentcredit'] - $row['studentdebit'], 0, '.', ',') . "</td>\t\r\r\n\t\t\t\t\t\t\t </tr>"; $counter++; } echo "<tr>\r\r\n\t\t\t\t\t\t\t<td colspan='3'></td>\r\r\n\t\t\t\t\t\t\t<td><div class='sum'>" . number_format($total_debit, 0, '.', ',') . "</div></td>\r\r\n\t\t\t\t\t\t\t<td><div class='sum'>" . number_format($total_credit, 0, '.', ',') . "</div></td>\r\r\n\t\t\t\t\t\t\t<td style='padding-right:0'><div class='sum'>" . number_format(-($total_debit - $total_credit), 0, '.', ',') . "</div></td>\r\r\n\t\t\t\t\t\t </tr>"; echo "<tr>\r\r\n\t\t\t\t\t <td colspan='6' align='right' class='layer_table_pagination'>" . pagination($this->session->userdata('search_total_results'), $rows_per_page, $current_list_page, base_url() . "finances/student_accounts_overview/p/%d") . "</td>\r\r\n\t\t\t\t\t </tr>\r\r\n\t\t\t\t\t </table>"; } else { echo "<div>No transactions have been added.</div"; } ?> </div>
}); </script> <div class="content has_photo_upload" id="student-profile-view-content"> <table border="0" cellspacing="0" cellpadding="10" width="100%" id='contenttable'> <tr> <td valign="top" width="1%" style="padding-top:0px;"> <table> <tr> <td align="left"> <span id="print"> <div id="image-upload-status">Uploading photo..</div> </span> <?php #Get the current class details $current_class = current_class($this, $studentdetails['id']); $profile_image_src = empty($studentdetails['photo']) ? 'images/no-photo.jpg' : 'downloads/students/' . student_photo_thumb($studentdetails['photo']); echo '<img id="profile-pic" src="' . base_url() . $profile_image_src . '" class="profile-pic"/>'; ?> <div id="add-image" class="button" style="width:110px; margin-top:10px"> Upload Photo </div> <input type="hidden" name="photo" id="photo" value="" /> </td> </tr> <tr> <td class="field" nowrap> <?php echo "<div class='viewtext'>" . number_format(get_date_diff($studentdetails['dob'], date('m/d/Y h:i:s a', time()), 'days') / 365, 0) . ", " . $studentdetails['gender'] . "</div>"; ?>
function save_transaction() { 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 ($this->input->post('save')) { $data['formdata'] = $_POST; $required_fields = array('fee', 'amount', 'payer'); $_POST = clean_form_data($_POST); $validation_results = validate_form('', $_POST, $required_fields); $feename_error = ''; #set status as editing on destination if updating if ($this->input->post('editid')) { $data['editid'] = $_POST['editid']; } #Only proceed if the validation for required fields passes if ($validation_results['bool'] && !(empty($data['editid']) && !empty($user_details))) { if ($this->input->post('editid')) { #Add the school id and author to the data array $_POST = array_merge($_POST, array('school' => $this->myschool['id'], 'author' => $this->session->userdata('userid'))); $result = $this->studentobj->update_student_transaction(array_merge($_POST, array('id' => $data['editid']))); } else { #Add the school id and author to the data array $_POST = array_merge($_POST, array('school' => $this->myschool['id'], 'author' => $this->session->userdata('userid'))); $result = $this->studentobj->add_student_transaction($_POST, FALSE); } #Format and send the errors if (!empty($result) && $result) { $this->session->set_userdata('usave', "The transaction has been successfully saved."); redirect("students/get_student_finances/i/" . encryptValue($_POST['student']) . "/m/usave"); } else { if (empty($data['msg'])) { $data['msg'] = "ERROR: The transaction could not be saved or was not saved correctly."; } } } #Prepare a message in case the user already exists for another school /*else if(empty($data['editid']) && !empty($fee_details)) { #$addn_msg = (!empty($user_details['isactive']) && $user_details['isactive'] == 'N')? "<a href='".base_url()."admin/load_user_form/i/".encryptValue($user_details['id'])."/a/".encryptValue("reactivate")."' style='text-decoration:underline;font-size:17px;'>Click here to activate and edit</a>": "<a href='".base_url()."admin/load_user_form/i/".encryptValue($user_details['id'])."' style='text-decoration:underline;font-size:17px;'>Click here to edit</a>"; $data['msg'] = "WARNING: A fee with the same name already exists.<br />"; }*/ if ((empty($validation_results['bool']) || !empty($validation_results['bool']) && !$validation_results['bool']) && empty($data['msg'])) { $data['msg'] = "WARNING: The highlighted fields are required."; } $data['requiredfields'] = $validation_results['requiredfields']; } #Get applicable fees structure //First get the students current class $student_class = current_class($this, $_POST['student']); $fee_result = $this->db->query($this->Query_reader->get_query_by_code('search_fees_structure', array('isactive' => 'Y', 'limittext' => '', 'searchstring' => ' AND classes like "%' . $student_class['classid'] . '%"'))); $data['fees'] = $fee_result->result_array(); #Get student details $data['studentdetails'] = $this->Query_reader->get_row_as_array('get_students_list', array('isactive' => 'Y', 'limittext' => '', 'searchstring' => ' AND id = ' . $_POST['student'])); //$this->load->view('finances/credit_form_view', $data); //var_dump($data); echo "1"; }