JezK
Edit File: ajaxcalls_attn.php
<?php session_start(); include("session_check.php"); include_once("school_admin_access_file.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=="all_subjects") { $class_id=$_REQUEST['data']; $data=$fun->get_subjectslists($class_id,$academic_id); echo json_encode($data); } if($mode=="delete_exam_schedule") { $examtimetable_id=$_REQUEST['exam_timetable_id']; //$data=$fun->delete_examname($exam_id); $delete_exam_schedul=$fun->delete_exam_schedule($examtimetable_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']; //$school_id=1; //school_id //$academic_id=1; // academic_year_id //$details=$fun->get_classes($school_id,$academic_id); //$subjects=$fun->get_subjects($class_id,$school_id,$academic_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']; //$sname=$_REQUEST['sname']; $details=$fun->leave_details($stud_id); echo json_encode($details); } if($mode=="attendance") { $stud_id=$_REQUEST['stud_id']; //$sname=$_REQUEST['sname']; $details=$fun->leavedetails($stud_id); echo json_encode($details); } if($mode=="absent") { $stud_id=$_REQUEST['stud_id']; //$sname=$_REQUEST['sname']; $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']; //$school_id=1; //$academic_id=1; $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=="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); } if($mode=="delete_file") { $school_dairy_id=$_REQUEST['school_dairy_id']; //$section_id=$_REQUEST['sec']; //$date=$_REQUEST['dt']; //$subject=$_REQUEST['subj']; $homework=$fun->delete_attachment($school_dairy_id); echo $homework; } if($mode=="delete_event") { $notification_id=$_REQUEST['notification_id']; //$section_id=$_REQUEST['sec']; //$date=$_REQUEST['dt']; //$subject=$_REQUEST['subj']; $delevent=$fun->delete_calevent($notification_id); echo $delevent; } if($mode=="event_dates") { $date=$_REQUEST['date']; $academic_yearid=$_REQUEST['academic_yearid']; $delevent=$fun->getEventDates($date,$academic_yearid); //$str=implode(',',$delevent); //echo $str; echo json_encode($delevent); } ?>