public function resendAction()
 {
     $request = $this->getRequest();
     $id = $this->_helper->IdConvert->hexToStr($request->getParam('id'));
     try {
         $sms = $this->_model->fetchRow($this->_model->select()->where('id = ?', $id));
         $sms = $this->_model->fetchRow($this->_model->select()->from(array('ss' => 'sms.blacklist_storage'))->setIntegrityCheck(false)->joinLeft(array('sr' => 'ws.recipient_sms'), 'ss.sms_recipient_id=sr.id', array('phone_number'))->where('ss.id = ?', $id));
         $this->sendSms($sms->ws_service_id, $sms->phone_number, $sms->content_sms);
         $this->_model->update(array('ghost' => true), $this->_model->getAdapter()->quoteInto('id = ?', $id));
         $this->_helper->messenger->success();
         $this->_helper->redirector('index');
         return;
     } catch (Logic_Ws_Exception $e) {
         $this->_helper->error(MSG_ERROR, $e);
     }
 }
Exemple #2
0
 public function ghostUpdate($data, $where)
 {
     $select = $this->select();
     foreach ($where as $k => $v) {
         $select->where($k, $v);
     }
     $old = $this->fetchRow($select);
     if ($old) {
         $old = $old->toArray();
         $new = array_merge($old, $data);
         foreach ($new as $k => &$row) {
             if (is_bool($row)) {
                 if ($row) {
                     $row = 't';
                 } else {
                     $row = 'f';
                 }
             }
         }
         parent::update(array('ghost' => 't'), array('id = ?' => $old['id']));
         unset($new['id']);
         unset($new['last_change']);
         parent::insert($new);
         return true;
     } else {
         return 0;
     }
 }
 public function removeAction()
 {
     $request = $this->getRequest();
     $id = $this->_helper->IdConvert->hexToStr($request->getParam('id'));
     try {
         $this->_model->update(array('ghost' => true), $this->_model->getAdapter()->quoteInto('id = ?', $id));
         $this->_helper->messenger->success();
         $this->_helper->redirector('index');
         return;
     } catch (Logic_Ws_Exception $e) {
         $this->_helper->error(MSG_ERROR, $e);
     }
 }
Exemple #4
0
 public function set($name, $value)
 {
     $count = parent::update(array('ghost' => 'true'), array('key = ?' => $name));
     parent::insert(array('key' => $name, 'value' => $value));
     $this->_cache->clean();
 }