Skip to content
Snippets Groups Projects
Commit df78c9bd authored by goujonpa's avatar goujonpa
Browse files

list

parent 36b738ef
No related branches found
No related tags found
No related merge requests found
<?php
class List
{
protected $title;
protected $objArray;
public $class;
public function __construct($class, $title)
{
$this->title = $title;
$this->class = $class;
$this->$objArray = $class::getAll();
}
public function getTitle() {
return $this->title;
}
public function getLines() {
return $this->objArray;
}
}
\ No newline at end of file
......@@ -13,10 +13,7 @@ if(!in_array($action, $actions)) {
switch($action) {
case "listeAnimal":
$listArray = Animal::getAll();
$listParams = array("title" => "Liste des animaux de la clinique",
"keys" => array("id", "nom", "client", "race", "poids", "genre", "sterile", "date_naissance", "date_deces", "taille", "code"));
$editLink = "editAnimal";
$list = Animal::getList("Liste des Animaux");
include 'view/list.php';
break;
case "addAnimal":
......@@ -31,11 +28,7 @@ switch($action) {
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';
$list = Espece::getList("Liste des Especes");
break;
case "addEspece":
$espece = new Espece();
......@@ -49,10 +42,7 @@ switch($action) {
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";
$list = Race::getList("Liste des Races");
include 'view/list.php';
break;
case "addRace":
......
......@@ -13,10 +13,7 @@ if(!in_array($action, $actions)) {
switch($action) {
case "liste":
$listArray = Facture::getAll();
$listParams = array("title" => "Liste des factures",
"keys" => array("id", "employe", "animal", "date_edition", "date_paiement", "moyen_paiement", "prix_total"));
$editLink = "edit";
$list = Facture::getList("Liste des Factures");
include 'view/list.php';
break;
case "add":
......
......@@ -13,10 +13,7 @@ if(!in_array($action, $actions)) {
switch($action) {
case "liste":
$listArray = Ordonnance::getAll();
$listParams = array("title" => "Liste des ordonnances",
"keys" => array("id", "animal", "employe", "date", "prix"));
$editLink = "edit";
$list = Ordonnance::getList("Liste des Ordonnances");
include 'view/list.php';
break;
case "add":
......@@ -31,10 +28,7 @@ switch($action) {
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";
$list = Produit::getList("Liste des Produits");
include 'view/list.php';
break;
case "addProduit":
......
......@@ -13,10 +13,7 @@ if(!in_array($action, $actions)) {
switch($action) {
case "liste":
$listArray = Rdv::getAll();
$listParams = array("title" => "Liste des rendez-vous",
"keys" => array("id", "animal", "employe", "date", "duree"));
$editLink = "edit";
$list = Rdv::getList("Liste des Rendez Vous");
include 'view/list.php';
break;
case "add":
......@@ -31,10 +28,7 @@ switch($action) {
include 'view/form.php';
break;
case "listePrestation":
$listArray = Prestation::getAll();
$listParams = array("title" => "Liste des prestations",
"keys" => array("id", "description", "type", "prix"));
$editLink = "editPrestation";
$list = Prestation::getList("Liste des Prestations");
include 'view/list.php';
break;
case "addPrestation":
......
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