예제 #1
0
<?php

switch ($action) {
    case 'index':
        /*création des tables*/
        $pipeManager = new PipeManager($bdd);
        $pipeManager->createTable();
        $pipeoptionManager = new PipeoptionManager($bdd);
        $pipeoptionManager->createTable();
        $pageManager = new PageManager($bdd);
        $pageManager->createTable();
        $userManager = new UserManager($bdd);
        $userManager->createTable();
        $tokenManager = new TokenManager($bdd);
        $tokenManager->createTable();
        /*redirection*/
        header('Location: ?controler=install&action=firstuser');
        break;
    case 'firstuser':
        $userManager = new UserManager($bdd);
        if ($userManager->count() > 0) {
            header('Location: ?controler=index');
        } else {
            header('Location: ?controler=user&action=add');
        }
        break;
    default:
        break;
}
예제 #2
0
     if (!empty($_POST['pageoptionid']) && !empty($_POST['pipeid']) && !empty($_POST['nameoption']) && !empty($_POST['value'])) {
         $pipeoptionManager = new PipeoptionManager($bdd);
         $pipeoption = new Pipeoption($_POST);
         $pipeoptionManager->add($pipe);
         header('Location: ?controler=pipeoption&action=list');
     } else {
         ob_start();
         require_once 'view/pipeoption/add.php';
         $content = ob_get_contents();
         ob_end_clean();
         require_once 'view/layout/layout.php';
     }
     break;
 case 'list':
     if (!empty($_GET['id'])) {
         $pipeoptionManager = new PipeoptionManager($bdd);
         $pipeoptionsall = $pipeoptionManager->getList('pipeid');
         $pipeoptions = array();
         foreach ($pipeoptionsall as $pipeoption) {
             if ($pipeoption->pipeid() == $_GET['id']) {
                 $pipeoptions[] = $pipeoption;
             }
         }
         ob_start();
         require_once 'view/pipeoption/list.php';
         $content = ob_get_contents();
         ob_end_clean();
         require_once 'view/layout/layout.php';
     }
     break;
 default: