diff --git a/class/boolfield.php b/class/boolfield.php index 9b038b942866944be07ba84cab15f7cae59ee157..f4792312243a5cfb0477c8a0d1fdc50861f694f7 100644 --- a/class/boolfield.php +++ b/class/boolfield.php @@ -6,7 +6,7 @@ class BoolField extends Field public function html($form) { if($this->value) { $checked="checked"; } else { $checked = false; } - $html = '<div class="checkbox"> <label> <input type="checkbox" name="'.$this->name.'" '.$checked.'>'.ucfirst($this->name).'</label> </div>'; + $html = '<div class="checkbox"> <label> <input type="checkbox" name="'.$this->name.'" '.$checked.'>'.$this->label.'</label> </div>'; return $html; } diff --git a/class/datefield.php b/class/datefield.php index b2fe5a7338ef750e1fa4500b097370b1a5b9562f..19667dc8b30e013e300b9f1015bdc6f09609002d 100644 --- a/class/datefield.php +++ b/class/datefield.php @@ -3,7 +3,7 @@ public function html() { $html = '<div class = "form-group"> <label for = "form'.$this->name.'"> - <input type = "date" name = "'.$this->name.'" value ="'.$this->value.'"> '.ucfirst($this->name).' + <input type = "date" name = "'.$this->name.'" value ="'.$this->value.'"> '.$this->label.' </label> </div>'; return $html; diff --git a/class/employe.php b/class/employe.php index 2c25a91c4f898aaa2aef314383034a4c837e5486..cd4108c1de20f75ec0be328ee77a49a340f358b6 100644 --- a/class/employe.php +++ b/class/employe.php @@ -9,7 +9,6 @@ class Employe extends Personne "t" => "BoolField", "label" => "Veterinaire", "i" => 9 - ), "id_national" => array( "label" => "Identifiant national", diff --git a/class/field.php b/class/field.php index 32a3036d8375a1183265dd4f63017f20fcb07ecf..5d6b245deb3860cd0eb806e9dd40d02dbe023058 100644 --- a/class/field.php +++ b/class/field.php @@ -22,7 +22,7 @@ class Field { if($this->primary && $form->action == "Modifier") { $disabled = "disabled"; } return '<div class="form-group"> - <label for="form'.$this->name.'">'.ucfirst($this->name).'</label> + <label for="form'.$this->name.'">'.$this->label.'</label> <input type="text" class="form-control" name="'.$this->name.'" value="'.$this->value.'" '.$disabled.'> </div>'; } diff --git a/class/foreignfield.php b/class/foreignfield.php index 4015ff9a10ab2379fb3eb6158f44944eebce3234..5b72569539ead420f3444e84567f4174c6f60bc1 100644 --- a/class/foreignfield.php +++ b/class/foreignfield.php @@ -5,6 +5,7 @@ class ForeignField { protected $value; protected $primary; protected $choices; + public $label; public function __construct($name, &$value, $primary=false) { $this->name = $name; @@ -12,6 +13,7 @@ class ForeignField { $this->primary = $primary; $cl = ucfirst($name); $this->choices = $cl::getAll(); + $this->label = ucfirst($name); } public function html($form) { @@ -22,7 +24,7 @@ class ForeignField { if($this->primary && $form->action == "Modifier") { $disabled = "disabled"; } $html = '<div class="form-group"> - <label for="form'.$this->name.'">'.ucfirst($this->name).'</label> + <label for="form'.$this->name.'">'.$this->label.'</label> <select class="form-control" name="'.$this->name.'">'; foreach ($this->choices as $value) { if($this->value == $value->{$value->_primaryAttr}()) { $selected = "selected"; } else { $selected = ""; } diff --git a/class/phonefield.php b/class/phonefield.php index 350bf029434a3cbd22e196268c6401d77d22cbf3..838b2e136b2a254309b1d09f246a5eb903817db0 100644 --- a/class/phonefield.php +++ b/class/phonefield.php @@ -5,7 +5,7 @@ class PhoneField extends Field public function html() { $html = '<div class = "form-group"> <label for = "form'.$this->name.'"> - <input type = "tel" name = "'.$this->name.'" value ="'.$this->value.'"> '.ucfirst($this->name).' + <input type = "tel" name = "'.$this->name.'" value ="'.$this->value.'"> '.$this->label.' </label> </div>'; return $html;