• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List

E:/E/GEAMP/www/openbiz/openbiz/bin/easy/element/CheckListbox.php

00001 <?PHP
00017 include_once("OptionElement.php");
00018 
00027 class CheckListbox extends OptionElement
00028 {
00029 
00035     public function render()
00036     {
00037         $fromList = array();
00038         $this->getFromList($fromList);
00039         $style = $this->getStyle();
00040         $func = $this->getFunction();
00041         $valueList = array(); $valueArray = array();
00042         $this->getFromList($valueList, $this->getSelectedList());
00043         foreach ($valueList as $vl) {
00044             $valueArray[] = $vl['val'];
00045         }
00046 
00047         $sHTML = "<div name=\"" . $this->m_Name . "\" ID=\"" . $this->m_Name ."\" $this->m_HTMLAttr $style>";
00048 
00049         foreach ($fromList as $option)
00050         {
00051             $test = array_search($option['val'], $valueArray);
00052             if ($test === false)
00053             {
00054                 $selectedStr = '';
00055             }
00056             else
00057             {
00058                 $selectedStr = "CHECKED";
00059             }
00060             $sHTML .= "<input type=\"checkbox\" name=\"".$this->m_Name."[]\" VALUE=\"" . $option['val'] . "\" $selectedStr></input>" . $option['txt'] . "<br/>";
00061         }
00062         $sHTML .= "</div>";
00063         return $sHTML;
00064     }
00065 }
00066 
00067 ?>

Generated on Thu Apr 19 2012 17:09:13 for openbiz by  doxygen 1.7.2