Current Path : /data/web/virtuals/51568/virtual/www/subdom/pomucky/www/ |
Current File : /data/web/virtuals/51568/virtual/www/subdom/pomucky/www/index.php |
<?php use app\Application; use app\controllers\{ SiteController, PredmetyController, PomuckyController, TridyController, ObjedTridyController, ObjedPredmetyController, EditorsController, UserController }; /* kdyz bych chtel dat kontrolery do podslozek, tak cestu k nim nastavim zde v use napr: app\controlers\auth ... */ use app\controllers\{ AuthController }; require_once __DIR__ . '/../vendor/autoload.php'; $dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . '/..', '.env'); $dotenv->load(); $config = [ // 'userClass' => \app\models\User::class, 'db' => [ 'dsn' => $_ENV['DB_DSN'], 'user' => $_ENV['DB_USER'], 'password' => $_ENV['DB_PASSWORD'], ], ]; $app = new Application(dirname(__DIR__) . "/src", $config); $router = $app->router; //$app->session->set("iduser", 59); //$app->session->remove("iduser"); $router->get('/', [SiteController::class, 'home']); $router->get('/predmety', [PredmetyController::class, 'table']); $router->post('/set-stupen', [PredmetyController::class, 'setStupen']); $router->post('/predmety-uloz', [PredmetyController::class, 'predmetyUloz']); $router->post('/predmety-smaz-dlg', [PredmetyController::class, 'predmetySmazDlg']); $router->post('/predmety-smaz', [PredmetyController::class, 'predmetySmaz']); $router->get('/predmety-novy-dlg', [PredmetyController::class, 'predmetyNovyDlg']); $router->post('/predmety-novy', [PredmetyController::class, 'predmetyNovyUloz']); $router->get('/pomuc', [PomuckyController::class, 'table']); $router->post('/pomucky-uloz', [PomuckyController::class, 'pomuckyUloz']); $router->post('/pomucky-smaz-dlg', [PomuckyController::class, 'pomuckySmazDlg']); $router->post('/pomucky-smaz', [PomuckyController::class, 'pomuckySmaz']); $router->post('/pomucky-poradi', [PomuckyController::class, 'pomuckyPoradi']); $router->get('/pomucky-novy-dlg', [PomuckyController::class, 'pomuckyNovyDlg']); $router->post('/pomucky-novy', [PomuckyController::class, 'pomuckyNovyUloz']); $router->get('/tridy', [TridyController::class, 'table']); $router->post('/tridy-uloz', [TridyController::class, 'tridyUloz']); $router->post('/tridy-smaz-dlg', [TridyController::class, 'tridySmazDlg']); $router->post('/tridy-smaz', [TridyController::class, 'tridySmaz']); $router->get('/tridy-nova-dlg', [TridyController::class, 'tridyNovaDlg']); $router->post('/tridy-nova', [TridyController::class, 'tridyNovaUloz']); $router->get('/objed-tridy', [ObjedTridyController::class, 'tridySelect']); $router->post('/objed-tridy-zobraz', [ObjedTridyController::class, 'objedTridyZobraz']); $router->post('/objed-tridy-uloz', [ObjedTridyController::class, 'objedTridyUloz']); $router->get('/objed-tridy-tisk/{d:\d+}', [ObjedTridyController::class, 'objedTridyTisk']); $router->get('/objed-tridy-tiskzaci/{d:\d+}', [ObjedTridyController::class, 'objedTridyTiskZaci']); $router->get('/objed-predmety', [ObjedPredmetyController::class, 'predmetySelect']); $router->post('/objed-predmety-zobraz', [ObjedPredmetyController::class, 'objedPredmetyZobraz']); $router->post('/objed-predmety-uloz', [ObjedPredmetyController::class, 'objedPredmetyUloz']); $router->get('/objed-predmety-tisk/{d:\d+}', [ObjedPredmetyController::class, 'objedPredmetyTisk']); $router->get('/objed-vse-tisk', [ObjedPredmetyController::class, 'objedVseTisk']); $router->get('/editors', [EditorsController::class, 'table']); $router->post('/editors-edit', [EditorsController::class, 'editorEdit']); $router->post('/editors-detail-save', [EditorsController::class, 'editorsDetailSave']); $router->post('/editors-rights', [EditorsController::class, 'editorsRights']); $router->post('/editors-right-save', [EditorsController::class, 'editorsRightSave']); $router->post('/login-form', [UserController::class, 'loginForm']); $router->get('/logout', [UserController::class, 'logout']); $router->get('/pass-change', [UserController::class, 'passChange']); $router->post('/pass-change', [UserController::class, 'passChange']); $app->run();