2019-11-18 18:33:29 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Web Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Here is where you can register web routes for your application. These
|
|
|
|
| routes are loaded by the RouteServiceProvider within a group which
|
|
|
|
| contains the "web" middleware group. Now create something great!
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
Route::get('/', function () {
|
2019-12-13 23:28:16 +01:00
|
|
|
return view('home');
|
2019-11-18 18:33:29 +01:00
|
|
|
});
|
2019-11-25 16:23:25 +01:00
|
|
|
Auth::routes();
|
|
|
|
|
|
|
|
Route::get('/home', 'HomeController@index')->name('home');
|
2019-12-01 19:31:49 +01:00
|
|
|
Route::group(array('prefix' => 'admin', 'namespace' => 'Admin'), function()
|
2019-12-01 00:22:33 +01:00
|
|
|
{
|
|
|
|
Route::get('/', 'AdminPanelController@index')->name('admin');
|
2019-12-01 19:31:49 +01:00
|
|
|
Route::get('/users', 'AdminUsersController@index')->name('admin_users');
|
|
|
|
Route::get('/subjects', 'AdminSubjectsController@index')->name('admin_subjects');
|
|
|
|
Route::get('/rooms', 'AdminRoomsController@index')->name('admin_rooms');
|
|
|
|
Route::get('/classes', 'AdminClassesController@index')->name('admin_classes');
|
|
|
|
Route::get('/attendances', 'AdminAttendancesController@index')->name('admin_attendances');
|
2019-12-04 16:55:59 +01:00
|
|
|
Route::get('/test', 'AdminPanelController@test_connection')->name('admin_test_connection');
|
2019-12-01 19:31:49 +01:00
|
|
|
|
2019-12-01 23:36:12 +01:00
|
|
|
Route::group(array('prefix' => 'add'), function() {
|
|
|
|
Route::post('/user', 'AdminUsersController@add_user')->name('admin_add_user');
|
|
|
|
Route::post('/subject', 'AdminSubjectsController@add_subject')->name('admin_add_subject');
|
|
|
|
Route::post('/room', 'AdminRoomsController@add_room')->name('admin_add_room');
|
|
|
|
Route::post('/classes', 'AdminClassesController@add_classes')->name('admin_add_classes');
|
|
|
|
Route::post('/attendance', 'AdminAttendancesController@add_attendance')->name('admin_add_attendance');
|
|
|
|
});
|
|
|
|
Route::group(array('prefix' => 'delete'), function() {
|
|
|
|
Route::get('/user/{user_id}', 'AdminUsersController@delete_user')->name('admin_delete_user');
|
|
|
|
Route::get('/subject/{subject_id}', 'AdminSubjectsController@delete_subject')->name('admin_delete_subject');
|
|
|
|
Route::get('/room/{room_id}', 'AdminRoomsController@delete_room')->name('admin_delete_room');
|
|
|
|
Route::get('/classes/{classes_id}', 'AdminClassesController@delete_classes')->name('admin_delete_classes');
|
|
|
|
Route::get('/attendance/{attendance_id}', 'AdminAttendancesController@delete_attendance')->name('admin_delete_attendance');
|
|
|
|
});
|
|
|
|
Route::group(array('prefix' => 'edit'), function() {
|
|
|
|
Route::get('/user/{user_id}', 'AdminUsersController@edit_user')->name('admin_edit_user');
|
|
|
|
Route::get('/subject/{subject_id}', 'AdminSubjectsController@edit_subject')->name('admin_edit_subject');
|
|
|
|
Route::get('/room/{room_id}', 'AdminRoomsController@edit_room')->name('admin_edit_room');
|
|
|
|
Route::get('/classes/{classes_id}', 'AdminClassesController@edit_classes')->name('admin_edit_classes');
|
|
|
|
Route::get('/attendance/{attendance_id}', 'AdminAttendancesController@edit_attendance')->name('admin_edit_attendance');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2019-12-04 10:21:58 +01:00
|
|
|
Route::group(array('prefix' => 'user', 'namespace' => 'User'), function() { //TODO poprawic {user_id}
|
|
|
|
Route::get('/subjects/{groupBy?}', 'UserSubjectsController@index')->name('user_subjects');
|
|
|
|
Route::get('/classes/{groupBy?}', 'UserClassesController@index')->name('user_classes');
|
|
|
|
Route::get('/attendance/{groupBy?}', 'UserAttendancesController@index')->name('user_attendances');
|
2019-12-01 23:36:12 +01:00
|
|
|
|
2019-12-04 16:55:59 +01:00
|
|
|
Route::get('/classes/start/{classes_id}', 'UserClassesController@start_classes')->name('user_start_classes');
|
|
|
|
Route::post('/classes/start', 'UserClassesController@start_classes_verified')->name('user_start_classes_verified')->middleware('classesCode');
|
2019-12-07 19:49:42 +01:00
|
|
|
Route::post('/classes/save', 'UserClassesController@save_classes_data')->name('user_save_classes_data');
|
2019-12-13 23:28:16 +01:00
|
|
|
Route::get('/classes/preview/{classes_id?}', 'UserClassesController@preview_classes')->name('user_preview_classes');
|
2019-12-04 16:55:59 +01:00
|
|
|
|
2019-12-01 23:36:12 +01:00
|
|
|
Route::group(array('prefix' => 'add'), function() {
|
|
|
|
Route::post('/subject', 'UserSubjectsController@add_subject')->name('user_add_subject');
|
|
|
|
Route::post('/classes', 'UserClassesController@add_classes')->name('user_add_classes');
|
|
|
|
Route::post('/attendance', 'UserAttendancesController@add_attendance')->name('user_add_attendance');
|
|
|
|
});
|
|
|
|
|
|
|
|
Route::group(array('prefix' => 'delete'), function() {
|
2019-12-04 10:21:58 +01:00
|
|
|
Route::get('/subject/{subject_id}/{groupBy?}', 'UserSubjectsController@delete_subject')->name('user_delete_subject');
|
|
|
|
Route::get('/classes/{classes_id}/{groupBy?}', 'UserClassesController@delete_classes')->name('user_delete_classes');
|
|
|
|
Route::get('/attendance/{attendance_id}/{groupBy?}', 'UserAttendancesController@delete_attendance')->name('user_delete_attendance');
|
2019-12-01 23:36:12 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
Route::group(array('prefix' => 'edit'), function() {
|
2019-12-04 10:21:58 +01:00
|
|
|
Route::get('/subject/{subject_id}/{groupBy?}', 'UserSubjectsController@edit_subject')->name('user_edit_subject');
|
|
|
|
Route::get('/attendance/{attendance_id}/{groupBy?}', 'UserAttendancesController@edit_attendance')->name('user_edit_attendance');
|
2019-12-01 23:36:12 +01:00
|
|
|
});
|
2019-12-04 16:55:59 +01:00
|
|
|
|
2019-12-14 22:03:41 +01:00
|
|
|
Route::get('/export/attendances/{classes_id}', 'UserAttendancesController@export')->name('user_export');
|
|
|
|
Route::get('/export/attendances/grouped/{groupBy}', 'UserAttendancesController@export_grouped')->name('user_export_grouped');
|
2019-12-01 00:22:33 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
|