$discovery->referrals = $_POST['e_referrals'];
        $discovery->others = $_POST['e_others'];
        $discovery->update();
        //----------------------------------------------------------------------------------------------------------------------------------//
        $enrollmentDetail = EnrollmentDetail::get_by_id($student->enrollment_detail_id);
        $enrollmentDetail->status = $_POST['f_status'];
        $enrollmentDetail->program = $_POST['f_program'];
        $enrollmentDetail->schedule = $_POST['f_schedule'];
        $enrollmentDetail->payment = $_POST['f_payment'];
        $enrollmentDetail->studentcontactnumber = $_POST['f_studentcontactnumber'];
        $enrollmentDetail->update();
        //----------------------------------------------------------------------------------------------------------------------------------//
        $appointmentDetail = AppointmentDetail::get_by_id($student->appointment_detail_id);
        $appointmentDetail->visitschedule = strtotime($_POST['g_visitschedule']);
        $appointmentDetail->visitpurpose = $_POST['g_visitpurpose'];
        $appointmentDetail->officer = $_POST['g_officer'];
        $appointmentDetail->update();
        //----------------------------------------------------------------------------------------------------------------------------------//
    } else {
        if ($_POST['oper'] == 'del') {
            $student = Student::get_by_id($_POST['id']);
            $student->delete();
            AppointmentDetail::get_by_id($student->appointment_detail_id)->delete();
            EnrollmentDetail::get_by_id($student->enrollment_detail_id)->delete();
            StiDiscovery::get_by_id($student->sti_discovery_id)->delete();
            SchoolConsidered::get_by_id($student->school_considered_id)->delete();
            SchoolLastAttended::get_by_id($student->school_last_attended_id)->delete();
            PersonalInformation::get_by_id($student->personal_information_id)->delete();
        }
    }
}
    $s .= "<cell>" . $discovery->flyers . "</cell>";
    $s .= "<cell>" . $discovery->billboards . "</cell>";
    $s .= "<cell>" . $discovery->posters . "</cell>";
    $s .= "<cell>" . $discovery->stimuli . "</cell>";
    $s .= "<cell>" . $discovery->referrals . "</cell>";
    $s .= "<cell>" . $discovery->others . "</cell>";
    //----------------------------------------------------------------------------------------------------------------------------------//
    $enrollmentDetail = EnrollmentDetail::get_by_id($student->enrollment_detail_id);
    if (!$enrollmentDetail) {
        $enrollmentDetail = new EnrollmentDetail();
    }
    $s .= "<cell>" . $enrollmentDetail->status . "</cell>";
    $s .= "<cell>" . $enrollmentDetail->program . "</cell>";
    $s .= "<cell>" . $enrollmentDetail->schedule . "</cell>";
    $s .= "<cell>" . $enrollmentDetail->payment . "</cell>";
    $s .= "<cell>" . $enrollmentDetail->studentcontactnumber . "</cell>";
    //----------------------------------------------------------------------------------------------------------------------------------//
    $appointmentDetail = AppointmentDetail::get_by_id($student->appointment_detail_id);
    if (!$appointmentDetail) {
        $appointmentDetail = new AppointmentDetail();
    }
    $s .= "<cell>" . $appointmentDetail->visitschedule . "</cell>";
    $s .= "<cell>" . $appointmentDetail->visitpurpose . "</cell>";
    $s .= "<cell>" . $appointmentDetail->officer . "</cell>";
    //----------------------------------------------------------------------------------------------------------------------------------//
    $s .= "<cell>" . $student->datetime . "</cell>";
    $s .= "<cell></cell>";
    $s .= "</row>";
}
$s .= "</rows>";
echo $s;