Exemplo n.º 1
0
     $view = "All";
     require "{$ROOT}{$DS}view{$DS}{$layout}.php";
     break;
 case 'read':
     $id = $_GET['idMod'];
     $modele = modelModele::select($id);
     $tabItem = modelItem::getItemByModele($id);
     // tous les article
     $tabColor = modelItem::getAllColorOfModel($id);
     $view = '';
     $pagetitle = "{$modele->getNameMod()} - {$modele->getNameBrand()}";
     require "{$ROOT}{$DS}view{$DS}{$layout}.php";
     break;
 case 'create':
     $view = 'Create';
     $tab_Brand = modelBrand::getAll();
     $tab_Cat = modelCategory::getAll();
     $pagetitle = "Enregistrer un Modele";
     require "{$ROOT}{$DS}view{$DS}{$layout}.php";
     break;
 case 'created':
     $pagetitle = "Modele Enregistré";
     $view = 'created';
     $m = modelModele::countElem();
     $idModele = $m['ResCount'] + 1;
     $name = $_POST['name'];
     $price = $_POST['price'];
     $description = $_POST['description'];
     $nameCat = $_POST['category'];
     $nameBrand = $_POST['brand'];
     //echo ( " $idModele , $name , $price , $description ,$nameCat  , $nameBrand "); // POUR TEST
Exemplo n.º 2
0
<?php

/**
 * Created by PhpStorm.
 * User: enzo
 * Date: 27/10/15
 * Time: 18:13
 */
require "{$ROOT}{$DS}model{$DS}modelBrand.php";
switch ($action) {
    case 'readAll':
        $view = 'All';
        $pagetitle = 'Brand page';
        $tab_brand = modelBrand::getAll();
        break;
    case 'read':
        $pagetitle = $_GET['idBrand'];
        $brand = modelBrand::select($_GET['idBrand']);
        break;
    case 'modelOf':
        $pagetitle = $_GET['brand'];
        $view = 'ModelOf';
        $tab_modele = modelBrand::getModelOfBrand($_GET['brand']);
        break;
}
require "{$ROOT}{$DS}view{$DS}{$layout}.php";
Exemplo n.º 3
0
    <ul >
        <li>
            <a href=""> Shop</a>
        </li>
        <li>
            <a href=""> News</a>
        </li>
        <li>
            <a href=""> Categories </a>
        </li>
        <li>
            <a href="index.php?controller=brand" > Marques </a>
            <ul class="dropdown">
                <?php 
// drop down menu
foreach (modelBrand::getAll() as $b) {
    ?>
                    <li> <a href=<?php 
    echo "index.php?controller=brand&action=read&idBrand={$b->getIdBrand()}";
    ?>
>
                            <?php 
    echo $b->getIdBrand();
    ?>
                        </a>
                    </li>
                <?php 
}
?>
            </ul>
        </li>