<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/


//Admin
Route::group(['namespace'=>'Admin','middleware'=>['admin.login']],function() {

    Route::get('/see', 'IndexController@see');

    Route::get('/', 'IndexController@index');
    Route::get('/change_pswd', 'IndexController@change_pswd');
    Route::post('/pswd', 'IndexController@pswd');
    Route::get('/user_list', 'UserController@user_list');
    Route::resource('user', 'UserController');
    Route::get('/out', 'IndexController@out');

    Route::get('/table','TableController@index');
    Route::get('/on_table','TableController@on_table');
    Route::get('/table/{id}','TableController@show');
    Route::get('/table/{id}/edit','TableController@edit');
    Route::post('/table/save/{id}','TableController@save');
    Route::post('/table/save/{id}/update','TableController@update');
    Route::post('/table/sub/{id}','TableController@submit');
    Route::delete('/table/del/{id}','TableController@delete');

    Route::resource('/permission','PermissionController');
    Route::resource('/job','JobController');
});

Route::any('/login', 'Admin\IndexController@login');
