AnonSec Team
Server IP : 10.2.73.233  /  Your IP : 216.73.216.59
Web Server : Apache/2.4.59 (Debian)
System : Linux polon 4.19.0-27-amd64 #1 SMP Debian 4.19.316-1 (2024-06-25) x86_64
User : www-data ( 33)
PHP Version : 5.6.40-64+0~20230107.71+debian10~1.gbp673146
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/leksykografia/application/forms/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/leksykografia/application/forms/Vote.php
<?php 
class Application_Form_Vote extends Zend_Form
{
    public function init()
    {
        $voteMapper = new Application_Model_VoteMapper();
        $votes = $voteMapper->fetchAllActive();
        // Set the method for the display form to POST
        $this->setMethod('post');
        $this->setEnctype(Zend_Form::ENCTYPE_MULTIPART);
        $this->setDisableLoadDefaultDecorators(true);
        
         $this->addDecorator('FormElements')
             ->addDecorator('HtmlTag') 
             ->addDecorator('Form');
        
        $page = new Application_Model_Page();
        $pageMapper = new Application_Model_PageMapper();
        // Add an email element
        
        foreach($votes as $vote)
        {
            $pageMapper->find($vote->getPage(), $page);
            
            $voteRadio = new Zend_Form_Element_Radio('voteRadio'.$vote->getId(), array(
                'label'      => $page->getTitle(),
                'required'   => false,
          
            ));
            $voteRadio->setSeparator('&nbsp;');
        
            $voteRadio->addMultiOption('1','1');
            $voteRadio->addMultiOption('2','2');
            $voteRadio->addMultiOption('3','3');
            $voteRadio->addMultiOption('4','4');
            $voteRadio->addMultiOption('5','5');
            if(isset($_COOKIE['voteRadio'.$vote->getId()]) && $_COOKIE['voteRadio'.$vote->getId()] == '1')
                $voteRadio->setAttrib('disabled', true);
            
           
        
        $this->addElement($voteRadio);
        

        $this->addDisplayGroup(array('voteRadio'.$vote->getId()), 'voteRadioa'.$vote->getId());
        
        $group = $this->getDisplayGroup ('voteRadioa'.$vote->getId());
        $group->removeDecorator ('Zend_Form_Decorator_DtDdWrapper');
        
        
        }
             
 
        // Add the submit button
        $this->addElement('submit', 'submit', array(
            'ignore'   => true,
            'label'    => 'Zatwierdź',
        ));
        
        
 
    }
}

AnonSec - 2021