/** * Creates an panier object based on a DB row. * * @param array $row The DB row containing Pneu data. * @return \PneuMoney\Domain\Pneu */ protected function buildDomainObject($row) { $panier = new panier(); $panier->setQuantite($row['pa_quantite']); if (array_key_exists('pa_idPneu', $row)) { // Find and set the associated article $pneuId = $row['pa_idPneu']; $pneu = $this->pneuDAO->find($pneuId); $comment->setIdPneu($pneu); } if (array_key_exists('pa_mailUser', $row)) { // Find and set the associated author $userId = $row['pa_mailUser']; $user = $this->userDAO->find($userId); $comment->setIdUser($user); } return $panier; }
/** * Méthode de traitement du hook plxShowStaticListEnd * * @return stdio * @author David.L **/ public function plxShowStaticListEnd() { $positionMenu = $this->getParam('menu_position') - 1; if (in_array($this->getParam("affPanier"), array("pageSeparee", "partout"))) { // ajout du lien vers le panier $nomPlugin = __CLASS__; $panierSelectionne = "static" === $this->plxMotor->mode && $nomPlugin === $this->plxMotor->cible && "panier" === get_class($this->vue); $classeCss = $panierSelectionne ? "active" : "noactive"; $lienPanier = $this->plxMotor->urlRewrite("index.php?boutique/panier"); require_once "classes/vues/panier.php"; $vuePanier = new panier(); $vuePanier->plxPlugin = $this; $titreProtege = plxMyShop::nomProtege($vuePanier->titre()); echo "<?php"; echo "\tarray_splice(\$menus, {$positionMenu}, 0"; echo "\t\t, '<li><a class=\"static {$classeCss}\" href=\"{$lienPanier}\" title=\"' . htmlspecialchars('{$titreProtege}') . '\">{$titreProtege}</a></li>'"; echo "\t);"; echo "?>"; } if ("pageSeparee" !== $this->getParam("affPanier")) { $lienPanier = $this->plxMotor->urlRewrite("#panier"); } $this->donneesModeles["lienPanier"] = $lienPanier; # ajout du menu pour accèder aux rubriques if (isset($this->aProds) && is_array($this->aProds)) { foreach (array_reverse($this->aProds) as $k => $v) { if ($v['menu'] != 'non' && $v['menu'] != '') { $nomProtege = self::nomProtege($v['name']); $categorieSelectionnee = "product" === $this->plxMotor->mode && "product{$k}/{$v["url"]}" === $this->plxMotor->get; $classeCss = $categorieSelectionnee ? "active" : "noactive"; $lien = $this->plxMotor->urlRewrite("index.php?product{$k}/{$v["url"]}"); echo "<?php"; echo "\tarray_splice(\$menus, {$positionMenu}, 0"; echo "\t\t, '<li><a class=\"static {$classeCss}\" href=\"{$lien}\" title=\"' . htmlspecialchars('{$nomProtege}') . '\">{$nomProtege}</a></li>'"; echo "\t);"; echo "?>"; } } } }
<?php require 'db.php'; require 'paniers.class.php'; $db = new db(); $panier = new panier($db); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>Starter Template for Bootstrap</title> <!-- Bootstrap core CSS --> <link href="lib/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"> <link href="lib/bootstrap/dist/css/bootstrap-theme.min.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="web/css/main.css" rel="stylesheet"> </head> <body> <!-- Navigation --> <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="container"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span>