'; if($type == null) $type = $field['type']; switch($type) { case 'select': $html.= $this->structureHTML( $field['label'], $this->selectHTML($name, $field)); break; case 'selectMultiple': $html.= $this->structureHTML( $field['label'], $this->selectMultipleHTML($name, $field)); break; case 'intervalSelect': $html.= $this->structureHTML( $field['label'], $this->intervalSelectHTML($name, $field)); break; case 'interval': $html.= $this->structureHTML( $field['label'], $this->intervalHTML($name, $field)); break; case 'date': $html.= $this->structureHTML( $field['label'], $this->dateHTML($name, $field)); break; case 'text': switch($name) { case 'reg': $label = 'Localisation Régions'; break; case 'vil': $label = 'Localisation Villes'; break; case 'dep': $label = 'Localisation Départements'; break; default: $label = $field['label']; } $html.= $this->structureHTML( $label, $this->textHTML($name, $field, $name), $field['help'][ucfirst($name)]); break; case 'textarea': $html.= $this->structureHTML( $field['label'], $this->textareaHTML($name, $field)); break; case 'radio': $html.= $this->structureHTML( $field['label'], $this->radioHTML($name, $field)); break; case 'file': $html.= $this->structureHTML( $field['label'], $this->fileuploadHtml($name, $field)); break; } $html.= ''; } return $html; } private function structureHTML($label, $html, $help = null) { $out = ''; $out.= $this->structureLabel($label, $help); $out.= '
'.$html.'
'; return $out; } /** * Définition du label * @param unknown_type $label */ private function structureLabel($label, $help) { $return = ''; if($help) $return .= '

'.$help.'

'; return ($return); } private function intervalSelectHTML($name, $field) { $session = new SessionCiblage(); $sessionValeur = explode(',', $session->getCritere($name)); $return = ' à '; $return .= ''; $return .= ' Valider'; return ($return); } /* Select */ private function selectMultipleHTML($name, $field) { $session = new SessionCiblage(); $return = ''; return ($return); } /* Select Multiple */ private function selectHTML($name, $field) { $session = new SessionCiblage(); $sessionValeur = $session->getCritere($name); if(is_array($sessionValeur)) $sessionValeur = implode(',', $sessionValeur); $return = ''; return ($return); } /* Interval */ private function intervalHTML($name, $field) { $session = new SessionCiblage(); $valeur = $session->getCritere($name); $valeur = explode(',', $valeur); $return = '
'; $return .= ' à '; $return .= ''; $return .= ' Valider'; $return .= '
'; return ($return); } /* Dates */ private function dateHTML($name, $field) { $session = new SessionCiblage(); $return = '
'; $return .= ' a '; $return .= ''; $return .= '
'; return ($return); } /* Textes */ private function textHTML($name, $field, $name) { $session = new SessionCiblage(); switch($name) { case 'ape_entrep': case 'ape_etab': $type = 'Naf'; break; case 'vil': $type= 'Vil'; break; case 'cj': $type = 'Cj'; break; } /* Modifier les données */ $return = ''; $return .= 'Valider'; return ($return); } /* Textarea */ private function textareaHTML($name, $field) { $return = ' Selection dans une arborescence '; return ($return); } private function fileuploadHtml($name, $field) { $return = ' '; return ($return); } /* Radios */ private function radioHTML($name, $field, $item) { $return = ''; return ($return); } }