Example #1
0
 public function Registrar(UT $data)
 {
     try {
         $sql = "INSERT INTO ut (inicio,fin,valor) \n\t\t        VALUES (?, ?, ?)";
         $this->pdo->prepare($sql)->execute(array($data->__GET('inicio'), $data->__GET('fin'), $data->__GET('valor')));
     } catch (Exception $e) {
         die($e->getMessage());
     }
     return true;
 }
Example #2
0
 public function queryByValor($valor)
 {
     $this->conex = DataBase::getInstance();
     $consulta = "SELECT * FROM FISC_UNIDADTRIBUTARIA WHERE valor=:valor";
     $stid = oci_parse($this->conex, $consulta);
     if (!$stid) {
         $e = oci_error($this->conex);
         trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
     }
     // Realizar la lógica de la consulta
     oci_bind_by_name($stid, ':valor', $valor);
     $r = oci_execute($stid);
     if (!$r) {
         $e = oci_error($stid);
         trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
     }
     // Obtener los resultados de la consulta
     $alm = new UT();
     while ($fila = oci_fetch_array($stid, OCI_ASSOC + OCI_RETURN_NULLS)) {
         $it = new ArrayIterator($fila);
         while ($it->valid()) {
             $alm->__SET(strtolower($it->key()), $it->current());
             $it->next();
         }
     }
     //Libera los recursos
     oci_free_statement($stid);
     // Cierra la conexión Oracle
     oci_close($this->conex);
     //retorna el resultado de la consulta
     return $alm;
 }
Example #3
0
<?php

header("../../../public_html/js/emergente.js");
//Incluír Modelo y Vista
include "../Models/include_ut.php";
include "../Views/mensajes.php";
include '../../../resources/orcl_conex.php';
//include("../view/class.Visualizer.php");
$op = $_POST['option'];
$ut = new UT();
$utd = new UTDAO();
if (isset($_POST['valor'])) {
    $clave = addslashes($_POST['valor']);
} elseif (isset($_POST['finicio'])) {
    $anio = addslashes($_POST['yinicio']);
    $mes = addslashes($_POST['minicio']);
    $dia = addslashes($_POST['dinicio']);
} elseif (isset($_POST['ffin'])) {
    $anio = addslashes($_POST['yfin']);
    $mes = addslashes($_POST['mfin']);
    $dia = addslashes($_POST['dfin']);
}
// Registrar Unidad Tributaria: INSERT INTO ut
if ($op == 'insertar') {
    $existe = 0;
    $yinicio = addslashes($_POST["yinicio"]);
    $minicio = addslashes($_POST["minicio"]);
    $dinicio = addslashes($_POST["dinicio"]);
    $yfin = addslashes($_POST["yfin"]);
    $mfin = addslashes($_POST["mfin"]);
    $dfin = addslashes($_POST["dfin"]);
Example #4
0
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Registro UT</title>
</head>
<body>
	<?php 
include "../UT/include_ut.php";
if ($_POST["option"] == 1) {
    $inicio = addslashes($_POST["inicio"]);
    $fin = addslashes($_POST["fin"]);
    $valor = addslashes($_POST["valor"]);
    $ut = new UT();
    $ut->__SET("inicio", $inicio);
    $ut->__SET("fin", $fin);
    $ut->__SET("valor", $valor);
    $utd = new UTDAO("mysql");
    if ($utd->Registrar($ut)) {
        echo "Operación exitosa";
    } else {
        echo "Operación Fallida";
    }
} else {
    if ($_POST["option"] == 2) {
        //Código para procesar el Select
    } else {
        if ($_POST["option"] == 3) {
            //Código para procesar el Update
        } else {
            if ($_POST["option"] == 4) {