Skip to content
Extraits de code Groupes Projets
Valider d8c52929 rédigé par Olivier BÈGUE's avatar Olivier BÈGUE
Parcourir les fichiers

Correction MVC

parent 6c32fa62
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Affichage de avec 178 ajouts et 24 suppressions
......@@ -3,8 +3,8 @@
if (isset($_SESSION['login']))
{
//$db_utilisateur = NULL; // TODO Appel à la base pour récupérer l'utilisateur selon son ariseID = $_SESSION['login']
//$utilisateur = new Utilisateur($db_utilisateur['ariseID'],$db_utilisateur['prenom'],$db_utilisateur['nom'],$db_utilisateur['pseudo'],$db_utilisateur['isAdmin']);
//$utilisateur->setCommandes($db_utilisateur['commandes']);
//$utilisateur = new Utilisateur($db_utilisateur['ariseID'],$db_utilisateur['prenom'],$db_utilisateur['nom'],$db_utilisateur['pseudo'],$db_utilisateur['isAdmin'],$db_utilisateur['commandes']);
if ($_SESSION['login'] == "begue2018")
{
$utilisateur = new Utilisateur($_SESSION['login'],"Olivier","BEGUE","Jed",FALSE,array());
......@@ -15,7 +15,7 @@ if (isset($_SESSION['login']))
}
elseif ($_SESSION['login'] == "invite")
{
$utilisateur = new Utilisateur($_SESSION['login'],"Invité","","",FALSE,array());
$utilisateur = new Utilisateur($_SESSION['login'],"","","Invité",FALSE,array());
}
else
{
......
<!DOCTYPE html>
<html>
<body>
<div class="panel-body">
<form action="../Model/set_commande.php" method="POST">
<?php
$current_commande['food_type_id'] = 0;
$current_commande['sauces_count'] = 0;
$current_commande['meats_choice'] = 0;
$current_commande['size_choice'] = 0;
foreach ($foods as $food_id => $food)
{
if ($current_commande['food_type_id'] != $food['food_type_id'])
<div class="panel panel-default">
<div class="panel-heading text-center">
<strong>Choisissez votre repas ! • Plus de détails <a href="http://www.obigdelice.fr">ici</a></strong><br/>
<small>(Pour commander la même chose plusieurs fois, faites une nouvelle commande)</small>
</div>
<div class="panel-body">
<form action="../Controller/set_commande.php" method="POST">
<?php
$current_commande['food_type_id'] = 0;
$current_commande['sauces_count'] = 0;
$current_commande['meats_choice'] = 0;
$current_commande['size_choice'] = 0;
foreach ($foods as $food_id => $food)
{
if ($current_commande['food_type_id'] != 0)
if ($current_commande['food_type_id'] != $food['food_type_id'])
{
if ($current_commande['meats_choice'] != 0 || $current_commande['sauces_count'] != 0 || $current_commande['size_choice'] != 0)
{?>
<div id=<?php echo 'hidden-'.$current_commande['food_type_id']?> class="well" style="margin: 15px 10px;">
if ($current_commande['food_type_id'] != 0)
{
if ($current_commande['meats_choice'] != 0 || $current_commande['sauces_count'] != 0 || $current_commande['size_choice'] != 0)
{?>
<div id=<?php echo 'hidden-'.$current_commande['food_type_id']?> class="well" style="margin: 15px 10px;">
<?php
if ($current_commande['sauces_count'] != 0)
display_sauces($current_commande['food_type_id'], $current_commande['sauces_count']);
if ($current_commande['meats_choice'] != 0 && $current_commande['sauces_count'] != 0)
echo '<br/>';
if ($current_commande['meats_choice'] != 0)
display_meats($current_commande['food_type_id']);
if ($current_commande['size_choice'] != 0)
display_sizes($current_commande['food_type_id']);
echo '</div>';
}
}?>
<div class="input-group">
<label for=<?php echo $food['food_type_id'] ?>:food class="input-group-addon"><?php echo $food['food_type_title']?></label>
<select name=<?php echo $food['food_type_id']?>:food class="form-control" data-food-type=<?php echo $food['food_type_id']?>>
<option value="0">Cliquez pour voir les choix</option>
<?php
if ($current_commande['sauces_count'] != 0)
display_sauces($current_commande['food_type_id'], $current_commande['sauces_count']);
if ($current_commande['meats_choice'] != 0 && $current_commande['sauces_count'] != 0)
echo '<br/>';
if ($current_commande['meats_choice'] != 0)
display_meats($current_commande['food_type_id']);
if ($current_commande['size_choice'] != 0)
display_sizes($current_commande['food_type_id']);
echo '</div>';
}
}?>
<div class="input-group">
<label for=<?php echo $food['food_type_id'] ?>:food class="input-group-addon"><?php echo $food['food_type_title']?></label>
<select name=<?php echo $food['food_type_id']?>:food class="form-control" data-food-type=<?php echo $food['food_type_id']?>>
<option value="0">Cliquez pour voir les choix</option>
<?php
$current_commande['food_type_id'] = $food['food_type_id'];
$current_commande['sauces_count'] = $food['sauces_count'];
$current_commande['meats_choice'] = $food['meats_choice'];
$current_commande['size_choice'] = $food['size_choice'];
}
if ($food['price'] != 0)
{?>
<option value=<?php echo $food_id?> data-max-meats=<?php echo $food['meats_count']?>><?php echo $food['food_title'].":".$food['price']."€"?></option>';
<?php
}
else
{?>
<option value=<?php echo $food_id?> data-max-meats=<?php $food['meats_count']?>><?php echo $food['food_title']?></option>
<?php
}
echo '</div>';
if ($current_commande['meats_choice'] != 0 || $current_commande['sauces_count'] != 0 || $current_commande['size_choice'] != 0)
{
echo '<div id="hidden-'.$current_commande['food_type_id'].'" class="well" style="margin: 15px 10px;">';
if ($current_commande['sauces_count'] != 0)
display_sauces($current_commande['food_type_id'], $current_commande['sauces_count']);
if ($current_commande['meats_choice'] != 0 && $current_commande['sauces_count'] != 0)
echo '<br/>';
if ($current_commande['meats_choice'] != 0)
display_meats($current_commande['food_type_id']);
if ($current_commande['size_choice'] != 0)
display_sizes($current_commande['food_type_id']);
$current_commande['food_type_id'] = $food['food_type_id'];
$current_commande['sauces_count'] = $food['sauces_count'];
$current_commande['meats_choice'] = $food['meats_choice'];
$current_commande['size_choice'] = $food['size_choice'];
}
if ($food['price'] != 0)
{?>
<option value=<?php echo $food_id?> data-max-meats=<?php echo $food['meats_count']?>><?php echo $food['food_title'].":".$food['price']."€"?></option>';
<?php
}
else
{?>
<option value=<?php echo $food_id?> data-max-meats=<?php $food['meats_count']?>><?php echo $food['food_title']?></option>
<?php
}
echo '</div>';
echo '<hr/>';?>
<input type="hidden" name="submitted"/>
<button class="btn btn-primary btn-block btn-lg" type="submit">Commander</button>
<?php
}
}?>
</form>
</div>
if ($current_commande['meats_choice'] != 0 || $current_commande['sauces_count'] != 0 || $current_commande['size_choice'] != 0)
{
echo '<div id="hidden-'.$current_commande['food_type_id'].'" class="well" style="margin: 15px 10px;">';
if ($current_commande['sauces_count'] != 0)
display_sauces($current_commande['food_type_id'], $current_commande['sauces_count']);
if ($current_commande['meats_choice'] != 0 && $current_commande['sauces_count'] != 0)
echo '<br/>';
if ($current_commande['meats_choice'] != 0)
display_meats($current_commande['food_type_id']);
if ($current_commande['size_choice'] != 0)
display_sizes($current_commande['food_type_id']);
echo '</div>';
echo '<hr/>';?>
<input type="hidden" name="submitted"/>
<button class="btn btn-primary btn-block btn-lg" type="submit">Commander</button>
<?php
}
}?>
</form>
</div>
</div>
<script type="text/javascript">
var current_max_meats = 0;
......
......@@ -26,10 +26,10 @@ else
<script>
function login()
{
window.location.href = "Controller/connexion_form.php"
window.location.href = "View/connexion_form.php"
}
function logout()
{
window.location.href = "Model/logout.php"
window.location.href = "Controller/logout.php"
}
</script>
......@@ -5,7 +5,7 @@
</head>
<body>
<form action="../Model/login.php" method="post">
<form action="../Controller/login.php" method="post">
Votre login : <input type="text" name="login">
<br/>
Votre mot de passe : <input type="password" name="pwd"><br />
......
<html>
<body>
<div class="text-center">
<div><strong class="text-danger">Merci de vous identifier à AriseID pour commander !</strong></div>
<div class="panel panel-default">
<div class="panel-body">
<div class="text-center">
<div><strong class="text-danger">Merci de vous identifier pour commander !</strong></div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<body>
<div class="panel panel-default">
<div class="panel-heading text-center">
<strong>Choisissez votre repas ! • Plus de détails <a href="http://www.obigdelice.fr">ici</a></strong><br/>
<small>(Pour commander la même chose plusieurs fois, faites une nouvelle commande)</small>
</div>
</body>
</html>
\ No newline at end of file
......@@ -6,7 +6,7 @@ require_once('Model/Classes/Commande.php');
require_once('Model/Classes/Evenement.php');
require_once('Model/Classes/Menu.php');
require_once('Model/Classes/Special.php');
require_once("Model/set_utilisateur.php");
require_once("Controller/set_utilisateur.php");
require_once('Model/infos_njv.php');
include('View/page_titre.php');
......@@ -15,15 +15,14 @@ include('View/head.php');
include('View/body_titre.php');
include("Controller/connexion_bouton.php");
include("View/connexion_bouton.php");
include('View/accueil_utilisateur.php');
include('View/deadline_commande.php');
if ($utilisateur != NULL)
{
include('View/deadline_commande.php');
include('View/panel_commande.php');
include('Controller/commande_form.php');
include('View/commande_finie.php');
include('View/commande_form.php');
}
else
{
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter