Exemple #1
0
 public function init()
 {
     $roles = new Model_Roles();
     $result = $roles->getRoleByCat(Model_Roles::COLDCHAIN);
     foreach ($result as $role) {
         $this->_list["role"][''] = 'Select';
         $this->_list["role"][$role->getPkId()] = $role->getRoleName();
     }
     foreach ($this->_fields as $col => $name) {
         switch ($col) {
             case "login_id":
             case "email":
             case "phone":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control"), "allowEmpty" => true, "required" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "password":
             case "confirm_password":
                 $this->addElement("password", $col, array("attribs" => array("class" => "form-control"), "allowEmpty" => true, "required" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             default:
                 break;
         }
         if (in_array($col, array_keys($this->_list))) {
             $this->addElement("select", $col, array("attribs" => array("class" => "form-control"), "filters" => array("StringTrim", "StripTags"), "allowEmpty" => true, "required" => false, "registerInArrayValidator" => false, "multiOptions" => $this->_list[$col]));
             $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
         }
     }
 }