summaryrefslogtreecommitdiffstats
path: root/application/controllers/ClientController.php
diff options
context:
space:
mode:
authorSimon2011-03-09 16:31:58 +0100
committerSimon2011-03-09 16:31:58 +0100
commit3d04fb75a980dba20e51dc91afd49f0eb9ee43fe (patch)
tree11a095d4a8a372a4042d3c18e2fc15d780a76a95 /application/controllers/ClientController.php
parentdatenbankfehler behoben (diff)
downloadpbs2-3d04fb75a980dba20e51dc91afd49f0eb9ee43fe.tar.gz
pbs2-3d04fb75a980dba20e51dc91afd49f0eb9ee43fe.tar.xz
pbs2-3d04fb75a980dba20e51dc91afd49f0eb9ee43fe.zip
Form-Verhalten geändert & Datenbank korrigiert
Diffstat (limited to 'application/controllers/ClientController.php')
-rw-r--r--application/controllers/ClientController.php21
1 files changed, 8 insertions, 13 deletions
diff --git a/application/controllers/ClientController.php b/application/controllers/ClientController.php
index ff663ba..580eb6e 100644
--- a/application/controllers/ClientController.php
+++ b/application/controllers/ClientController.php
@@ -16,16 +16,15 @@ class ClientController extends Zend_Controller_Action
public function addclientAction()
{
- $mac = $this->_request->getParam('mac');
- $hh = $this->_request->getParam('hh');
+ $mac = $this->_request->getParam('mac');
+ $hh = $this->_request->getParam('hh');
if (!isset($_POST["add"])){
- $addclient = new Application_Form_Client();
- $this->view->addclient = $addclient;
+ $addclient = new Application_Form_Client();
+ $this->view->addclient = $addclient;
}
else{
$addfilterform = new Application_Form_Client($_POST);
- print_a($_POST,$addfilterform->isValid($_POST));
if ($addfilterform->isValid($_POST) || ($mac != '' && $hh != '') ) {
$client = new Application_Model_Client();
$mac = ($mac!='')?$mac:$_POST['macadress'];
@@ -37,9 +36,7 @@ class ClientController extends Zend_Controller_Action
print_a('inserted');
$this->_redirect('/client');
}
- else{
- print_a('no insert');
- }
+ $this->view->addclient = $addclient;
}
}
@@ -69,8 +66,8 @@ class ClientController extends Zend_Controller_Action
$this->view->editclient = $editclient;
}
else{
- $addfilterform = new Application_Form_Client($_POST);
- if ($addfilterform->isValid($_POST) || ($mac != '' && $hh != '') ) {
+ $editclient = new Application_Form_Client($_POST);
+ if ($editclient->isValid($_POST) || ($mac != '' && $hh != '') ) {
$client = new Application_Model_Client($_POST);
$client->setID($this->_request->getParam('clientID'));
$clientmapper = new Application_Model_ClientMapper();
@@ -78,9 +75,7 @@ class ClientController extends Zend_Controller_Action
print_a('updated');
$this->_redirect('/client');
}
- else{
- print_a('no update');
- }
+ $this->view->editclient = $editclient;
}
}