Skip to content
Snippets Groups Projects
Commit 73806ba8 authored by Matthieu Guffroy's avatar Matthieu Guffroy
Browse files

view list

parent 0ed8fed3
No related branches found
No related tags found
No related merge requests found
......@@ -19,8 +19,8 @@ class Objet
$bdd = new Db();
$result = Array();
$requete_prepare = $bdd->db->prepare("SELECT * FROM client"); // on prépare notre requête
$requete_prepare->execute(); //array( 'table' => $dbName ));
$requete_prepare = $bdd->db->prepare("SELECT * FROM :table"); // on prépare notre requête
$requete_prepare->execute(array( 'table' => $dbName ));
while($ligne = $requete_prepare->fetch(PDO::FETCH_ASSOC)) {
$temp = new $className();
......
......@@ -16,7 +16,8 @@ switch($action) {
break;
case "listeClient":
$listArray = Client::getAll();
$listParams = array("title" => "Liste des clients");
$listParams = array("title" => "Liste des clients"
"keys" => array("id", "nom", "prenom", "numTel"));
include 'view/list.php';
break;
case "addPersonnel":
......
<!-- Begin page content -->
<div class="container">
<div class="page-header">
<!-- Begin page content -->
<div class="container">
<div class="page-header">
<h1><?php echo $listParams["title"]; ?></h1>
</div>
<pre>
<?php print_r($listArray); ?>
</pre>
</div>
\ No newline at end of file
</div>
<table class="table">
<thead>
</thead>
<tbody>
<?php foreach($listArray as $line): ?>
<tr>
<?php foreach($listParams["keys"] as $key): ?>
<td><?php echo $line[$key]; ?></td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<pre>
<?php print_r($listArray); ?>
</pre>
</div>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment