diff --git a/controller/fact.php b/controller/fact.php index 7b12500dd9e5c9af1a9b8fb08bbe6960a2995df6..ffc71da7ddb28e242d1690f34a564f81aa3f392e 100644 --- a/controller/fact.php +++ b/controller/fact.php @@ -4,7 +4,7 @@ */ // Implemented actions -$actions = array("listeFacture", "addFacture", "editFacture", "detailFacture"); +$actions = array("listeFacture", "addFacture", "detailFacture"); // Check action is correct if(!in_array($action, $actions)) { @@ -21,17 +21,11 @@ switch($action) { $formConf = $facture->getForm(); include 'view/form.php'; break; - case "editFacture": - $facture = new Facture(); - $facture->select($_GET['id']); - $formConf = $facture->getForm(); - include 'view/form.php'; - break; case "detailFacture": $facture = new Facture(); $facture->select($_GET['id']); $formConf = $facture->getForm(); - include 'view/detail.php'; + include 'view/formDetail.php'; break; default: include 'view/404.php'; diff --git a/view/formDetail.php b/view/formDetail.php new file mode 100644 index 0000000000000000000000000000000000000000..438b4295747f5d9f92d3e7da23ee84abe8a97e2b --- /dev/null +++ b/view/formDetail.php @@ -0,0 +1,33 @@ +<!-- Begin page content --> +<div class="container"> + <div class="page-header"> + <h1><?php echo $formConf->getTitle(); ?></h1> + </div> + + <table class="table"> + <thead> + <?php foreach($list->getLabels() as $field): ?> + <th><?php echo $field->label; ?></th> + <?php endforeach; ?> + <th></th> + </thead> + <tbody> + <?php foreach($list->getLines() as $line): ?> + <tr> + <?php foreach($line->getFields() as $field): ?> + <td><?php echo $field->show(); ?></td> + <?php endforeach; ?> + </tr> + <?php endforeach; ?> + </tbody> + </table> + + <?php echo $formConf->getAlerts(); ?> + <form role="form" method="post"> + <input type="hidden" name="submitForm" value="1"> + <?php foreach($formConf->getFields() as $field): ?> + <?php echo $field->html($formConf); ?> + <?php endforeach; ?> + <button type="submit" class="btn btn-default"><?php echo $formConf->getSubmitText(); ?></button> + </form> +</div> \ No newline at end of file diff --git a/view/stats.php b/view/stats.php index a5dc5edfae98a23101adb3bd49f9f919fd7c1e38..82df43d843fefaf9a63c39978c2c2e5c4133b07e 100644 --- a/view/stats.php +++ b/view/stats.php @@ -11,8 +11,8 @@ </thead> <tbody> <tr> + <td>Nombre moyen d'animal par client : </td> <td><?php $tmp = $stats->nbAnimalMoyClient(); echo $tmp["value"]; ?></td> - <td>l2</td> </tr> </tbody> </table>