<?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"]);
<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) {
                // Delete From ut Table
            }