Ei kuvausta
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

web.php 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <?php
  2. use App\Helpers\Helper;
  3. use App\User;
  4. use Illuminate\Http\Request;
  5. use Illuminate\Support\Facades\Auth;
  6. use Illuminate\Support\Facades\Route;
  7. /*
  8. |--------------------------------------------------------------------------
  9. | Web Routes
  10. |--------------------------------------------------------------------------
  11. |
  12. | Here is where you can register web routes for your application. These
  13. | routes are loaded by the RouteServiceProvider within a group which
  14. | contains the "web" middleware group. Now create something great!
  15. |
  16. */
  17. Auth::routes();
  18. Route::get('/', function () {
  19. // return view('welcome');
  20. return redirect(route('auth.index'));
  21. });
  22. Route::get('file/{file}', ['as' => 'get_file', 'uses' => 'UploadController@get_image'])->where('file', '(.*)');
  23. Route::group(['as' => 'fetch.', 'prefix' => 'fetch'], function () {
  24. Route::match(['get', 'post'], 'globalfetch', ['as' => 'globalfetch', 'uses' => 'FetchController@globalfetch']);
  25. });
  26. Route::match(['get', 'post'], 'cek-email', ['as' => 'cek_email', 'uses' => function (Request $request) {
  27. $status = true;
  28. $message = 'Inputan email tidak ditemukan';
  29. if (!empty($request['email'])) {
  30. $cek_email = User::where('email', $request['email']);
  31. $id = Hashids::decode($request['id']);
  32. if (!empty($id)) {
  33. $cek_email = $cek_email->where('id', '!=', $id);
  34. }
  35. $cek_email = $cek_email->first();
  36. if (!empty($cek_email)) {
  37. $status = true;
  38. $message = 'Email ' . $request['email'] . ' telah digunakan';
  39. } else {
  40. $status = false;
  41. $message = 'Email bisa digunakan';
  42. }
  43. }
  44. $response = [
  45. 'status' => $status,
  46. 'message' => $message,
  47. ];
  48. return response()->json($response);
  49. }]);
  50. Route::get('logout', function () {
  51. Auth::logout();
  52. session()->flush();
  53. session()->invalidate();
  54. return Redirect::to(route('login'))->with('message', 'logout');
  55. });
  56. /**COBA UPLOAD FILE */
  57. /**
  58. * Login
  59. */
  60. Route::group([
  61. 'prefix' => 'coba',
  62. 'namespace' => 'Coba',
  63. 'as' => 'coba.',
  64. ], function () {
  65. Route::group([
  66. 'prefix' => 'upload',
  67. 'as' => 'upload.',
  68. ], function () {
  69. Route::get('/', ['as' => 'index', 'uses' => 'UploadFile@index']);
  70. Route::post('upload-action', ['as' => 'upload_action', 'uses' => 'UploadFile@upload_action']);
  71. });
  72. });
  73. /**end upload file */
  74. /**
  75. * Login
  76. */
  77. Route::group([
  78. 'prefix' => 'auth',
  79. 'namespace' => 'Auth',
  80. 'as' => 'auth.',
  81. ], function () {
  82. Route::get('login', ['as' => 'index', 'uses' => 'LoginController@index']);
  83. Route::post('action-login', ['as' => 'action_login', 'uses' => 'LoginController@action_login']);
  84. });
  85. // Helper::declare_route();
  86. /**
  87. * route admin
  88. */
  89. Route::group(
  90. [
  91. 'middleware' => ['auth_cek', 'auth'],
  92. 'as' => 'admin.',
  93. 'namespace' => 'Admin',
  94. ],
  95. function () {
  96. //profil
  97. Route::group([
  98. 'prefix' => 'profile',
  99. 'namespace' => 'Profile',
  100. 'as' => 'profile.',
  101. ], function () {
  102. Route::get('update', ['as' => 'update', 'uses' => 'ProfileController@update']);
  103. Route::post('/update-action', ['as' => 'update_action', 'uses' => 'ProfileController@update_action']);
  104. });
  105. //end profile
  106. /**
  107. * Prefik admin.
  108. * Dashboard Controller
  109. */
  110. Route::get('dashboard', ['as' => 'dashboard', 'uses' => 'DashboardController@index']);
  111. Route::group([
  112. 'prefix' => 'dashboard',
  113. 'as' => 'dashboard.',
  114. ], function () {
  115. Route::get('dashboard-order-transfusi/{year?}', ['as' => 'transfusi', 'uses' => 'DashboardController@graph_order_transfusi']);
  116. Route::post('dashboard-modal-order-transfusi', ['as' => 'modal_transfusi', 'uses' => 'DashboardController@modal_graph_detail_order_transfusi']);
  117. Route::get('dashboard-order-dropping/{year?}', ['as' => 'dropping', 'uses' => 'DashboardController@graph_order_dropping']);
  118. Route::post('dashboard-modal-order-dropping', ['as' => 'modal_dropping', 'uses' => 'DashboardController@modal_graph_detail_order_dropping']);
  119. Route::get('dashboard-kantong-darah/{year?}', ['as' => 'kantong_darah', 'uses' => 'DashboardController@graph_kantong_darah']);
  120. Route::post('dashboard-modal-kantong-darah', ['as' => 'modal_kantong_darah', 'uses' => 'DashboardController@modal_graph_kantong_darah']);
  121. });
  122. Route::group(
  123. [
  124. 'prefix' => 'timeline',
  125. 'as' => 'timeline.',
  126. ],
  127. function () {
  128. Route::get('/', ['as' => 'index', 'uses' => 'TimelineController@index']);
  129. Route::get('/get-data/{udd_id?}', ['as' => 'get_data', 'uses' => 'TimelineController@getData']);
  130. Route::get('create', ['as' => 'create', 'uses' => 'TimelineController@create']);
  131. Route::get('approve/{timeline_id}', ['as' => 'approve', 'uses' => 'TimelineController@approve']);
  132. Route::get('reject/{timeline_id}', ['as' => 'reject', 'uses' => 'TimelineController@reject']);
  133. Route::get('/delete-action/{timeline_id}', ['as' => 'delete_action', 'uses' => 'TimelineController@delete_action']);
  134. Route::post('create-action', ['as' => 'create_action', 'uses' => 'TimelineController@create_action']);
  135. Route::post('update-action', ['as' => 'update_action', 'uses' => 'TimelineController@update_action']);
  136. }
  137. );
  138. Route::group(
  139. [
  140. 'prefix' => 'news',
  141. 'as' => 'news.',
  142. 'namespace' => 'Raharja',
  143. ],
  144. function () {
  145. Route::get('/', ['as' => 'index', 'uses' => 'NewsController@index']);
  146. Route::get('/get-data/{udd_id?}', ['as' => 'get_data', 'uses' => 'NewsController@getData']);
  147. Route::get('create', ['as' => 'create', 'uses' => 'NewsController@create']);
  148. Route::get('update/{news_id}', ['as' => 'update', 'uses' => 'NewsController@update']);
  149. Route::get('/delete-action/{news_id}', ['as' => 'delete_action', 'uses' => 'NewsController@delete_action']);
  150. Route::post('create-action', ['as' => 'create_action', 'uses' => 'NewsController@create_action']);
  151. Route::post('update-action', ['as' => 'update_action', 'uses' => 'NewsController@update_action']);
  152. }
  153. );
  154. Route::group(
  155. [
  156. 'prefix' => 'tips',
  157. 'as' => 'tips.',
  158. 'namespace' => 'Raharja',
  159. ],
  160. function () {
  161. Route::get('/', ['as' => 'index', 'uses' => 'TipsController@index']);
  162. Route::get('/get-data/{udd_id?}', ['as' => 'get_data', 'uses' => 'TipsController@getData']);
  163. Route::get('create', ['as' => 'create', 'uses' => 'TipsController@create']);
  164. Route::get('update/{news_id}', ['as' => 'update', 'uses' => 'TipsController@update']);
  165. Route::get('/delete-action/{news_id}', ['as' => 'delete_action', 'uses' => 'TipsController@delete_action']);
  166. Route::post('create-action', ['as' => 'create_action', 'uses' => 'TipsController@create_action']);
  167. Route::post('update-action', ['as' => 'update_action', 'uses' => 'TipsController@update_action']);
  168. }
  169. );
  170. Route::group(
  171. [
  172. 'prefix' => 'master_points',
  173. 'as' => 'master-points.',
  174. 'namespace' => 'Raharja',
  175. ],
  176. function () {
  177. Route::get('/', ['as' => 'index', 'uses' => 'MasterPointsController@index']);
  178. Route::get('/get-data/{udd_id?}', ['as' => 'get_data', 'uses' => 'MasterPointsController@getData']);
  179. Route::get('create', ['as' => 'create', 'uses' => 'MasterPointsController@create']);
  180. Route::get('update/{news_id}', ['as' => 'update', 'uses' => 'MasterPointsController@update']);
  181. Route::get('/delete-action/{news_id}', ['as' => 'delete_action', 'uses' => 'MasterPointsController@delete_action']);
  182. Route::post('create-action', ['as' => 'create_action', 'uses' => 'MasterPointsController@create_action']);
  183. Route::post('update-action', ['as' => 'update_action', 'uses' => 'MasterPointsController@update_action']);
  184. }
  185. );
  186. Route::group(
  187. [
  188. 'prefix' => 'message',
  189. 'as' => 'message.',
  190. 'namespace' => 'Raharja',
  191. ],
  192. function () {
  193. Route::get('/', ['as' => 'index', 'uses' => 'MessageController@index']);
  194. Route::get('/get-data/{udd_id?}', ['as' => 'get_data', 'uses' => 'MessageController@getData']);
  195. Route::get('create', ['as' => 'create', 'uses' => 'MessageController@create']);
  196. Route::get('/delete-action/{data_id}', ['as' => 'delete_action', 'uses' => 'MessageController@delete_action']);
  197. Route::get('select_user', ['as' => 'select_user', 'uses' => 'MessageController@selectUser']);
  198. Route::get('send/{data_id}', ['as' => 'send', 'uses' => 'MessageController@send']);
  199. Route::post('create-action', ['as' => 'create_action', 'uses' => 'MessageController@create_action']);
  200. }
  201. );
  202. Route::group(
  203. [
  204. 'prefix' => 'trivia',
  205. 'as' => 'trivia.',
  206. 'namespace' => 'Trivia',
  207. ],
  208. function () {
  209. Route::get('/', ['as' => 'index', 'uses' => 'TriviaController@index']);
  210. Route::get('/get-data/{udd_id?}', ['as' => 'get_data', 'uses' => 'TriviaController@getData']);
  211. Route::get('create', ['as' => 'create', 'uses' => 'TriviaController@create']);
  212. Route::get('update/{trivia_id}', ['as' => 'update', 'uses' => 'TriviaController@update']);
  213. Route::get('/delete-action/{trivia_id}', ['as' => 'delete_action', 'uses' => 'TriviaController@delete_action']);
  214. Route::post('create-action', ['as' => 'create_action', 'uses' => 'TriviaController@create_action']);
  215. Route::post('update-action', ['as' => 'update_action', 'uses' => 'TriviaController@update_action']);
  216. }
  217. );
  218. Route::group(
  219. [
  220. 'prefix' => 'kelompok_driver',
  221. 'as' => 'kelompok-driver.',
  222. 'namespace' => 'Raharja',
  223. ],
  224. function () {
  225. Route::get('/', ['as' => 'index', 'uses' => 'KelompokDriverController@index']);
  226. Route::get('/get-data/{data_id?}', ['as' => 'get_data', 'uses' => 'KelompokDriverController@getData']);
  227. Route::get('create', ['as' => 'create', 'uses' => 'KelompokDriverController@create']);
  228. Route::get('update/{data_id}', ['as' => 'update', 'uses' => 'KelompokDriverController@update']);
  229. Route::get('/delete-action/{data_id}', ['as' => 'delete_action', 'uses' => 'KelompokDriverController@delete_action']);
  230. Route::post('create-action', ['as' => 'create_action', 'uses' => 'KelompokDriverController@create_action']);
  231. Route::post('update-action', ['as' => 'update_action', 'uses' => 'KelompokDriverController@update_action']);
  232. }
  233. );
  234. Route::group(
  235. [
  236. 'prefix' => 'event_organisasi',
  237. 'as' => 'event-organisasi.',
  238. 'namespace' => 'Raharja',
  239. ],
  240. function () {
  241. Route::get('/', ['as' => 'index', 'uses' => 'EventOrganisasiController@index']);
  242. Route::get('/get-data/{data_id?}', ['as' => 'get_data', 'uses' => 'EventOrganisasiController@getData']);
  243. Route::get('create', ['as' => 'create', 'uses' => 'EventOrganisasiController@create']);
  244. Route::get('update/{data_id}', ['as' => 'update', 'uses' => 'EventOrganisasiController@update']);
  245. Route::get('kelompok-driver/{data_id}', ['as' => 'kelompok_driver', 'uses' => 'EventOrganisasiController@kelompokDriver']);
  246. Route::get('/delete-action/{data_id}', ['as' => 'delete_action', 'uses' => 'EventOrganisasiController@delete_action']);
  247. Route::get('/get-data-kelompok-driver/{data_id?}', ['as' => 'get_data_kelompok_driver', 'uses' => 'EventOrganisasiController@getDataKelompokDriver']);
  248. Route::get('/delete-kelompok-driver/{data_id}', ['as' => 'delete_kelompok_driver', 'uses' => 'EventOrganisasiController@deleteKelompokDriver']);
  249. Route::get('select_kelompok_driver', ['as' => 'select_kelompok_driver', 'uses' => 'EventOrganisasiController@selectKelompokDriver']);
  250. Route::post('create-action', ['as' => 'create_action', 'uses' => 'EventOrganisasiController@create_action']);
  251. Route::post('update-action', ['as' => 'update_action', 'uses' => 'EventOrganisasiController@update_action']);
  252. Route::post('add_kelompok_driver', ['as' => 'add_kelompok_driver', 'uses' => 'EventOrganisasiController@addKelompokDriver']);
  253. }
  254. );
  255. // end route raharja
  256. }
  257. );
  258. // Helper::declare_route();
  259. app('App\Http\Controllers\Admin\User_management\PermissionController')->route();
  260. app('App\Http\Controllers\Admin\User_management\UserController')->route();
  261. app('App\Http\Controllers\Admin\User_management\RoleController')->route();
  262. app('App\Http\Controllers\Admin\TransportationController')->route();