public function updateAction() { $cnf = Zend_Registry::get('cnf'); $model = new PgGalleriesModel(); $data = array(); if ($this->_request->isPost() && $this->_request->getPost('f_update_submit')) { $data['ID'] = $this->_request->getPost('s_ID'); $data['Name'] = $this->_request->getPost('s_Name'); $data['Alias'] = $this->_request->getPost('s_Alias'); $data['Date_creation'] = $this->_request->getPost('s_Date_creation'); $hour = $this->_request->getPost('s_h_hour'); $min = $this->_request->getPost('s_m_min'); $sec = $this->_request->getPost('s_s_sec'); $mon = $this->_request->getPost('s_m_mon'); $day = $this->_request->getPost('s_d_day'); $year = $this->_request->getPost('s_y_year'); $data['$'] = mktime($hour, $min, $sec, $mon, $day, $year); $data['Description'] = $this->_request->getPost('s_Description'); $data['DefaultPhotoID'] = $this->_request->getPost('s_DefaultPhotoID'); $data['Raiting'] = $this->_request->getPost('s_Raiting'); $data['Hidden'] = $this->_request->getPost('s_Hidden') == 'on' ? '1' : '0'; $model->update($data); $this->sendMessage("element '{$data['ID']}' has been updated successfully", "edit", $cnf->url->fullurl . "PgGalleries/"); } }
public function indexAction() { $this->view->css2 = true; $model = new PgGalleriesModel(); if (($id = $this->_request->getParam('id')) != NULL) { if ($model->delItem($id)) { $out = "element deleted successfully"; } else { $out = "error"; } } elseif ($this->_request->getParam('submit_form_delete') != NULL) { //$ids=$this->_request->getParam('ids'); $cks = $this->_request->getParam('cks'); $out = ""; foreach ($cks as $item_id => $state) { if ($state == "on") { if ($model->delItem($item_id)) { $out .= "element '{$item_id}' deleted successfully<br/>"; } else { $out .= "error in deleting '{$item_id}'<br/>"; } } } } else { $out = "no selected row"; } $this->sendMessage($out, "delete", $cnf->url->fullurl . "PgGalleries/"); }
public function indexAction() { $this->initCSS(); $cnf = Zend_Registry::get('cnf'); $model = new PgGalleriesModel(); $this->view->table_view = $model->getTableView(); $this->view->form_action = $cnf->url->fullurl . $this->getRequest()->getModuleName() . "/delete/"; }