Example #1
0
 public function getFullIdentity($identyfikator)
 {
     $Users = new Application_Model_DbTable_UzytkownicyWww();
     $select = $Users->select()->where('username = ?', $identyfikator)->where('czy_aktywne = ?', 'T');
     $userData = $Users->fetchAll($select);
     return $userData[0];
     //return "oO";
 }
Example #2
0
 public function czyLogin($login)
 {
     $Users = new Application_Model_DbTable_UzytkownicyWww();
     $select = $Users->select(array('id'))->where('czy_aktywne = ?', "T")->where('username = ?', $login);
     //$return = $select->__toString()." / ".count($Users->fetchAll($select));
     //return $return;
     //return $select->__toString();
     return count($this->fetchAll($select));
 }
Example #3
0
 public function isValid($value, $context = null)
 {
     $email = $value;
     $this->_setValue($email);
     if (is_array($context) && isset($context['username']) && ($username = $context['username'])) {
         $User = new Application_Model_DbTable_UzytkownicyWww();
         $select = $User->select()->where('username = ?', $username);
         $u = $User->fetchRow($select);
         if ($u && $u['email'] === $email) {
             return true;
         }
     }
     $this->_error(self::NOT_FOUND);
     return false;
 }
Example #4
0
 public function potwierdzdotpayAction()
 {
     // action body
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender(true);
     $post = $this->_request->getPost();
     if ($post) {
         $User = new Application_Model_DbTable_UzytkownicyWww();
         $select = $User->select()->where('id = ?', intval($post['control']));
         $user = $User->fetchRow($select);
         switch ($post['status']) {
             case 'OK':
                 if ($user && $post['amount'] == 5) {
                     //if(strtotime(date("Y-m-d H:i:s"))<strtotime(date("Y-m-d H:i:s", strtotime($u->abonament_art_do))) && $u->abonament_art_do!="0000-00-00 00:00:00")
                     //  $wazna_do = strtotime(date("Y-m-d H:i:s", strtotime($u->abonament_art_do) . " +1 month"));
                     //else
                     $wazna_do = date('Y-m-d H:i:s', strtotime("+1 month"));
                     $user->abonament_art_do = $wazna_do;
                     $user->save();
                     if ($user->email != "") {
                         /*$mail = new TS_Mail_Gmail();
                           $mail->send(array(
                               'to'      => $user->email,
                               'subject' => 'Płatność on-line',
                               'body'    => "Płatność została zakończona powodzeniem. Abonament ważny do {$wazna_do}"
                           ));*/
                         $mail = new TS_Mail_Netart();
                         $mail->send(array('to' => $user->email, 'subject' => 'Płatność on-line', 'body' => "Płatność została zakończona powodzeniem. Abonament ważny do {$wazna_do}."));
                     }
                 }
                 break;
             case 'FAIL':
                 if ($user && $_POST['amount'] == 5) {
                     if ($user->email != "") {
                         /*$mail = new TS_Mail_Gmail();
                           $mail->send(array(
                               'to'      => $user->email,
                               'subject' => 'Płatność on-line',
                               'body'    => "Płatność została zakończona niepowodzeniem. Skontaktuj się z redakcją aby wyjaśnić problem."
                           ));*/
                         $mail = new TS_Mail_Netart();
                         $mail->send(array('to' => $user->email, 'subject' => 'Płatność on-line', 'body' => "Płatność została zakończona niepowodzeniem. Skontaktuj się z redakcją aby wyjaśnić problem."));
                     }
                 }
                 break;
         }
     }
     echo "OK";
 }