summaryrefslogtreecommitdiffstats
path: root/application/forms
diff options
context:
space:
mode:
Diffstat (limited to 'application/forms')
-rw-r--r--application/forms/FilterEdit.php54
1 files changed, 54 insertions, 0 deletions
diff --git a/application/forms/FilterEdit.php b/application/forms/FilterEdit.php
new file mode 100644
index 0000000..5d5a242
--- /dev/null
+++ b/application/forms/FilterEdit.php
@@ -0,0 +1,54 @@
+<?php
+
+class Application_Form_FilterEdit extends Zend_Form
+{
+ private $filterID = null;
+
+ public function init()
+ {
+ $this->setName("Add Filter");
+ $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','filtertype');
+ $filtertypes ->setLabel('Type:');
+ foreach($filtertype as $f){
+ $filtertypes->addMultiOption($f->getID(),$f->getFiltertypename());
+ }
+ $this->addElement($filtertypes);
+
+
+ $this->addElement('text', 'filtervalue1', array(
+ 'label' => 'Value1:'
+ ));
+
+ $this->addElement('text', 'filtervalue2', array(
+ 'label' => 'Value2:'
+ ));
+
+ $this->addElement('hidden', 'filterID', array(
+ 'value' => $this->filterID
+ ));
+
+ $this->addElement('submit', 'add', array(
+ 'required' => false,
+ 'ignore' => true,
+ 'label' => 'Add Filtertype',
+ ));
+ }
+ public function setFilterID($id)
+ {
+ $this->filterID = $id;
+ }
+
+
+
+}
+