*/ include 'FormularioInput.class.php'; class FormularioHtml extends FormularioInput { protected $htmlForm; protected $label; protected $widthlabel; protected $widthinput; function desenhaHtmlForm($options,$showTableDivision = true, $showTableRow = true){ switch($this->tipo){ case 'periodo' : $this->formInput($options); break; case 'data' : $this->formInput($options); break; case 'moeda' : $this->formInput($options); break; case 'cpf' : $this->formInput($options); break; case 'cnpj' : $this->formInput($options); break; case 'input' : $this->formInput($options); break; case 'select' : $this->formSelect($options); break; case 'checkbox' : $this->formCheckBox($options); break; case 'radio' : $this->formRadio($options); break; case 'textarea' : $this->formTextArea($options); break; case 'button' : $this->formButton($options); break; case 'hidden' : $this->formHidden(false,false); break; case 'subtitulo' : $this->formSubTitulo(); break; case 'div' : $this->formDiv(); break; case 'file' : $this->formArquivo($options); break; default: $this->formInput($options); } return $this->htmlForm; } function makeDisplayHTML($options,$tipo = "input") { $opentr = $options["open_tr"]; $opentd = $options["open_td"]; $makedivision = $options["makedivision"]; $makedivision_colspan = $options["makedivision_colspan"]; $open_td_colspan = $options["open_td_colspan"]; $closetd = $options["close_td"]; $closetr = $options["close_tr"]; if ($opentr) echo "\n\t"; if ($makedivision) { if ($makedivision_colspan) $addcolspan = " colspan=" . $makedivision_colspan; if ($this->widthlabel) { $addwidthlabel = " width='" . $this->widthlabel . "'"; } echo "\n\t\t"; } echo ""; if ($makedivision) echo ""; if ($opentd) { if ($open_td_colspan) $addcolspan2 = " colspan=" . $open_td_colspan; if ($this->widthinput) { $addwidthinput = " width='" . $this->widthinput . "'"; } echo "\n\t\t"; } echo "\n\t\t\t"; if ($tipo == "input") { $this->input(); } if ($tipo == "select") { $this->select(); } if ($tipo == "checkbox") { $this->checkbox(); } if ($tipo == "radio") { $this->radio(); } if ($tipo == "textarea") { $this->textarea(); } if ($tipo == "arquivo") { $this->arquivo(); } if ($tipo == "button") { $this->button(); } echo ""; if ($closetd) echo "\n\t\t"; if ($closetr) echo "\n\t\n"; return $this->htmlForm; } function formInput($options = array()){ //$this->input(); return $this->makeDisplayHTML($options); } function formSelect($options){ //$this->select(); return $this->makeDisplayHTML($options,"select"); } function formCheckbox($options){ //$this->checkbox(); return $this->makeDisplayHTML($options,"checkbox"); } function formRadio($options){ //$this->radio(); return $this->makeDisplayHTML($options,"radio"); } function formHidden() { echo "\n\t\t\t" . $this->input(); } function formTextArea($options){ // $this->textArea(); return $this->makeDisplayHTML($options,"textarea"); } function formButton($options){ //$this->button(); return $this->makeDisplayHTML($options,"button"); } function formSubTitulo() { echo "\n\t\t\n\t\n\t\n\t\n\t\n\t\t\n\t\n\t\n\t\t\n\t\n\t"; } function formDiv() { echo "\n\t\t\n\t\n\t
\n\t\t\t 

\n\t\t

" . $this->value . "

 
\n\t\n\t\n\t
\n\t"; } function formArquivo($options) { //$this->arquivo(); return $this->makeDisplayHTML($options,"arquivo"); } function setLabel($label){ $this->label = $label; } } ?>