JezK
Edit File: ajaxcalls_app.php
<?php session_start(); include_once("school_admin_access_anil.php"); $fun=new adminaccess(); $school_id=$_SESSION['child']['log_school_id']; //school_id $academic_id=$_SESSION['child']['choosen_academic_id'];// academic_year_id $user_id=$_SESSION['child']['auth_id']; //user_id $mode=$_REQUEST['mode']; if($mode=="choose_class") { $class_id=$_REQUEST['data']; $details=$fun->get_sections($class_id,$academic_id); echo json_encode($details); } if($mode=="delete_exam") { $exam_id=$_REQUEST['exam_id']; $data=$fun->delete_examname($exam_id); echo json_encode($data); } if($mode=="delete_marks") { $marks_id=$_REQUEST['mark_id']; $data=$fun->delete_marks_data($marks_id); echo json_encode($data); } if($mode=="all_subjects") { $class_id=$_REQUEST['data']; $data=$fun->get_subjectslists($class_id); echo json_encode($data); } if($mode=="delete_exam_schedule") { $examtimetable_id=$_REQUEST['exam_timetable_id']; $exam_id=$_REQUEST['exam_id']; $class_id=$_REQUEST['class_id']; $section_id=$_REQUEST['section_id']; //$data=$fun->delete_examname($exam_id); $delete_exam_schedul=$fun->delete_exam_schedule($examtimetable_id,$class_id,$section_id,$exam_id); echo json_encode($delete_exam_schedul); } if($mode=="subjects") { $class_id=$_REQUEST['class_id']; $get_subjects=$fun->get_subjectslists($class_id); echo json_encode($get_subjects); } if($mode=="route") { $route_id=$_REQUEST['route_id']; $get_route_stops=$fun->getroute_stops_lists($route_id,$academic_id); echo json_encode($get_route_stops); } if($mode=="choose_subject") { $class_id=$_REQUEST['class_id']; $subjects=$fun->getsubjects($class_id,$school_id,$academic_id); echo json_encode($subjects); } if($mode=="choose_section") { $class_id=$_REQUEST['data']; $date=$_REQUEST['date']; $x=explode("/",$date); $month=$x[0]; $dy=$x[1]; $day=(int)$dy; $year=$x[2]; $sec_id=$_REQUEST['sec_id']; $details=$fun->school_attendance($class_id,$sec_id,$month,$year,$school_id,$academic_id,$day); echo json_encode($details); } if($mode=="leave") { $stud_id=$_REQUEST['stud_id']; $details=$fun->leave_details($stud_id); echo json_encode($details); } if($mode=="attendance") { $stud_id=$_REQUEST['stud_id']; $details=$fun->leavedetails($stud_id); echo json_encode($details); } if($mode=="absent") { $stud_id=$_REQUEST['stud_id']; $details=$fun->absentdetails($stud_id); echo json_encode($details); } if($mode=="load") { $class_id=$_REQUEST['class_id']; $date=$_REQUEST['date']; $x=explode("/",$date); $month=$x[0]; $dy=$x[1]; $day=(int)$dy; $year=$x[2]; $sec_id=$_REQUEST['sec_id']; $details=$fun->load_school_attendance($class_id,$sec_id,$month,$year,$school_id,$academic_id,$day); echo json_encode($details); } if($mode=="students") { $class_id=$_REQUEST['class_id']; $section_id=$_REQUEST['section_id']; $students=$fun->get_students2($class_id,$section_id,$school_id,$academic_id); echo json_encode($students); } if($mode=="delete_student_route") { $student_id=$_REQUEST['student_id']; $students=$fun->delete_student_route($student_id,$academic_id); echo json_encode($students); } if($mode=="delete_stf_route") { $stf_id=$_REQUEST['stf_id']; $students=$fun->deletestaff_route($stf_id,$academic_id); echo json_encode($students); } if($mode=="homework") { $class_id=$_REQUEST['class_id']; $section_id=$_REQUEST['section_id']; $date=$_REQUEST['date']; //echo "classid".':'. $students=$fun->adding_homework($class_id,$section_id,$date,$school_id,$academic_id); echo json_encode($students); } if($mode=="get_homework") { $class_id=$_REQUEST['cls']; $section_id=$_REQUEST['sec']; $date=$_REQUEST['dt']; $subject=$_REQUEST['subj']; $homework=$fun->get_homework($class_id,$section_id,$date,$subject); echo json_encode($homework); } ?>