summaryrefslogtreecommitdiffstats
path: root/application/forms/FilterEntriesAdd.php
blob: 26464841094d03d59e972ff1e7b0253eab2a9db7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php

class Application_Form_FilterEntriesAdd extends Zend_Form
{

   	private $filterID  = null;

    public function init()
    {
		$this->setName("Add Filterentry");
		$this->setMethod('post');

		try{		
			$filtertypemapper = new Application_Model_FilterTypeMapper();
	       	$filtertype = $filtertypemapper->fetchAll();
		}catch (Zend_Exception $e) {  
			echo "Error message 1: " . $e->getMessage() . "\n";
		}
		$filtertypes = $this->createElement('select','filtertypeID');
        $filtertypes ->setLabel('Type:');
		foreach($filtertype as $f){
			$filtertypes->addMultiOption($f->getID(),$f->getFiltertypename());
		}            	
		$this->addElement($filtertypes);

		
		$this->addElement('text', 'filtervalue', array(
			'label' => 'Value1:'
		));

		$this->addElement('text', 'filtervalue2', array(
			'label' => 'Value2:'
		));

        $this->addElement('submit', 'add', array(
            'required' => false,
            'ignore'   => true,
            'label'    => 'Save',
        ));  	 
        
        $this->addElement('button', 'Cancel', array(
            'onclick' => 'self.location="/filter"'
        ));  
		
		$this->addElement('hidden', 'filterID', array(
			'value' => $this->filterID
		));
    }
	public function setFilterID($id)
	{
		$this->filterID = $id;
	}

}