summaryrefslogtreecommitdiffstats
path: root/application/forms/Session.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/forms/Session.php')
-rw-r--r--application/forms/Session.php71
1 files changed, 46 insertions, 25 deletions
diff --git a/application/forms/Session.php b/application/forms/Session.php
index f094676..30aefda 100644
--- a/application/forms/Session.php
+++ b/application/forms/Session.php
@@ -3,36 +3,48 @@
class Application_Form_Session extends Zend_Form
{
+ private $clients;
+ private $bootos;
+ private $bootisos;
+
public function init()
{
$this->setName("session");
$this->setMethod('post');
- $this->addElement('text', 'clientID', array(
- 'filters' => array('StringTrim'),
- 'validators' => array(
- array('StringLength', false, array(0, 50)),
- ),
- 'required' => true,
- 'label' => 'clientID:',
- ));
+ $clientfield = $this->createElement('select','clientID');
+ $clientfield ->setLabel('Client:');
+ $clientfield->addMultiOption('','');
+ if(count($this->clients)>0){
+ foreach($this->clients as $id => $g){
+ $clientfield->addMultiOption($g->getID(), $g->getMacadress());
+ }
+ }
+ $clientfield->setRegisterInArrayValidator(false);
+ $this->addElement($clientfield);
+
+
+ $bootosfield = $this->createElement('select','bootosID');
+ $bootosfield ->setLabel('BootOs:');
+ $bootosfield->addMultiOption('','');
+ if(count($this->bootos)>0){
+ foreach($this->bootos as $id => $g){
+ $bootosfield->addMultiOption($g->getID(), $g->getTitle());
+ }
+ }
+ $bootosfield->setRegisterInArrayValidator(false);
+ $this->addElement($bootosfield);
+
+ $bootisofield = $this->createElement('select','bootisoID');
+ $bootisofield ->setLabel('BootIso:');
+ if(count($this->bootisos)>0){
+ foreach($this->bootisos as $id => $g){
+ $bootisofield->addMultiOption($g->getID(), $g->getTitle());
+ }
+ }
+ $bootisofield->setRegisterInArrayValidator(false);
+ $this->addElement($bootisofield);
- $this->addElement('text', 'bootosID', array(
- 'filters' => array('StringTrim'),
- 'validators' => array(
- array('StringLength', false, array(0, 50)),
- ),
- 'required' => true,
- 'label' => 'bootosID:',
- ));
-$this->addElement('text', 'bootisoID', array(
- 'filters' => array('StringTrim'),
- 'validators' => array(
- array('StringLength', false, array(0, 50)),
- ),
- 'required' => true,
- 'label' => 'bootisoID:',
- ));
$this->addElement('text', 'time', array(
'filters' => array('StringTrim'),
'validators' => array(
@@ -64,7 +76,16 @@ $this->addElement('text', 'ip6', array(
'label' => 'Save',
));
}
-
+ function setClients($v){
+ $this->clients = $v;
+ }
+ function setBootos($v){
+ $this->bootos = $v;
+ }
+ function setBootisos($v){
+ $this->bootisos = $v;
+ }
+
}