public function getAll() { $conexion = new Conexion(); $consulta = $conexion->prepare('SELECT * FROM ' . self::TABLA); $consulta->execute(); while ($registro = $consulta->fetch()) { $sede = new Sede(); $sede->construir($registro); $array[] = $sede; } return $array; }
protected function setFieldsFromJsonObj($jsonObj) { if (isset($jsonObj->nome)) { $this->setNome($jsonObj->nome); } if (isset($jsonObj->rapporto)) { $this->setRapporto(Rapporto::fromJson($jsonObj->rapporto, $this->_xapiClient)); } if (isset($jsonObj->sede)) { $this->setSede(Sede::fromJson($jsonObj->sede, $this->_xapiClient)); } if (isset($jsonObj->soggetto)) { $this->setSoggetto(Soggetto::fromJson($jsonObj->soggetto, $this->_xapiClient)); } }
/** * Funcion encargada de obtener una Sede segun si ID */ function buscarSedePorId($idSede) { global $client; //referencia global a la variable client (la cual accede al WS) $sede = null; $param = array('idSede' => $idSede); $response = $client->call('buscarSedePorId', $param); if ($response != null) { $sede = new Sede(); $sede->setIdSede($response[0]["ID_SEDE"]); $sede->setDescripcion($response[0]["DESCRIPCION"]); } return $sede; }
<!-- ====================================================================== Crear un nuevo usuario Creado por: Andrea Sanchez Fecha: 08/01/2016 ====================================================================== --> <!doctype html> <html lang="en"> <?php include_once '../../controladores/ctrl_permisos.php'; $includeIdioma = permisos("admin", "../../"); include_once $includeIdioma; include_once "../../modelo/model_sede.php"; $sede = new Sede(); $sedes = $sede->listar(); ?> <body> <div class="wrapper"> <!-- Barra de navegacion lateral --> <?php include_once '../Sidebars/a_sidebar.php'; a_sidebar('', '', 'class="active"', '', '', ''); ?> <div class="main-panel"> <!-- Barra de logout superior --> <nav class="navbar navbar-default navbar-fixed"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="#"><?php
public function ganadorasDeSedes($idPremio) { $db = new Database(); include_once 'model_sede.php'; $sede = new Sede(); $sedes = $sede->listar(); $i = 0; $ganadoras = array(); foreach ($sedes as $s) { $votaciones = $this->votacionesSede($s['idSede'], $idPremio); //Si la sede tiene votaciones registradas if ($votaciones != null) { $ganadoraSede = $this->solucionGanadora($votaciones); $ganadoras[$i] = $ganadoraSede; //Guarda equipo, reto y puntuacion de la solucion ganadora de cada sede $i++; } } $db->desconectar(); return $ganadoras; }
<!-- =========================================================================== Controlador para crear una nueva sede Creado por: David Ansia Fdez. Fecha: 07/01/2016 ============================================================================ --> <?php include_once "../modelo/model_sede.php"; $id = $_POST['idSede']; $nuevaSede = new Sede($id); //Añadir reto if ($nuevaSede->crear($nuevaSede)) { header('Location:../vistas/login.php'); } else { die("Lo sentimos, la sede " . $id . " ya existe"); }
public function actionImprimir($id) { $model = $this->loadModel($id); $bienes = Fbm3Bien::model()->findAll(array('join' => 'JOIN bienmueble as bm ON t.bienmueble_id = bm.id', 'condition' => 't.fbm3_id=' . $model->id, 'order' => 'bm.codigo ASC')); $data = array(); $sede = Sede::model()->find(array('condition' => 'id=1')); date_default_timezone_set('America/Caracas'); setlocale(LC_ALL, 'es_ES'); $data = $model->getDataPDF($model); $header = array(); $header['formulario'] = 4; $header['responsable'] = $model->responsable->persona->pdata->profesion->cod . ' ' . $model->responsable->persona->pdata->nombre; $header['comprobante'] = $model->comprobante; $header['observaciones'] = $model->observaciones; if ($model->dependencia->u_adm_id != 0) { $header['adm'] = $model->dependencia->u_adm->descripcion; } else { $header['adm'] = ''; } $header['cp_nombre'] = $model->observador->pdata->nombre; $header['cp_cargo'] = $model->observador->cargo->descripcion; $header['cp_dp'] = $model->observador->dependencia->descripcion; $header['fecha'] = Yii::app()->dateFormatter->formatDateTime(CDateTimeParser::parse($model->fecha, 'yyyy-MM-dd hh:mm:ss'), 'medium', ''); $config = array(); // de Movimiento $config['th'] = array('Nro. de Identificacion', 'Descripcion de los Bienes', 'Cantidad', 'Valor Unitario', 'Dif. Cantidad', 'Dif. V.U.'); $config['tw'] = array(15, 15, 15, 28, 96, 17, 25, 20, 25); $config['ta'] = array('C', 'C', 'C', 'C', 'L', 'C', 'R', 'R', 'R'); $config['td'] = array(); $config['twf'] = array(169, 17, 25, 20, 25); $config['taf'] = array('C', 'C', 'R', 'R', 'R'); $config['tdf'] = array(); $config['tdf'][0] = 'TOTAL'; $config['tdf'][1] = 0; $config['tdf'][2] = 0; $config['tdf'][3] = 0; $config['tdf'][4] = 0; $header['dependencia'] = $model->dependencia->descripcion; $header['estado'] = 'BOLIVARIANO DE MIRANDA'; //$model->dependencia->sede->localidad->estado->descripcion; $header['municipio'] = 'SUCRE'; //$model->dependencia->sede->localidad->municipio->descripcion; $items = Fbm3Bien::model()->findAll(array('join' => 'JOIN bienmueble as bm ON t.bienmueble_id = bm.id', 'condition' => 't.fbm3_id=' . $model->id, 'order' => 'bm.codigo ASC')); $config['hc'] = array(); $valor_total = 0; $i = 0; foreach ($items as $item) { $config['td'][$i] = array($item->bienmueble->clasificacion->grupo, $item->bienmueble->clasificacion->subgrupo, $item->bienmueble->clasificacion->seccion, $item->bienmueble->codigo, $item->bienmueble->descripcion, 1, number_format($item->bienmueble->valor_unitario, 2, ',', ' '), 1, number_format($item->bienmueble->valor_unitario, 2, ',', ' ')); $config['tdf'][1]++; $valor_total += $item->bienmueble->valor_unitario; $config['tdf'][3]++; $i++; } $config['tdf'][2] = number_format($valor_total, 2, ',', ' '); //$config['tdf'][3] = $config['tdf'][3]; $config['tdf'][4] = number_format($valor_total * $config['tdf'][3], 2, ',', ' '); $this->layout = 'pdf'; $this->render('imprimir', array('header' => $header, 'data' => $data, 'config' => $config)); }
protected function setFieldsFromJsonObj($jsonObj) { if (isset($jsonObj->anno)) { $this->setAnno($jsonObj->anno); } if (isset($jsonObj->cambioValuta)) { $this->setCambioValuta($jsonObj->cambioValuta); } if (isset($jsonObj->dataDocumento)) { $this->setDataDocumento($this->parseDate($jsonObj->dataDocumento)); } if (isset($jsonObj->numeroDocumento)) { $this->setNumeroDocumento($jsonObj->numeroDocumento); } if (isset($jsonObj->serie)) { $this->setSerie($jsonObj->serie); } if (isset($jsonObj->codice)) { $this->setCodice($jsonObj->codice); } if (isset($jsonObj->contoCorrente)) { $this->setContoCorrente($jsonObj->contoCorrente); } if (isset($jsonObj->codicePaese)) { $this->setCodicePaese($jsonObj->codicePaese); } if (isset($jsonObj->iban)) { $this->setIban($jsonObj->iban); } if (isset($jsonObj->swift)) { $this->setSwift($jsonObj->swift); } if (isset($jsonObj->scontoPercentuale)) { $this->setScontoPercentuale($jsonObj->scontoPercentuale); } if (isset($jsonObj->scontoValore)) { $this->setScontoValore($jsonObj->scontoValore); } if (isset($jsonObj->scontoValorePercentuale)) { $this->setScontoValorePercentuale($jsonObj->scontoValorePercentuale); } if (isset($jsonObj->imponibile)) { $this->setImponibile($jsonObj->imponibile); } if (isset($jsonObj->imponibileScontato)) { $this->setImponibileScontato($jsonObj->imponibileScontato); } if (isset($jsonObj->imposta)) { $this->setImposta($jsonObj->imposta); } if (isset($jsonObj->totale)) { $this->setTotale($jsonObj->totale); } if (isset($jsonObj->noteTestata)) { $this->setNoteTestata($jsonObj->noteTestata); } if (isset($jsonObj->notePiede)) { $this->setNotePiede($jsonObj->notePiede); } if (isset($jsonObj->acconto)) { $this->setAcconto($jsonObj->acconto); } if (isset($jsonObj->speseBancarie)) { $this->setSpeseBancarie($jsonObj->speseBancarie); } if (isset($jsonObj->speseTrasporto)) { $this->setSpeseTrasporto($jsonObj->speseTrasporto); } if (isset($jsonObj->assegnaProtocollo)) { $this->setAssegnaProtocollo($jsonObj->assegnaProtocollo); } if (isset($jsonObj->numeroProtocollo)) { $this->setNumeroProtocollo($jsonObj->numeroProtocollo); } if (isset($jsonObj->dataProtocollo)) { $this->setDataProtocollo($this->parseDate($jsonObj->dataProtocollo)); } if (isset($jsonObj->protocolloAssegnato)) { $this->setProtocolloAssegnato($jsonObj->protocolloAssegnato); } if (isset($jsonObj->protocolloAggiuntivo)) { $this->setProtocolloAggiuntivo($jsonObj->protocolloAggiuntivo); } if (isset($jsonObj->noteImballo)) { $this->setNoteImballo($jsonObj->noteImballo); } if (isset($jsonObj->dataConsegna)) { $this->setDataConsegna($this->parseDate($jsonObj->dataConsegna)); } if (isset($jsonObj->riferimentoDocumento)) { $this->setRiferimentoDocumento($jsonObj->riferimentoDocumento); } if (isset($jsonObj->sequenziale)) { $this->setSequenziale($jsonObj->sequenziale); } if (isset($jsonObj->terminiConsegna)) { $this->setTerminiConsegna($jsonObj->terminiConsegna); } if (isset($jsonObj->jolly)) { $this->setJolly($jsonObj->jolly); } if (isset($jsonObj->valuta)) { $this->setValuta(Valuta::fromJson($jsonObj->valuta, $this->_xapiClient)); } if (isset($jsonObj->causaleMagazzino)) { $this->setCausaleMagazzino(CausaleMagazzino::fromJson($jsonObj->causaleMagazzino, $this->_xapiClient)); } if (isset($jsonObj->causaleMagazzino2)) { $this->setCausaleMagazzino2(CausaleMagazzino::fromJson($jsonObj->causaleMagazzino2, $this->_xapiClient)); } if (isset($jsonObj->causaleContabile)) { $this->setCausaleContabile(CausaleContabile::fromJson($jsonObj->causaleContabile, $this->_xapiClient)); } if (isset($jsonObj->tipoDocumento)) { $this->setTipoDocumento(TipoDocumento::fromJson($jsonObj->tipoDocumento, $this->_xapiClient)); } if (isset($jsonObj->divisione)) { $this->setDivisione(Divisione::fromJson($jsonObj->divisione, $this->_xapiClient)); } if (isset($jsonObj->soggetto)) { $this->setSoggetto(Soggetto::fromJson($jsonObj->soggetto, $this->_xapiClient)); } if (isset($jsonObj->rapporto)) { $this->setRapporto(Rapporto::fromJson($jsonObj->rapporto, $this->_xapiClient)); } if (isset($jsonObj->sedeLegale)) { $this->setSedeLegale(Sede::fromJson($jsonObj->sedeLegale, $this->_xapiClient)); } if (isset($jsonObj->sedeDocumento)) { $this->setSedeDocumento(Sede::fromJson($jsonObj->sedeDocumento, $this->_xapiClient)); } if (isset($jsonObj->sedeMerce)) { $this->setSedeMerce(Sede::fromJson($jsonObj->sedeMerce, $this->_xapiClient)); } if (isset($jsonObj->agente)) { $this->setAgente(Agente::fromJson($jsonObj->agente, $this->_xapiClient)); } if (isset($jsonObj->deposito)) { $this->setDeposito(Deposito::fromJson($jsonObj->deposito, $this->_xapiClient)); } if (isset($jsonObj->deposito2)) { $this->setDeposito2(Deposito::fromJson($jsonObj->deposito2, $this->_xapiClient)); } if (isset($jsonObj->porto)) { $this->setPorto(Porto::fromJson($jsonObj->porto, $this->_xapiClient)); } if (isset($jsonObj->vettore)) { $this->setVettore(Vettore::fromJson($jsonObj->vettore, $this->_xapiClient)); } if (isset($jsonObj->modalitaTrasporto)) { $this->setModalitaTrasporto(ModalitaTrasporto::fromJson($jsonObj->modalitaTrasporto, $this->_xapiClient)); } if (isset($jsonObj->banca)) { $this->setBanca(Banca::fromJson($jsonObj->banca, $this->_xapiClient)); } if (isset($jsonObj->modalitaPagamento)) { $this->setModalitaPagamento(ModalitaPagamento::fromJson($jsonObj->modalitaPagamento, $this->_xapiClient)); } if (isset($jsonObj->assoggettamentoIva)) { $this->setAssoggettamentoIva(Iva::fromJson($jsonObj->assoggettamentoIva, $this->_xapiClient)); } if (isset($jsonObj->imballo)) { $this->setImballo(Imballo::fromJson($jsonObj->imballo, $this->_xapiClient)); } if (isset($jsonObj->listino)) { $this->setListino(Listino::fromJson($jsonObj->listino, $this->_xapiClient)); } if (isset($jsonObj->ordine)) { $this->setOrdine(DocumentoTestata::fromJson($jsonObj->ordine, $this->_xapiClient)); } if (isset($jsonObj->documentiDettaglio) && is_array($jsonObj->documentiDettaglio)) { $documentiDettaglio = array(); foreach ($jsonObj->documentiDettaglio as $dettaglioObj) { $documentiDettaglio[] = DocumentoDettaglio::fromJson($dettaglioObj, $this->_xapiClient); } $this->setDocumentiDettaglio($documentiDettaglio); } }
public function run() { Sede::create(["Codigo" => "DC", "Nombre" => "SUCURSAL", "Principal" => false]); Sede::create(["Codigo" => "DN", "Nombre" => "PRINCIPAL", "Principal" => false]); }
<!-- =========================================================================== Controlador para añadir una nueva sede Creado por: Andrea Sanchez Fecha: 08/01/2016 ============================================================================ --> <?php include_once "../../modelo/model_sede.php"; $idSede = $_POST['sede']; $nuevaSede = new Sede(); //Crear la sede if ($nuevaSede->crear($idSede)) { header('Location:../../vistas/admin/a_menu.php'); } else { die("Error al crear la sede " . $idSede); }
protected function setFieldsFromJsonObj($jsonObj) { if (isset($jsonObj->codice)) { $this->setCodice($jsonObj->codice); } if (isset($jsonObj->committente)) { $this->setCommittente($jsonObj->committente); } if (isset($jsonObj->dataRegEsenzione) && !empty($jsonObj->dataRegEsenzione)) { $this->setDataRegEsenzione($jsonObj->dataRegEsenzione); } if (isset($jsonObj->numeroRegEsenzione)) { $this->setNumeroRegEsenzione($jsonObj->numeroRegEsenzione); } if (isset($jsonObj->dataScadenzaEsenzione) && !empty($jsonObj->dataScadenzaEsenzione)) { $this->setDataScadenzaEsenzione($jsonObj->dataScadenzaEsenzione); } if (isset($jsonObj->numeroEsenzione)) { $this->setNumeroEsenzione($jsonObj->numeroEsenzione); } if (isset($jsonObj->dataEsenzione) && !empty($jsonObj->dataEsenzione)) { $this->setDataEsenzione($jsonObj->dataEsenzione); } if (isset($jsonObj->personaDaContattare)) { $this->setPersonaDaContattare($jsonObj->personaDaContattare); } if (isset($jsonObj->email)) { $this->setEmail($jsonObj->email); } if (isset($jsonObj->contoCorrente)) { $this->setContoCorrente($jsonObj->contoCorrente); } if (isset($jsonObj->codicePaese)) { $this->setCodicePaese($jsonObj->codicePaese); } if (isset($jsonObj->iban)) { $this->setIban($jsonObj->iban); } if (isset($jsonObj->swift)) { $this->setSwift($jsonObj->swift); } if (isset($jsonObj->note)) { $this->setNote($jsonObj->note); } if (isset($jsonObj->soggetto)) { $this->setSoggetto(Soggetto::fromJson($jsonObj->soggetto, $this->_xapiClient)); } if (isset($jsonObj->tipoSoggetto)) { $this->setTipoSoggetto(TipoSoggetto::fromJson($jsonObj->tipoSoggetto, $this->_xapiClient)); } if (isset($jsonObj->sedeDocumento)) { $this->setSedeDocumento(Sede::fromJson($jsonObj->sedeDocumento, $this->_xapiClient)); } if (isset($jsonObj->sedeMerce)) { $this->setSedeMerce(Sede::fromJson($jsonObj->sedeMerce, $this->_xapiClient)); } if (isset($jsonObj->sedeRiba)) { $this->setSedeRiba(Sede::fromJson($jsonObj->sedeRiba, $this->_xapiClient)); } if (isset($jsonObj->esenzioneIva)) { $this->setEsenzioneIva(Iva::fromJson($jsonObj->esenzioneIva, $this->_xapiClient)); } if (isset($jsonObj->agente)) { $this->setAgente(Agente::fromJson($jsonObj->agente, $this->_xapiClient)); } if (isset($jsonObj->listino)) { $this->setListino(Listino::fromJson($jsonObj->listino, $this->_xapiClient)); } if (isset($jsonObj->modalitaPagamento)) { $this->setModalitaPagamento(ModalitaPagamento::fromJson($jsonObj->modalitaPagamento, $this->_xapiClient)); } if (isset($jsonObj->deposito)) { $this->setDeposito(Deposito::fromJson($jsonObj->deposito, $this->_xapiClient)); } if (isset($jsonObj->banca)) { $this->setBanca(Banca::fromJson($jsonObj->banca, $this->_xapiClient)); } }
<!-- =========================================================================== Controlador para eliminar una sede Creado por: Andrea Sanchez Fecha: 08/01/2016 ============================================================================ --> <?php include_once "../../modelo/model_sede.php"; $idSede = $_POST['sede']; $delSede = new Sede(); //Eliminar la sede if ($delSede->eliminar($idSede)) { header('Location:../../vistas/admin/a_menu.php'); } else { die("La sede " . $idSede . " no existe."); }
/** *Permite eliminar una sede *@param int identificador de la sede en la base de datos *@return int numero de registros alterados */ public function eliminarSede($idsede) { $unaSede = new Sede(); $resultado = $unaSede->eliminar($idsede); echo $resultado; }