Пример #1
0
 public function unlockAction()
 {
     $request = $this->_request;
     $model = new Application_Model_Propostas();
     if ($request->isPost()) {
         $data = $request->getPost();
         if (isset($data['locked_by']) == CURRENT_USER_ID) {
             $model->lockRow($data['id_proposta'], 0, 0);
         }
     }
     $this->redirect('/' . $this->_controllerName);
 }
Пример #2
0
 public function mediacaoAction()
 {
     $model = new Application_Model_Propostas();
     $modelCliente = new Application_Model_Clientes();
     $modelImovel = new Application_Model_Empreendimentos();
     $request = $this->_request;
     $id = $request->getParam('id');
     if ($id) {
         $data = $model->selectByClientId($id);
         if ($data['dados_extras']) {
             $data = json_decode($data['dados_extras'], true);
             $empreendimento = $modelImovel->selectById($data['imovel']);
             // Verificando se tem corretagem para o empreendimento
             if ($empreendimento['cad_corretagem'] == false) {
                 $this->view->messages = array('Proposta sem contrato de mediação');
                 $this->view->message_type = "alert-info";
                 $this->view->data = array();
                 return false;
             }
             $condicoes = $model->selectCondicoesPagamento($id);
             $data['imovel'] = $empreendimento['nome'];
             $data['cad_corretagem'] = $empreendimento['cad_corretagem'];
             $data['parcelas'] = json_decode($condicoes['parcelas'], true);
             $this->view->data = $data;
         } else {
             $this->view->data = array();
         }
     }
 }