<?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('/', 'IndexController@index');
    Route::get('/change_pswd', 'IndexController@change_pswd');
    Route::post('/pswd', 'IndexController@pswd');
    Route::get('/user_list', 'UserController@user_list');
    Route::get('/out', 'IndexController@out');
    Route::get('/search', 'IndexController@index_search');
    Route::get('/search_where', 'IndexController@search_where');
    Route::get('/search/show', 'IndexController@search_show');
    Route::any('/upload','CommonController@upload');

    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::post('/table/sub/{id}/create','TableController@create');
    Route::delete('/table/del/{id}','TableController@delete');
    Route::get('/table/statistics/{table_type_id}','TableController@sta_table');

    Route::resource('user', 'UserController');
    Route::resource('/permission','PermissionController');
    Route::resource('/job','JobController');
    Route::resource('/project','ProjectController');
    Route::resource('/department','DepartmentController');

    Route::post('/project/show/{id}','ProjectController@show');
    Route::post('/project/display/{id}','ProjectController@display');
    Route::post('/user/ting/{id}','UserController@ting');
    Route::post('/user/start/{id}','UserController@start');
    Route::post('/job/ting/{id}','JobController@ting');
    Route::post('/job/start/{id}','JobController@start');
    Route::post('/department/ting/{id}','DepartmentController@ting');
    Route::post('/department/start/{id}','DepartmentController@start');
});

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