diff --git a/class/employe.php b/class/employe.php index eeaca3029cb26804491a9e43443d671d82114790..3602ee56b5c8172537be29070f0e6cd4cf890ee4 100644 --- a/class/employe.php +++ b/class/employe.php @@ -2,26 +2,26 @@ class Employe extends Personne { - protected $idNational; - protected $isVeterinaire; + protected $id_national; + protected $is_veterinaire; - public function idNational() + public function id_national() { - return $this->idNational; + return $this->id_national; } - public function setIdNational($idNational) + public function setId_national($id_national) { - $this->idNational = $idNational; + $this->id_national = $id_national; } - public function isVeterinaire() + public function is_veterinaire() { - return $this->isVeterinaire; + return $this->is_veterinaire; } - public function setIsVeterinaire($isVeterinaire) + public function setIs_veterinaire($isVeterinaire) { - $this->isVeterinaire = $isVeterinaire; + $this->is_veterinaire = $isVeterinaire; } } \ No newline at end of file diff --git a/class/objet.php b/class/objet.php index 149d5a3c9af77b8f66df40cc2f56c8a7c59a0183..5f5646adf45906d83795bdd9cc40feb08b6d195b 100644 --- a/class/objet.php +++ b/class/objet.php @@ -74,14 +74,8 @@ class Objet $params[$keyName] = $this->$keyName; } - //$req = "INSERT INTO ".$dbName." (".implode(",", array_keys($values)).") - //VALUES (".implode(",", array_values($values)).")"; - $req = "INSERT INTO client (id,nom,prenom,num_tel) VALUES (nextval('client_id_seq'::regclass), :nom, :prenom, :num_tel)"; - - - //debug - //echo $req; - //die(); + $req = "INSERT INTO ".$dbName." (".implode(",", array_keys($values)).") + VALUES (".implode(",", array_values($values)).")"; $requete_prepare = $bdd->db->prepare($req); // on prépare notre requête diff --git a/controller/personne.php b/controller/personne.php index cb8566485f94102395767460888303fb90cc48e9..e53814d160caece32bef830a224fe39ec5e02078 100644 --- a/controller/personne.php +++ b/controller/personne.php @@ -15,14 +15,14 @@ switch($action) { case "listePersonnel": $listArray = Employe::getAll(); $listParams = array("title" => "Liste du personnel", - "keys" => array("id", "nom", "prenom", "isVeterinaire", "idNational")); + "keys" => array("id", "nom", "prenom", "is_veterinaire", "id_national")); $editLink = "editPersonnel"; include 'view/list.php'; break; case "listeClient": $listArray = Client::getAll(); $listParams = array("title" => "Liste des clients", - "keys" => array("id", "nom", "prenom", "numTel")); + "keys" => array("id", "nom", "prenom", "num_tel")); $editLink = "editClient"; include 'view/list.php'; break;