Example #1
0
<?php

include '../clases/clase_docente.php';
$lobjDocente = new clsDocente();
$id = isset($_GET['id']) ? $_GET['id'] : "";
$lobjDocente->set_Docente($id);
$Datos_Docente = $lobjDocente->consultar_docente_bitacora();
$OnKey = '';
if ($Datos_Docente) {
    $operacion = 'editar_docente';
    $titulo = 'Consultar docente';
    $OnKey = 'readOnly';
} else {
    $operacion = 'registrar_articulobn';
    $titulo = 'Registrar Bienes Nacionales';
}
?>

<div style="float: left" class="col-lg-8 span8 pull-left">
    <h3><?php 
print $titulo;
?>
</h3>
    <div class="alert alert-info">
        <ul>
            <li>En este formulario podrá registrar el docente que dictará el curso.</li>
            <li>Sí necesitas ayuda para usar este formulario haz clic en el botón <button class="btn btn-warning" type="button" onclick="javascript:introJs().start();"><i class="fa fa-question-circle"></i> Ayuda</button>.</li>
        </ul>
    </div>
    <form class="formulario" action="../controlador/control_docente.php" method="POST" name="form_docente">
        <input type="hidden" value="<?php 
Example #2
0
$operacion = $_POST['operacion'];
switch ($operacion) {
    case 'registrar_docente':
        $hecho = $lobjDocente->registrar_docente();
        if ($hecho) {
            $lobjBitacora->set_Datos($_SERVER['HTTP_REFERER'], $ldFecha, $lcReal_ip, 'Registrar', 'Cargar datos', '*', 'tdocente', '', '', $_SESSION['usuario'], $operacion);
            //envia los datos a la clase bitacora
            $lobjBitacora->registrar_bitacora();
            //registra los datos en la tabla tbitacora.
            $_SESSION['msj'] = 'Se ha registrado exitosamente';
        } else {
            $_SESSION['msj'] = 'Error en el registro';
        }
        break;
    case 'editar_docente':
        $laDocenteAnterior = $lobjDocente->consultar_docente_bitacora();
        $laValorNuevo = $laValorAnterior = $laCampo = array();
        $hecho = $lobjDocente->editar_docente();
        if ($hecho) {
            $cont = 0;
            foreach ($laDocenteAnterior as $key2 => $value2) {
                $value = $_POST[$key2];
                if ($value) {
                    if ($value != $value2) {
                        $laValorNuevo[] = $value;
                        $laValorAnterior[] = $value2;
                        $laCampo[] = $key2;
                        $cont++;
                    }
                }
            }