public function getcomboAction() { try { $EntityManagerPlugin = $this->EntityManagerPlugin(); $AgenciaCargaBO = new AgenciaCargaBO(); $AgenciaCargaBO->setEntityManager($EntityManagerPlugin->getEntityManager()); $SesionUsuarioPlugin = $this->SesionUsuarioPlugin(); $SesionUsuarioPlugin->isLoginClienteVendedor(); $body = $this->getRequest()->getContent(); $json = json_decode($body, true); //var_dump($json); exit; $texto_primer_elemento = $json['texto_primer_elemento']; $cliente_id = $SesionUsuarioPlugin->getUserClienteId(); $agencia_carga_id = null; $opciones = $AgenciaCargaBO->getComboTodos($agencia_carga_id, $texto_primer_elemento); $response = new \stdClass(); $response->opciones = $opciones; $response->respuesta_code = 'OK'; $json = new JsonModel(get_object_vars($response)); return $json; } catch (\Exception $e) { $excepcion_msg = utf8_encode($this->ExcepcionPlugin()->getMessageFormat($e)); $response = $this->getResponse(); $response->setStatusCode(500); $response->setContent($excepcion_msg); return $response; } }
public function consultarpedidoactualAction() { try { $viewModel = new ViewModel(); $EntityManagerPlugin = $this->EntityManagerPlugin(); $SesionUsuarioPlugin = $this->SesionUsuarioPlugin(); $SesionUsuarioPlugin->isLoginClienteVendedor(); $PedidoBO = new PedidoBO(); $AgenciaCargaBO = new AgenciaCargaBO(); $PedidoBO->setEntityManager($EntityManagerPlugin->getEntityManager()); $AgenciaCargaBO->setEntityManager($EntityManagerPlugin->getEntityManager()); $pedido_cab_actual_id = $SesionUsuarioPlugin->getClientePedidoCabIdActual(); $cliente_id = $SesionUsuarioPlugin->getUserClienteId(); if (empty($pedido_cab_actual_id)) { $viewModel->pedido_cab_id = null; $viewModel->cbo_agencia_carga = null; } else { $viewModel->pedido_cab_id = $pedido_cab_actual_id; $viewModel->cbo_agencia_carga_all = $AgenciaCargaBO->getComboTodos("", '<Cargo Agency>'); $viewModel->cbo_agencia_carga_asignada = $AgenciaCargaBO->getComboPorCliente($cliente_id, "", '<Cargo Agency>'); } //end if //Se consulta la dispo, considerando los criterios de busqueda $data = $SesionUsuarioPlugin->getRecord(); $viewModel->identidad_usuario = $data; $this->layout($SesionUsuarioPlugin->getUserLayout()); $viewModel->setTemplate('dispo/pedido/pedido_actual.phtml'); return $viewModel; //false } catch (\Exception $e) { $excepcion_msg = utf8_encode($this->ExcepcionPlugin()->getMessageFormat($e)); $response = $this->getResponse(); $response->setStatusCode(500); $response->setContent($excepcion_msg); return $response; } }