diff --git a/class/animal.php b/class/animal.php index 6d408692f347201564ef9188371d48bfd50a302a..0336487a516c40909d93971d8cbd4a93c0de27ef 100644 --- a/class/animal.php +++ b/class/animal.php @@ -4,15 +4,25 @@ class Animal extends Objet { protected $id; protected $nom; - protected $proprio; + protected $client; protected $race; protected $poids; protected $genre; protected $sterile; - protected $dateNaissance; - protected $dateDeces; + protected $date_naissance; + protected $date_deces; protected $taille; protected $code; + public $_specialFields = array( + "sterile" => array( + "t" => "BoolField" + ), + "client" => array( + "t" => "ForeignField" + ), + "race" => array( + "t" => "ForeignField" + )); public function id() { @@ -34,14 +44,14 @@ class Animal extends Objet $this->nom = $nom; } - public function proprio() + public function client() { - return $this->proprio; + return $this->client; } - public function setProprio($proprio) + public function setClient($client) { - $this->proprio = $proprio; + $this->client = $client; } public function race() @@ -84,24 +94,24 @@ class Animal extends Objet $this->sterile = $sterile; } - public function dateNaissance() + public function date_naissance() { - return $this->dateNaissance; + return $this->date_naissance; } - public function setDateNaissance($dateNaissance) + public function setDate_naissance($date_naissance) { - $this->dateNaissance = $dateNaissance; + $this->date_naissance = $date_naissance; } - public function dateDeces() + public function date_deces() { - return $this->dateDeces; + return $this->date_deces; } - public function setDateDeces($dateDeces) + public function setDate_deces($date_deces) { - $this->dateDeces = $dateDeces; + $this->date_deces = $date_deces; } public function taille() @@ -123,4 +133,8 @@ class Animal extends Objet { $this->code = $code; } + + public function str() { + return $this->nom; + } } \ No newline at end of file diff --git a/class/boolfield.php b/class/boolfield.php index ecef7cce07df34edc9ca92912b84062ee420e03b..4cabe2e0e3f0ed1e1b1e458ce52a961e2ac2c311 100644 --- a/class/boolfield.php +++ b/class/boolfield.php @@ -1,14 +1,16 @@ -<? +<?php + class BoolField extends Field { - public function html() { + + public function html($form) { + if ($this->value) {$checked = "checked";} else {$checked = false;} $html = '<div class = "checkbox"> <label for = "form'.$this->name.'"> - <input type = "checkbox" name = "'.$this->name.'" value ="'.$this->value.'"> '.ucfirst($this->name).' + <input type = "checkbox" name = "'.$this->name.'" value ="'.$this->value.'" '.$checked.'> '.ucfirst($this->name).' </label> </div>'; - return $html; } public function validate() diff --git a/class/employe.php b/class/employe.php index 3602ee56b5c8172537be29070f0e6cd4cf890ee4..be84cec62b1d4f1bf1f273fd6d24903723d60dcb 100644 --- a/class/employe.php +++ b/class/employe.php @@ -4,6 +4,10 @@ class Employe extends Personne { protected $id_national; protected $is_veterinaire; + public $_specialFields = array( + "is_veterinaire" => array( + "t" => "BoolField" + )); public function id_national() { @@ -20,8 +24,8 @@ class Employe extends Personne return $this->is_veterinaire; } - public function setIs_veterinaire($isVeterinaire) + public function setIs_veterinaire($is_veterinaire) { - $this->is_veterinaire = $isVeterinaire; + $this->is_veterinaire = $is_veterinaire; } } \ No newline at end of file diff --git a/class/espece.php b/class/espece.php index 4430fd1440fcf2e0214ae36e049ccb5a25b90a36..f187cad5460edcc975e8ffda9dfbadb316e48897 100644 --- a/class/espece.php +++ b/class/espece.php @@ -2,8 +2,19 @@ class Espece extends Objet { + protected $id; protected $nom; - protected $prixConsult; + protected $prix_consultation; + + public function id() + { + return $this->id; + } + + public function setId($id) + { + $this->id = $id; + } public function nom() { @@ -15,13 +26,13 @@ class Espece extends Objet $this->nom = $nom; } - public function prixConsult() + public function prix_consultation() { - return $this->prixConsult; + return $this->prix_consultation; } - public function setPrixConsult($prixConsult) + public function setPrix_consultation($prix_consultation) { - $this->prixConsult = $prixConsult; + $this->prix_consultation = $prix_consultation; } } \ No newline at end of file diff --git a/class/facture.php b/class/facture.php index d466928070e2a34efd680b5f50a19fa01bf439ee..3e6421dbc6d8e3e6db1f431e7fc6afcd4e0b2c67 100644 --- a/class/facture.php +++ b/class/facture.php @@ -5,10 +5,17 @@ class Facture extends Objet protected $id; protected $employe; protected $animal; - protected $dateEdition; - protected $datePaiement; - protected $moyenPaiement; - protected $prixTotal; + protected $date_edition; + protected $date_paiement; + protected $moyen_paiement; + protected $prix_total; + public $_specialFields = array( + "employe" => array( + "t" => "ForeignField" + ), + "animal" => array( + "t" => "ForeignField" + )); public function id() { @@ -40,43 +47,43 @@ class Facture extends Objet $this->animal = $animal; } - public function dateEdition() + public function date_edition() { - return $this->dateEdition; + return $this->date_edition; } - public function setDateEdition($dateEdition) + public function setDate_edition($date_edition) { - $this->dateEdition = $dateEdition; + $this->date_edition = $date_edition; } - public function datePaiement() + public function date_paiement() { - return $this->datePaiement; + return $this->date_paiement; } - public function setDatePaiement($datePaiement) + public function setDate_paiement($date_paiement) { - $this->datePaiement = $datePaiement; + $this->date_paiement = $date_paiement; } - public function moyenPaiement() + public function moyen_paiement() { - return $this->moyenPaiement; + return $this->moyen_paiement; } - public function setMoyenPaiement($moyenPaiement) + public function setMoyen_paiement($moyen_paiement) { - $this->moyenPaiement = $moyenPaiement; + $this->moyen_paiement = $moyen_paiement; } - public function prixTotal() + public function prix_total() { - return $this->prixTotal; + return $this->prix_total; } - public function setPrixTotal($prixTotal) + public function setPrix_total($prix_total) { - $this->prixTotal = $prixTotal; + $this->prix_total = $prix_total; } } \ No newline at end of file diff --git a/class/field.php b/class/field.php index 1b5016e3f5f7d8c2f9f47b25b0ebfe3309cdca8e..24e8173a46e34944478b90ae3ba4c57a7a9a1cd2 100644 --- a/class/field.php +++ b/class/field.php @@ -3,16 +3,24 @@ class Field { protected $name; protected $value; - public function __construct($name, &$value) { + protected $primary; + + public function __construct($name, &$value, $primary=false) { $this->name = $name; $this->value =& $value; + $this->primary = $primary; } - public function html() { + public function html($form) { // Todo, if isset($_POST[$this->name]) && !$this->validate() => Show a error msg explanation for this line. + $disabled = ""; + + if($this->primary && $form->action == "Ajouter") { return ""; } + if($this->primary && $form->action == "Modifier") { $disabled = "disabled"; } + return '<div class="form-group"> <label for="form'.$this->name.'">'.ucfirst($this->name).'</label> - <input type="text" class="form-control" name="'.$this->name.'" value="'.$this->value.'" > + <input type="text" class="form-control" name="'.$this->name.'" value="'.$this->value.'" '.$disabled.'> </div>'; } @@ -21,12 +29,14 @@ class Field { and return false, if data is not valid ! */ public function validate() { - if (isset($_POST[$this->name])) - { - $this->value = $_POST[$this->name]; + + // On ne peut pas changer la valeur de la clef primaire + if($this->primary && $this->value) { return true; } - return false; + + $this->value = $_POST[$this->name]; + return true; } } diff --git a/class/foreignfield.php b/class/foreignfield.php new file mode 100644 index 0000000000000000000000000000000000000000..4015ff9a10ab2379fb3eb6158f44944eebce3234 --- /dev/null +++ b/class/foreignfield.php @@ -0,0 +1,51 @@ +<?php + +class ForeignField { + protected $name; + protected $value; + protected $primary; + protected $choices; + + public function __construct($name, &$value, $primary=false) { + $this->name = $name; + $this->value =& $value; + $this->primary = $primary; + $cl = ucfirst($name); + $this->choices = $cl::getAll(); + } + + public function html($form) { + // Todo, if isset($_POST[$this->name]) && !$this->validate() => Show a error msg explanation for this line. + $disabled = ""; + + if($this->primary && $form->action == "Ajouter") { return ""; } + if($this->primary && $form->action == "Modifier") { $disabled = "disabled"; } + + $html = '<div class="form-group"> + <label for="form'.$this->name.'">'.ucfirst($this->name).'</label> + <select class="form-control" name="'.$this->name.'">'; + foreach ($this->choices as $value) { + if($this->value == $value->{$value->_primaryAttr}()) { $selected = "selected"; } else { $selected = ""; } + $html .= "<option value=".$value->{$value->_primaryAttr}()." ".$selected." >".$value->str()."</option>"; + } + + $html.= '</select> + </div>'; + return $html; + } + + /* + Load the data from $_POST + and return false, if data is not valid ! + */ + public function validate() { + // On ne peut pas changer la valeur de la clef primaire + if($this->primary && $this->value) { + return true; + } + + $this->value = $_POST[$this->name]; + return true; + } + +} diff --git a/class/form.php b/class/form.php index 0c836fbd1c3a36aa1ec9cbe5ec7b038c67b3bcf2..242146db2624bcdcb55d8553b698f0cb619a9a4c 100644 --- a/class/form.php +++ b/class/form.php @@ -2,7 +2,7 @@ class Form { protected $object; - protected $action; + public $action; protected $error = null; public function __construct(&$obj) { @@ -10,7 +10,7 @@ class Form { $this->fields = $this->object->getFields(); // Update or Insert - if($this->object->{$this->object->primaryAttr}()) { + if($this->object->{$this->object->_primaryAttr}()) { $this->action = "Modifier"; } else { $this->action = "Ajouter"; @@ -32,6 +32,7 @@ class Form { $this->object->update(); } else { $this->object->insert(); + $this->action = "Modifier"; } } catch (Exception $e) { $this->error = $e->getMessage(); diff --git a/class/ligneOrdonnance.php b/class/ligneOrdonnance.php index 668547e70dea426717dcac7ba27c487e3e9b5483..a172c9a20f3353998e3559e94e35d006ca21c84f 100644 --- a/class/ligneOrdonnance.php +++ b/class/ligneOrdonnance.php @@ -3,7 +3,7 @@ class LigneOrdonnance extends Objet { protected $ordonnance; - protected $medicament; + protected $produit; protected $quantite; protected $instruction; @@ -17,14 +17,14 @@ class LigneOrdonnance extends Objet $this->ordonnance = $ordonnance; } - public function medicament() + public function produit() { - return $this->medicament; + return $this->produit; } - public function setMedicament($medicament) + public function setProduit($produit) { - $this->medicament = $medicament; + $this->produit = $produit; } public function quantite() diff --git a/class/objet.php b/class/objet.php index 984c3e14627c2a49414bbafe001757c181183407..e9ca9d41efe0b67c6272b43a7072d1cefcdde9a3 100644 --- a/class/objet.php +++ b/class/objet.php @@ -2,7 +2,8 @@ class Objet { - public $primaryAttr = "id"; + public $_primaryAttr = "id"; + public $_specialFields = array(); public function fromDb($arr) { @@ -51,8 +52,13 @@ class Objet { $ret = array(); foreach(array_keys(get_object_vars($this)) as $keyName) { - if($keyName == "primaryAttr") { continue; } - $ret[] = new Field($keyName, $this->$keyName); + if($keyName[0] == "_") { continue; } + if($keyName == $this->_primaryAttr && $this->_primaryAttr == "id") { $ret[] = new Field($keyName, $this->$keyName, true); continue; } + if(in_array($keyName, array_keys($this->_specialFields))) { + $ret[] = new $this->_specialFields[$keyName]["t"]($keyName, $this->$keyName); + } else { + $ret[] = new Field($keyName, $this->$keyName); + } } return $ret; } @@ -65,10 +71,11 @@ class Objet $values = array(); $params = array(); foreach(array_keys(get_object_vars($this)) as $keyName) { - if($keyName == "primaryAttr") { continue; } - if($keyName == $this->primaryAttr) { + if($keyName[0] == "_") { continue; } + if($keyName == $this->_primaryAttr && $this->_primaryAttr == "id") { $values[$keyName] = "nextval('".$dbName."_id_seq'::regclass)"; continue; + } $values[$keyName] = ":".$keyName; $params[$keyName] = $this->$keyName; @@ -98,13 +105,13 @@ class Objet $values = array(); $params = array(); foreach(array_keys(get_object_vars($this)) as $keyName) { - if($keyName == "primaryAttr") { continue; } + if($keyName[0] == "_") { continue; } $params[$keyName] = $this->$keyName; - if($keyName == $this->primaryAttr) { continue; } + if($keyName == $this->_primaryAttr && $this->_primaryAttr == "id") { continue; } $values[$keyName] = $keyName." = :".$keyName; } - $req = "UPDATE ".$dbName." SET ".implode(",", array_values($values))." WHERE ".$this->primaryAttr." = :".$this->primaryAttr; + $req = "UPDATE ".$dbName." SET ".implode(",", array_values($values))." WHERE ".$this->_primaryAttr." = :".$this->_primaryAttr; $requete_prepare = $bdd->db->prepare($req); // on prépare notre requête @@ -123,10 +130,14 @@ class Objet $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 = $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); } + + public function str() { + return self::dbName()." #".$this->{$this->_primaryAttr}; + } } \ No newline at end of file diff --git a/class/ordonnance.php b/class/ordonnance.php index 38763deb245d191827c6806b778dc4d17672338d..a6c7ceeb5dfcaf775b38c2ee4367fc0acf93b1d3 100644 --- a/class/ordonnance.php +++ b/class/ordonnance.php @@ -3,10 +3,17 @@ class Ordonnance extends Objet { protected $id; - protected $veterinaire; + protected $employe; protected $animal; protected $date; protected $prix; + public $_specialFields = array( + "employe" => array( + "t" => "ForeignField" + ), + "animal" => array( + "t" => "ForeignField" + )); public function id() { @@ -28,14 +35,14 @@ class Ordonnance extends Objet $this->date = $date; } - public function veterinaire() + public function employe() { - return $this->veterinaire; + return $this->employe; } - public function setVeterinaire($veterinaire) + public function setEmploye($employe) { - $this->veterinaire = $veterinaire; + $this->employe = $employe; } public function animal() diff --git a/class/produit.php b/class/produit.php index bc1c018b5a4655c4509287b2315fa1b148820879..9b55e85c4abfb8a4ca3ee5531602574631e60c4c 100644 --- a/class/produit.php +++ b/class/produit.php @@ -5,7 +5,11 @@ class Produit extends Objet protected $id; protected $nom; protected $prix; - protected $isMedicament; + protected $is_medicament; + public $_specialFields = array( + "is_medicament" => array( + "t" => "BoolField" + )); public function id() { @@ -37,13 +41,13 @@ class Produit extends Objet $this->prix = $prix; } - public function isMedicament() + public function is_medicament() { - return $this->isMedicament; + return $this->is_medicament; } - public function setIsMedicament($isMedicament) + public function setis_medicament($is_medicament) { - $this->isMedicament = $isMedicament; + $this->is_medicament = $is_medicament; } } diff --git a/class/race.php b/class/race.php index 2b59f35c9f84b9c13876c900a06fef5443f1627b..7791a02f7f9c45ef1e8c59c01074ad7d40f77d81 100644 --- a/class/race.php +++ b/class/race.php @@ -2,9 +2,24 @@ class Race extends Objet { + protected $id; protected $nom; protected $espece; - protected $prixIntervention; + protected $prix_intervention; + public $_specialFields = array( + "espece" => array( + "t" => "ForeignField" + )); + + public function id() + { + return $this->id; + } + + public function setId($id) + { + $this->id = $id; + } public function nom() { @@ -26,13 +41,13 @@ class Race extends Objet $this->espece = $espece; } - public function prixIntervention() + public function prix_intervention() { - return $this->prixIntervention; + return $this->prix_intervention; } - public function setPrixIntervention($prixIntervention) + public function setPrix_intervention($prix_intervention) { - $this->prixIntervention = $prixIntervention; + $this->prix_intervention = $prix_intervention; } } \ No newline at end of file diff --git a/class/rdv.php b/class/rdv.php index ffcedd838f2877e1795260aad9b41a635da9b131..ccb909519e6aea9a7c23e2da393c6c176ee7724f 100644 --- a/class/rdv.php +++ b/class/rdv.php @@ -3,10 +3,17 @@ class Rdv extends Objet { protected $id; - protected $veterinaire; + protected $employe; protected $animal; protected $date; protected $duree; + public $_specialFields = array( + "employe" => array( + "t" => "ForeignField" + ), + "animal" => array( + "t" => "ForeignField" + )); public function id() @@ -20,14 +27,14 @@ class Rdv extends Objet } - public function veterinaire() + public function employe() { - return $this->veterinaire; + return $this->employe; } - public function setVeterinaire($veterinaire) + public function setEmploye($employe) { - $this->veterinaire = $veterinaire; + $this->employe = $employe; } public function animal() diff --git a/controller/animal.php b/controller/animal.php index 79858d4dab5f68f578da73bad536db071a18b2a0..79bb2362da1ce31975ddc2d7c159ec358cfc26cb 100644 --- a/controller/animal.php +++ b/controller/animal.php @@ -4,7 +4,7 @@ */ // Implemented actions -$actions = array("liste", "add", "edit"); +$actions = array("listeAnimal", "addAnimal", "editAnimal", "listeEspece", "addEspece", "editEspece","listeRace", "addRace", "editRace"); // Check action is correct if(!in_array($action, $actions)) { @@ -12,20 +12,60 @@ if(!in_array($action, $actions)) { } switch($action) { - case "liste": + case "listeAnimal": $listArray = Animal::getAll(); $listParams = array("title" => "Liste des animaux de la clinique", - "keys" => array("nom", "proprio", "race", "poids", "genre", "sterile", "dateNaissance", "dateDeces", "taille", "code")); + "keys" => array("id", "nom", "client", "race", "poids", "genre", "sterile", "date_naissance", "date_deces", "taille", "code")); + $editLink = "editAnimal"; include 'view/list.php'; break; - case "add": + case "addAnimal": $animal = new Animal(); $formConf = $animal->getForm(); include 'view/form.php'; break; - case "edit": - + case "editAnimal": + $animal = new Animal(); + $animal->select($_GET['id']); + $formConf = $animal->getForm(); + include 'view/form.php'; + break; + case "listeEspece": + $listArray = Espece::getAll(); + $listParams = array("title" => "Liste des espèces d'animaux", + "keys" => array("id", "nom", "prix_consultation")); + $editLink = "editEspece"; + include 'view/list.php'; + break; + case "addEspece": + $espece = new Espece(); + $formConf = $espece->getForm(); + include 'view/form.php'; + break; + case "editEspece": + $espece = new Espece(); + $espece->select($_GET['id']); + $formConf = $espece->getForm(); + include 'view/form.php'; + break; + case "listeRace": + $listArray = Race::getAll(); + $listParams = array("title" => "Liste des races", + "keys" => array("id", "nom", "espece", "prix_intervention")); + $editLink = "editRace"; + include 'view/list.php'; + break; + case "addRace": + $race = new Race(); + $formConf = $race->getForm(); + include 'view/form.php'; break; + case "editRace": + $race = new Race(); + $race->select($_GET['id']); + $formConf = $race->getForm(); + include 'view/form.php'; + break; default: include 'view/404.php'; break; diff --git a/controller/fact.php b/controller/fact.php index 39b3b0f8e3851fedf93d0ef24832396f9b021fa0..f8cd55482267c135793444f15b8058dfdd6e72a6 100644 --- a/controller/fact.php +++ b/controller/fact.php @@ -15,13 +15,8 @@ switch($action) { case "liste": $listArray = Facture::getAll(); $listParams = array("title" => "Liste des factures", - "keys" => array("id", "employe", "animal", "dateEdition", "datePaiement", "moyenPaiement", "prixTotal")); - include 'view/list.php'; - break; - case "listePersonnel": - $listArray = Employe::getAll(); - $listParams = array("title" => "Liste du personnel", - "keys" => array("id", "nom", "prenom", "isVeterinaire", "idNational")); + "keys" => array("id", "employe", "animal", "date_edition", "date_paiement", "moyen_paiement", "prix_total")); + $editLink = "edit"; include 'view/list.php'; break; case "add": @@ -30,7 +25,10 @@ switch($action) { include 'view/form.php'; break; case "edit": - + $facture = new Facture(); + $facture->select($_GET['id']); + $formConf = $facture->getForm(); + include 'view/form.php'; break; default: include 'view/404.php'; diff --git a/controller/ord.php b/controller/ord.php index e56df42adf9498be62ce241532751090df61c1fd..e77dcdd225944317042a214c6125741cd1264b18 100644 --- a/controller/ord.php +++ b/controller/ord.php @@ -4,7 +4,7 @@ */ // Implemented actions -$actions = array("liste", "add", "edit"); +$actions = array("liste", "add", "edit", "listeProduit", "addProduit", "editProduit"); // Check action is correct if(!in_array($action, $actions)) { @@ -15,7 +15,8 @@ switch($action) { case "liste": $listArray = Ordonnance::getAll(); $listParams = array("title" => "Liste des ordonnances", - "keys" => array("id", "animal", "veterinaire", "date", "prix")); + "keys" => array("id", "animal", "employe", "date", "prix")); + $editLink = "edit"; include 'view/list.php'; break; case "add": @@ -24,7 +25,28 @@ switch($action) { include 'view/form.php'; break; case "edit": - + $ordonnance = new Ordonnance(); + $ordonnance->select($_GET['id']); + $formConf = $ordonnance->getForm(); + include 'view/form.php'; + break; + case "listeProduit": + $listArray = Produit::getAll(); + $listParams = array("title" => "Liste des ordonnances", + "keys" => array("id", "nom", "prix", "is_medicament")); + $editLink = "editProduit"; + include 'view/list.php'; + break; + case "addProduit": + $ordonnance = new Produit(); + $formConf = $ordonnance->getForm(); + include 'view/form.php'; + break; + case "editProduit": + $produit = new Produit(); + $produit->select($_GET['id']); + $formConf = $produit->getForm(); + include 'view/form.php'; break; default: include 'view/404.php'; diff --git a/controller/rdv.php b/controller/rdv.php index 5f6814fee2ae4c278811005de96a0ef2d5b97df4..63e761e81e3a900524cd5d33498d04faf0d68bc7 100644 --- a/controller/rdv.php +++ b/controller/rdv.php @@ -4,7 +4,7 @@ */ // Implemented actions -$actions = array("liste", "add", "edit"); +$actions = array("liste", "add", "edit", "listePrestation", "addPrestation", "editPrestation"); // Check action is correct if(!in_array($action, $actions)) { @@ -15,7 +15,8 @@ switch($action) { case "liste": $listArray = Rdv::getAll(); $listParams = array("title" => "Liste des rendez-vous", - "keys" => array("id", "animal", "veterinaire", "date", "duree")); + "keys" => array("id", "animal", "employe", "date", "duree")); + $editLink = "edit"; include 'view/list.php'; break; case "add": @@ -24,7 +25,28 @@ switch($action) { include 'view/form.php'; break; case "edit": - + $rdv = new Rdv(); + $rdv->select($_GET['id']); + $formConf = $rdv->getForm(); + include 'view/form.php'; + break; + case "listePrestation": + $listArray = Prestation::getAll(); + $listParams = array("title" => "Liste des prestations", + "keys" => array("id", "description", "type", "prix")); + $editLink = "editPrestation"; + include 'view/list.php'; + break; + case "addPrestation": + $prestation = new Prestation(); + $formConf = $prestation->getForm(); + include 'view/form.php'; + break; + case "editPrestation": + $prestation = new Prestation(); + $prestation->select($_GET['id']); + $formConf = $prestation->getForm(); + include 'view/form.php'; break; default: include 'view/404.php'; diff --git a/template/header.php b/template/header.php index 39876c5257bb16236704817fb1b4794632aac87b..e88b522d558dc906dd3a311a5c60846968983124 100644 --- a/template/header.php +++ b/template/header.php @@ -33,12 +33,9 @@ bottom: 0; width: 100%; /* Set the fixed height of the footer here */ - height: 40px; - background-color: #108a93; - padding-top: 10px; - padding-bottom: 0px; + height: 30px; + background-color: #108a93; text-align: center; - color: black; } diff --git a/template/menu.php b/template/menu.php index e2a90bee5122c9cee5bfb940376b793affdcba48..8da51ba1e219d07eb08c31f551e37e62363209d8 100644 --- a/template/menu.php +++ b/template/menu.php @@ -27,22 +27,41 @@ <li class="dropdown<?php if($page == "animal") { echo " active"; }?>"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Animaux<b class="caret"></b></a> <ul class="dropdown-menu"> - <li><a href="<?php echo $base_url; ?>animal/liste">Liste</a></li> - <li><a href="<?php echo $base_url; ?>animal/add">Ajouter</a></li> + <li class="dropdown-header">Animal</li> + <li><a href="<?php echo $base_url; ?>animal/listeAnimal">Liste</a></li> + <li><a href="<?php echo $base_url; ?>animal/addAnimal">Ajouter</a></li> + <li class="divider"></li> + <li class="dropdown-header">Espece</li> + <li><a href="<?php echo $base_url; ?>animal/listeEspece">Liste</a></li> + <li><a href="<?php echo $base_url; ?>animal/addEspece">Ajouter</a></li> + <li class="divider"></li> + <li class="dropdown-header">Race</li> + <li><a href="<?php echo $base_url; ?>animal/listeRace">Liste</a></li> + <li><a href="<?php echo $base_url; ?>animal/addRace">Ajouter</a></li> </ul> </li> <li class="dropdown<?php if($page == "rdv") { echo " active"; }?>"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Rendez-vous<b class="caret"></b></a> <ul class="dropdown-menu"> + <li class="dropdown-header">Rendez-vous</li> <li><a href="<?php echo $base_url; ?>rdv/liste">Liste</a></li> <li><a href="<?php echo $base_url; ?>rdv/add">Ajouter</a></li> + <li class="divider"></li> + <li class="dropdown-header">Prestation</li> + <li><a href="<?php echo $base_url; ?>rdv/listePrestation">Liste</a></li> + <li><a href="<?php echo $base_url; ?>rdv/addPrestation">Ajouter</a></li> </ul> </li> <li class="dropdown<?php if($page == "ord") { echo " active"; }?>"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Ordonnances<b class="caret"></b></a> <ul class="dropdown-menu"> + <li class="dropdown-header">Ordonnance</li> <li><a href="<?php echo $base_url; ?>ord/liste">Liste</a></li> <li><a href="<?php echo $base_url; ?>ord/add">Ajouter</a></li> + <li class="divider"></li> + <li class="dropdown-header">Produit</li> + <li><a href="<?php echo $base_url; ?>ord/listeProduit">Liste</a></li> + <li><a href="<?php echo $base_url; ?>ord/addProduit">Ajouter</a></li> </ul> </li> <li class="dropdown<?php if($page == "fact") { echo " active"; }?>"> diff --git a/view/form.php b/view/form.php index 2d0fc365e49b79d443efdf7bea706c88cc4d99a7..16d9945f830ffc7e2c5e578c6e73308a2ecd8eb3 100644 --- a/view/form.php +++ b/view/form.php @@ -7,7 +7,7 @@ <form role="form" method="post"> <input type="hidden" name="submitForm" value="1"> <?php foreach($formConf->getFields() as $field): ?> - <?php echo $field->html(); ?> + <?php echo $field->html($formConf); ?> <?php endforeach; ?> <button type="submit" class="btn btn-default"><?php echo $formConf->getSubmitText(); ?></button> </form>