public function mailAction() { $respondent = new Respondenci(); $post = new Zend_Filter_Input($_POST); if (strtolower($_SERVER['REQUEST_METHOD']) == 'post') { if ($post->getRaw('akcja') == 'dodaj') { $data = array('e_mail' => $post->getRaw('email')); try { $id = $respondent->insert($data); } catch (Respondenci_Exception $e) { //dodaj obslugę błędów } } else { $db = $respondent->getAdapter(); $where = $db->quoteInto('e_mail = ?', $post->getRaw('email')); try { $respondent->delete($where); } catch (Respondenci_Exception $e) { //dodaj obslugę błędów } } } $this->_redirect('/'); }
function usunhashAction() { $respondent = new Respondenci(); $db = $respondent->getAdapter(); $params = $this->_action->getParams(); $hashEmail = $params['hash']; $query = $db->quoteInto('md5(e_mail) = ?', $hashEmail); try { $respondent->delete($query); } catch (Respondenci_Exception $e) { } $this->_redirect('/index/usunietymail'); }