index.php (1716B)
1 <?php 2 require "utils/router.php"; 3 4 $router = new Router(); 5 6 $router->addRoute(['GET'], '/', 'views/homepage.php'); 7 8 //views 9 10 //add contract 11 $router->addRoute(['GET', 'POST'], '/add_contract', 'views/add_contract.php'); 12 13 //add customer 14 $router->addRoute(['GET', 'POST'], '/add_customer', 'views/add_customer.php'); 15 16 //add user 17 $router->addRoute(['GET', 'POST'], '/add_user', 'views/add_user.php'); 18 19 //alter_contract 20 $router->addRoute(['GET', 'POST'], '/alter_contract', 'views/alter_contract.php'); 21 22 //alter_customer 23 $router->addRoute(['GET', 'POST'], '/alter_customer', 'views/alter_customer.php'); 24 25 //alter_user 26 $router->addRoute(['GET', 'POST'], '/alter_user', 'views/alter_user.php'); 27 28 //dashboard 29 $router->addRoute(['GET'], '/dashboard', 'views/dashboard.php'); 30 31 //homepage 32 $router->addRoute(['GET', 'POST'], '/homepage', 'views/homepage.php'); 33 34 //navbar 35 $router->addRoute(['GET'], '/navbar', 'views/navbar.php'); 36 37 //search_contract 38 $router->addRoute(['GET', 'POST'], '/search_contract', 'views/search_contract.php'); 39 40 //search_customer 41 $router->addRoute(['GET', 'POST'], '/search_customer', 'views/search_customer.php'); 42 43 //search_data 44 $router->addRoute(['GET', 'POST'], '/search_data', 'views/search_data.php'); 45 46 //search_user 47 $router->addRoute(['GET', 'POST'], '/search_user', 'views/search_user.php'); 48 49 50 //logic 51 52 //login_handler 53 $router->addRoute(['GET', 'POST'], '/login_handler', 'logic/login_handler.php'); 54 55 //data inserter 56 $router->addRoute(['POST'], '/datainserter', 'logic/datainserter.php'); 57 58 //log-out 59 $router->addRoute(['POST'], '/logout', 'logic/logout.php'); 60 61 //post weather data 62 $router->addRoute(['POST'], '/weather_data', 'logic/postWeatherData.php'); 63 64 //404 65 $router->route('views/404.html');