Skip to content

Commit

Permalink
ajout du menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Franck-Roth committed May 6, 2020
1 parent fa016be commit cc5c14d
Show file tree
Hide file tree
Showing 14 changed files with 50 additions and 41 deletions.
Binary file added .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
db.php
.idea
DS_Store
public/assets/uploads/

Binary file added public/assets/uploads/5eb1c8e666f7f.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/uploads/5eb1c92d4aa56.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/uploads/5eb1c9528bb53.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/uploads/5eb2b7cde943e.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/uploads/5eb2b807464dd.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/uploads/5eb2b9cc1960f.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/uploads/5eb2c18c22d90.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/uploads/5eb2c30e199bc.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/uploads/5eb2c3e69ec1f.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 12 additions & 12 deletions src/Model/BouquetManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@ class BouquetManager extends AbstractManager
{
const TABLE = "bouquet";

/**
*init this class.
*/
/**
*init this class.
*/
public function __construct()
{
parent::__construct(self::TABLE);
}


/**
* test
*/
/**
* test
*/
public function insert(array $bouquet): int
{
// prepared request
$statement = $this->pdo->prepare("INSERT INTO " . self::TABLE . " (nom, prix, description, saisonnier)
VALUES (:nom, :prix, :description, :saisonnier)");
$statement->bindValue('nom', $bouquet['nom'], \PDO::PARAM_STR);
$statement->bindValue('prix', $bouquet['prix'], \PDO::PARAM_INT);
$statement->bindValue('prix', $bouquet['prix'], \PDO::PARAM_STR);
$statement->bindValue('description', $bouquet['description'], \PDO::PARAM_STR);
$statement->bindValue('saisonnier', $bouquet['saisonnier'], \PDO::PARAM_BOOL);
$statement->bindValue('saisonnier', $bouquet['saisonnier'], \PDO::PARAM_STR);

if ($statement->execute()) {
return (int)$this->pdo->lastInsertId();
Expand All @@ -39,13 +39,13 @@ public function insert(array $bouquet): int
public function update(array $bouquet): bool
{
$statement = $this->pdo->prepare("UPDATE " . self::TABLE .
" SET nom = :nom, prix = :prix, description = :description, saisonnier = :saisonnier WHERE id=:id");
" SET nom = :nom, prix = :prix, description = :description, saisonnier = :saisonnier WHERE id=:id");
$statement->bindValue('id', $bouquet['id'], \PDO::PARAM_INT);
$statement->bindValue('nom', $bouquet['nom'], \PDO::PARAM_STR);
$statement->bindValue('prix', $bouquet['prix'], \PDO::PARAM_INT);
$statement->bindValue('prix', $bouquet['prix'], \PDO::PARAM_STR);
$statement->bindValue('description', $bouquet['description'], \PDO::PARAM_STR);
$statement->bindValue('saisonnier', $bouquet['saisonnier'], \PDO::PARAM_BOOL);
$statement->bindValue('saisonnier', $bouquet['saisonnier'], \PDO::PARAM_STR);

return $statement->execute();
}
/**
Expand Down
12 changes: 9 additions & 3 deletions src/View/Bouquet/_form.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@
<input class="uk-inline uk-input uk-margin" type="text" value="{{ bouquet.prix }}" name="prix">
<label for="description">Description:</label>
<input class="uk-inline uk-input uk-margin" type="text" value="{{ bouquet.description }}" name="description">
<label for="saisonnier">Saisonnier</label>
<input class="uk-inline uk-input uk-margin" type="text" value="{{ bouquet.saisonnier }}" name="saisonnier">
<select class="uk-select uk-margin uk-inline" name="saisonnier">
<option type="text" value="Anniversaire">Anniversaire</option>
<option type="text" value="Mariage">Mariage</option>
<option type="text" value="Naissance">Naissance</option>
<option type="text" value="Deuil">Deuil</option>
<option type="text" value="Remerciement">Remerciement</option>
<option type="text" value="Amour">Amour</option>
</select>
Selection de l'image :
<div class="uk-margin" uk-margin>
<div uk-form-custom="target: true">
Expand All @@ -20,4 +26,4 @@
<button name="submit" type="submit" value="UploadImage" class="uk-button uk-button-primary">Submit</button>
</div>
</form>
</section>
</section>
53 changes: 28 additions & 25 deletions strasbouquet.sql
Original file line number Diff line number Diff line change
Expand Up @@ -103,20 +103,6 @@ CREATE TABLE `galerie` (

-- --------------------------------------------------------

--
-- Structure de la table `panier`
--

CREATE TABLE `panier` (
`id` int(11) NOT NULL,
`id_bouquet` int(11) DEFAULT NULL,
`prix_total` float DEFAULT NULL,
`id_user` int(11) NOT NULL,
`date` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

-- --------------------------------------------------------

--
-- Structure de la table `user`
--
Expand All @@ -140,6 +126,22 @@ INSERT INTO `user` (`id`, `firstname`, `lastname`, `password`, `mail`, `role`, `
(1, 'Client', 'CLIENT', '$2y$10$MMoyn41UdQUEcRbD9ksbiO0aOv4uM0lwmDLI8TkgYhIe2hKTJguKK', '[email protected]', 'client', NULL, '0203568956'),
(2, 'Admin', 'SUPER', '$2y$10$i/jG7MGyAvlsGSLaq0NVQ.I7fdYfdcsQhRTu9pOaJfIhd5NLnY062', '[email protected]', 'admin', NULL, '0356895689');


----------------------------------------------------

--
-- Structure de la table `panier`
--

CREATE TABLE `panier` (
`id` int(11) NOT NULL,
`id_bouquet` int(11) DEFAULT NULL,
`prix_total` float DEFAULT NULL,
`id_user` int(11) NOT NULL,
`date` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


--
-- Index pour les tables exportées
--
Expand Down Expand Up @@ -186,19 +188,19 @@ ALTER TABLE `galerie`
ADD KEY `galerie_ibfk_1` (`id_bouquet`),
ADD KEY `galerie_ibfk_2` (`id_catalogue_unitaire`);

--
-- Index pour la table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`);

--
-- Index pour la table `panier`
--
ALTER TABLE `panier`
ADD PRIMARY KEY (`id`),
ADD KEY `id_user` (`id_user`);

--
-- Index pour la table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT pour les tables exportées
--
Expand All @@ -223,17 +225,18 @@ ALTER TABLE `catalogue_unitaire`
--
ALTER TABLE `galerie`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT pour la table `panier`
--
ALTER TABLE `panier`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT pour la table `panier`
--
ALTER TABLE `panier`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Contraintes pour les tables exportées
--

Expand Down

0 comments on commit cc5c14d

Please sign in to comment.