<?php

use CodeIgniter\Router\RouteCollection;

/** @var RouteCollection $routes */
$routes->get('/', 'Home::index');
//$routes->get('/dashboard', 'Home::dash');
$routes->get('/test', 'Home::test');

//dashboard
$routes->get('/dashboard', 'Dashboard::index');
$routes->get('dashboard/getMonthlyIncome', 'Dashboard::getMonthlyIncome');
$routes->get('dashboard/getPendingPayments', 'Dashboard::getPendingPayments');

//class type
$routes->get('/classtype', 'Class_Type::index');
$routes->post('classtype/save', 'Class_Type::save');
$routes->get('classtype/get/(:num)', 'Class_Type::get/$1');
$routes->post('classtype/update', 'Class_Type::update');
$routes->post('classtype/delete', 'Class_Type::delete');

//class status
$routes->get('/classstatus', 'Class_Status::index');
$routes->post('classstatus/save', 'Class_Status::save');
$routes->get('classstatus/get/(:num)', 'Class_Status::get/$1');
$routes->post('classstatus/update', 'Class_Status::update');
$routes->post('classstatus/delete', 'Class_Status::delete');

//grade
$routes->get('/grade', 'Grade::index');
$routes->post('grade/save', 'Grade::save');
$routes->get('grade/get/(:num)', 'Grade::get/$1');
$routes->post('grade/update', 'Grade::update');
$routes->post('grade/delete', 'Grade::delete');

//payment method
$routes->get('/paymentmethod', 'Payment_Method::index');
$routes->post('paymentmethod/save', 'Payment_Method::save');
$routes->get('paymentmethod/get/(:num)', 'Payment_Method::get/$1');
$routes->post('paymentmethod/update', 'Payment_Method::update');
$routes->post('paymentmethod/delete', 'Payment_Method::delete');

//payment type
$routes->get('/paymenttype', 'Payment_Type::index');
$routes->post('paymenttype/save', 'Payment_Type::save');
$routes->get('paymenttype/get/(:num)', 'Payment_Type::get/$1');
$routes->post('paymenttype/update', 'Payment_Type::update');
$routes->post('paymenttype/delete', 'Payment_Type::delete');

//user role
$routes->get('/userrole', 'User_Role::index');
$routes->post('userrole/save', 'User_Role::save');
$routes->get('userrole/get/(:num)', 'User_Role::get/$1');
$routes->post('userrole/update', 'User_Role::update');
$routes->post('userrole/delete', 'User_Role::delete');

//user
$routes->get('/user', 'User::index');
$routes->post('user/save', 'User::save');
$routes->get('user/get/(:num)', 'User::get/$1');
$routes->post('user/update', 'User::update');
$routes->post('user/delete', 'User::delete');
$routes->post('user/auth', 'User::authenticate');
$routes->get('/login', 'User::login');

//lesson
$routes->get('/lesson', 'Lesson::index');
$routes->post('lesson/save', 'Lesson::save');
$routes->get('lesson/get/(:num)', 'Lesson::get/$1');
$routes->post('lesson/update', 'Lesson::update');
$routes->post('lesson/delete', 'Lesson::delete');

//student
$routes->get('/student', 'Student::index');
$routes->post('student/save', 'Student::save');
$routes->get('student/get/(:num)', 'Student::get/$1');
$routes->post('student/update', 'Student::update');
$routes->post('student/delete', 'Student::delete');

//class
$routes->get('/class', 'Class_Controller::index');
$routes->post('class/save', 'Class_Controller::save');
$routes->get('class/get/(:num)', 'Class_Controller::get/$1');
$routes->get('class/getStudents/(:num)', 'Class_Controller::getStudents/$1');
$routes->post('class/update', 'Class_Controller::update');
$routes->post('class/delete', 'Class_Controller::delete');
$routes->get('class/getData', 'Class_Controller::getDataTable');

//class diary
$routes->get('/classdiary', 'Class_Diary::index');
$routes->post('classdiary/save', 'Class_Diary::save');
$routes->get('classdiary/get/(:num)', 'Class_Diary::get/$1');
$routes->post('classdiary/update', 'Class_Diary::update');
$routes->post('classdiary/delete', 'Class_Diary::delete');
//$routes->post('classdiary/getLessonsByClassId', 'Class_Diary::getLessonsByClassId');
$routes->get('classdiary/getLessonsByClassId/(:num)', 'Class_Diary::getLessonsByClassId/$1');
$routes->get('classdiary/getStudentsByClassId/(:num)', 'Class_Diary::getStudentsByClassId/$1');
$routes->get('classdiary/getClassDayByClassId/(:num)', 'Class_Diary::getClassDayByClassId/$1');
$routes->get('classdiary/getData', 'Class_Diary::getDataTable');

//student history report
$routes->get('/classdiaryreport', 'Report_Class_Diary::index');
$routes->post('/classdiaryreport/getstudent', 'Report_Class_Diary::index');

//payment
$routes->get('/payment', 'Payment::index');
$routes->post('payment/save', 'Payment::save');
$routes->get('payment/get/(:num)', 'Payment::get/$1');
$routes->get('payment/getStudents/(:num)', 'Payment::getStudents/$1');
$routes->post('payment/update', 'Payment::update');
$routes->post('payment/delete', 'Payment::delete');
$routes->get('payment/getPaymentByStudentId/(:num)', 'Payment::getPaymentByStudentId/$1');
$routes->get('payment/getAttendance/(:num)', 'Payment::getAttendance/$1');
$routes->get('payment/getPendingFeeCount/(:num)', 'Payment::getPendingFeeCount/$1');

