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');
 }
 public function mailsendAction()
 {
     //treśc wysłanych maili wyświetlamy w pliku txt
     $file = new Hamster_File();
     $file->setDir('../logs');
     $file->setFileName('mail.txt');
     $respondent = new Respondenci();
     $users = $respondent->fetchAll();
     $data = '';
     foreach ($users as $user) {
         $data = "Witamy,\n" . "Prosimy o wypełnienie tej ankiety:\n" . "http://knip.pol.lublin.pl/~projekt5/ankieta/pokaz/ankieta/" . $this->_getParam('ankieta') . "\n" . "\n \n" . "Jeżeli nie chcesz otrzymywać już więcej takich maili, kliknij na link poniżej\n" . "http://knip.pol.lublin.pl/~projekt5/respondenci/usunhash/hash/" . md5($user->eMail) . "\n=======================================================" . "\n \n";
         mail($user->eMail, "Nowa Ankieta", $data);
     }
     //$file->putFileContent($data);
     $this->_forward('ankieter', 'edytuj', array('ankieta' => $this->_getParam('ankieta')));
 }