Skip to content
Snippets Groups Projects
Commit 34219dbd authored by clement's avatar clement
Browse files

c

parent 7a5ffa5f
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,8 @@ class Prestation extends Objet ...@@ -11,7 +11,8 @@ class Prestation extends Objet
"i" => 3 "i" => 3
), ),
"type" => array( "type" => array(
"i" => 2 "i" => 2,
"t" => "TypeField"
), ),
"id" => array( "id" => array(
"i" => 1 "i" => 1
......
<?php
class TypeField extends Field
{
public function html() {
// Todo, if isset($_POST[$this->name]) && !$this->validate() => Show a error msg explanation for this line.
$html = '<div class="form-group">
<label for="form'.$this->name.'">'.$this->label.'</label>
<select class="form-control" name="'.$this->name.'">
<option value="consultation" '.($this->value == "consultation" ? "selected" : "").'>Consultation</option>
<option value="intervention" '.($this->value == "intervention" ? "selected" : "").'>Intervention</option>
</select>
</div>';
return $html;
}
public function validate()
{
$this->value = $_POST[$this->name];
return true;
}
public function show() {
if ($this->value == 'M') {
$html = 'Consultation';
} else {
$html = 'Intervention';
}
return $html;
}
}
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