Пример #1
0
 public function trescArtykuluAction()
 {
     // action body
     $formJednorazowo = new Application_Form_LicencjaTresci('jednorazowo');
     $formDlugoterminowo = new Application_Form_LicencjaTresci('dlugoterminowo');
     $trescLicencji = new Application_Model_DbTable_Strony();
     $this->view->trescLicencji = $trescLicencji->find(43);
     if ($this->getRequest()->isPost()) {
         $licencjeDB = new Application_Model_DbTable_LicencjeTresci();
         $submitJ = $this->getRequest()->getParam('submitJ');
         $submitD = $this->getRequest()->getParam('submitD');
         if (isset($submitJ)) {
             if ($formJednorazowo->isValid($this->getRequest()->getPost())) {
                 $data = $formJednorazowo->getValues();
                 $licencjeDB->insert($data);
                 $formJednorazowo->reset();
                 $this->view->success = true;
             } else {
                 $this->view->validErrorIn = 'jednorazowo';
             }
         }
         if (isset($submitD)) {
             if ($formDlugoterminowo->isValid($this->getRequest()->getPost())) {
                 $data = $formDlugoterminowo->getValues();
                 $licencjeDB->insert($data);
                 $formDlugoterminowo->reset();
                 $this->view->success = true;
             } else {
                 $this->view->validErrorIn = 'dlugoterminowo';
             }
         }
     }
     $this->view->formJednorazowo = $formJednorazowo;
     $this->view->formDlugoterminowo = $formDlugoterminowo;
 }
Пример #2
0
 public function indexAction()
 {
     // action body
     //echo $this->getRequest()->getParam("id");
     $Podstrona = new Application_Model_DbTable_Strony();
     $select = $Podstrona->select(array('id', 'nazwa', 'podstrona', 'tekst'))->where('id= ?', intval($this->getRequest()->getParam("id")))->where('czy_wyswietlac= ?', "1");
     $this->view->podstrona = $Podstrona->fetchAll($select);
 }