Skip to content
Snippets Groups Projects
Commit fa9913ec authored by clement's avatar clement
Browse files

Merge branch 'master' of gitlab.utc.fr:nf17-camp-p14/clivi

parents b4201aea 7eeee32b
No related branches found
No related tags found
No related merge requests found
......@@ -89,4 +89,15 @@ class Objet
throw new Exception("RESULT : ".print_r($result,true)."\n".print_r($requete_prepare->errorInfo(),true));
}
}
public function select($id) {
$dbName = self::dbName();
$bdd = new Db();
$requete_prepare = $bdd->db->prepare("SELECT * FROM ".$dbName." WHERE ".$this->primaryAttr." = :id"); // on prépare notre requête
$requete_prepare->execute(array("id" => $id));
$ligne = $requete_prepare->fetch(PDO::FETCH_ASSOC);
$this->fromDb($ligne);
}
}
\ No newline at end of file
......@@ -38,11 +38,13 @@ switch($action) {
break;
case "editPersonnel":
$employe = new Employe();
$employe->select($_GET['id']);
$formConf = $employe->getForm();
include 'view/form.php';
break;
case "editClient":
$client = new Client();
$client->select($_GET['id']);
$formConf = $client->getForm();
include 'view/form.php';
break;
......
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