<?php
defined('BASEPATH') or exit('No direct script access allowed');

class Class_record extends MY_ApiController
{
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Attendance Listing
     *
     * @return void
     */
    public function listing()
    {
        $this->is_get();
        $params = $this->input->get();

        $studentId = $params['student_id'];
        $tenantNo = $params['tenant_no'];

        $future = $params['future'];
        $future = $future == 'true';

        $this->load->model('Event_enrollment_item_model');
        $this->Event_enrollment_item_model->setTenantNo($tenantNo, true);
        $res = $this->Event_enrollment_item_model->listing_in_student_class_record($studentId, $future);

        echo $this->respond([
            'activities' => $res
        ]);
    }

    public function makeup_listing()
    {
        $this->is_get();
        $params = $this->input->get();

        $studentId = $params['student_id'];
        $tenantNo = $params['tenant_no'];
        $future = $params['future'];
        $future = $future == 'true';

        $this->load->model('Event_enrollment_item_model');
        $this->Event_enrollment_item_model->setTenantNo($tenantNo, true);

        $res = $this->Event_enrollment_item_model->makeup_listing($studentId, $tenantNo);

        echo $this->respond([
            'activities' => $res
        ]);
    }
}
