diff --git a/class/form.php b/class/form.php new file mode 100644 index 0000000000000000000000000000000000000000..cc5e90cb6b72339e87e7dd180bd380448aaf5981 --- /dev/null +++ b/class/form.php @@ -0,0 +1,17 @@ +<?php + +class Form { + protected $object; + public function __construct() { + + } + + public function setObject(&$obj) { + $this->object =& $obj; + } + + public function getTitle() { + return "Ajouter un ".get_class($this->object); + } + +} \ No newline at end of file diff --git a/class/objet.php b/class/objet.php index 445f4dc8869ea0f006606a689b7131c06a163631..fb0ac314733b791dac9e1aa67f0fc2e8161292ea 100644 --- a/class/objet.php +++ b/class/objet.php @@ -30,4 +30,11 @@ class Objet return $result; } + + public function getForm() + { + $form = new Form(); + $form->setObject($this); + return $form; + } } \ No newline at end of file diff --git a/controller/personne.php b/controller/personne.php index 168efd2d8f6a74176471e768ce8245324dbda5fc..c80a9fbba437a35f740b9556a6b0f813bc77efc1 100644 --- a/controller/personne.php +++ b/controller/personne.php @@ -25,10 +25,14 @@ switch($action) { include 'view/list.php'; break; case "addPersonnel": - + $employe = new Employe(); + $formConf = $employe->getForm(); + include 'view/form.php'; break; case "addClient": - + $client = new Client(); + $formConf = $client->getForm(); + include 'view/form.php'; break; default: include 'view/404.php'; diff --git a/view/form.php b/view/form.php new file mode 100644 index 0000000000000000000000000000000000000000..d9d7897ed73de25bb0b8d6c73e65986ac3e0b656 --- /dev/null +++ b/view/form.php @@ -0,0 +1,6 @@ +<!-- Begin page content --> +<div class="container"> + <div class="page-header"> + <h1><?php echo $formConf->getTitle(); ?></h1> + </div> +</div> \ No newline at end of file