<?php 

include_once'conection.php';



    $sql = $connection->prepare("select * from encuesta");
    $sql->execute();
    $encuesta = $sql->fetchAll(PDO::FETCH_ASSOC);



?>


<!DOCTYPE html>
<html lang="es" dir="ltr">
<head>
	<title>Registro de Preguntas</title>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="stylesheet" href="bootstrap-4.4.1-dist/css/bootstrap.min.css" >
    <link rel="stylesheet" href="DataTable/css/dataTables.bootstrap4.min.css" >
    <link rel="stylesheet" href="toast/src/jquery.toast.css" type="text/css">
    <link rel="stylesheet" href="css/estilos.css" >

 



</head>
<body>


    <?php 

      if($_SESSION['rol']==3){
  ?>

   <ul class="nav nav-pills">
        <li class="nav-item">
          <a class="nav-link" href="index.php">Inicio</a>
        </li>
         <li class="nav-item">
          <a class="nav-link" href="consultar_datos.php">Consultar</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="faltan.php">Faltan</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="auditoria.php">Auditoria</a>
        </li>
        <li class="nav-item">
          <a class="nav-link active" href="#">Crear preguntas</a>
        </li>        
    </ul>

<?php 
      }
  ?>

<div class="container col-md-4 ">

 <div class="centrar">   
    <h3>COOPSERP</h3>
    <h3>REGISTRO DE PREGUNTAS</h3>
 </div> 
            <!-- INICIO FORMULARIO HTML -->
<form id="insert_form" class="" >

    <div class="form-row">
        <div class="col mb-3">
            <label for="encuesta">Encuesta:<span class="red">*</span></label>
            <select class="custom-select js-select2" id="encuesta" name="encuesta" >
                <option value="0" disabled selected>Seleccione</option>
                <?php
                    foreach ($encuesta as $row){  
                        $enc = $row['cons'];                         
                        echo "<option value='$enc'>".$row['detalle']."</option>";
                    }          
                    
                ?>          
            </select>
        </div>
    </div>


  

    

    <div class="form-row">
        <div class="col mb-3">
            <label for="pregunta">Ingresar pregunta:<span class="red">*</span></label>
            <input type="text" class="form-control" id="pregunta"  name="pregunta" required >
        </div>
    </div>




    <div class="form-group mb-10">
        <button class="btn btn-primary" type="button" id="Guardar">Guardar</button>
       <!--  <button class="btn btn-success" type="reset" name="reset">Limpiar</button> -->
    </div>

</form>

</div>

    <script src="jquery-3.4.1/jquery-3.4.1.min.js" ></script>
    <script src="popper-1.12.9/popper-1.12.9.min.js" ></script>
    <script src="bootstrap-4.4.1-dist/js/bootstrap.min.js" ></script>
    <script src="DataTable/js/dataTables.bootstrap4.min.js"></script>
    <script src="DataTable/js/jquery.dataTables.min.js"></script>
    <script src="toast/src/jquery.toast.js"></script>
    <script src="jquery_validator_1.10.0/jquery.validate.min.js" ></script>
    <script src="jquery_validator_1.10.0/messages_es.js" ></script>    


    <!-- <script type="text/javascript">var toas = '<?php //echo json_encode($_SESSION['toas']);?>'; </script> -->
	<script src="js/registro_preg.js"></script>
</body>
</html>


    <!-- <script>
        (function() {
            'use strict';
            window.addEventListener('load', function() {
                var forms = document.getElementsByClassName('needs-validation');
                var validation = Array.prototype.filter.call(forms, function(form) {
                    form.addEventListener('submit', function(event) {
                        if (form.checkValidity() === false) {
                            event.preventDefault();
                            event.stopPropagation();
                        }
                        form.classList.add('was-validated');
                    }, false);
                });
            }, false);
        })();
    </script> -->

<!--===============================================================================================-->



<!--ventana emergente -->
          
      <!-- Button to Open the Modal -->
<!-- <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal">
  Open modal
</button> -->

<!-- The Modal -->
<div class="modal" id="myModal">
  <div class="modal-dialog">
    <div class="modal-content">

      <!-- Modal Header -->
      <div class="modal-header">
        <h4 class="modal-title">Registro Exitoso</h4>
        <button type="button" class="close" data-dismiss="modal">&times;</button>
      </div>

      <!-- Modal body -->
      <div class="modal-body">
        <div class="centrar">
            <h3>Pronto</h3> 
            <h3>nos comunicaremos</h3> 
            <h3>con usted</h3>
        </div>
      </div>

      <!-- Modal footer -->
      <div class="modal-footer">
        <button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
      </div>

    </div>
  </div>
</div>




  <!-- //////////////////////////////////////////////////////////////////////// -->


              <!--   armenia@coopserp.com - Armenia
                barranquilla@coopserp.com - Barranquilla
                bogotacentro@coopserp.com - Bogotá Centro
                elemento@coopserp.com - Bogotá Elemento
                bogota.gob@coopserp.com - Bogotá Gobernación Cundinamarca
                bogotanorte@coopserp.com - Bogotá Norte
                bogotatc@coopserp.com - Bogotá Torre Central
                bucaramanga@coopserp.com - Bucaramanga
                buenaventura@coopserp.com - Buenaventura
                buga@coopserp.com - Buga
                caicedonia@coopserp.com - Caicedonia
                cali@coopserp.com - Cali
                calibc@coopserp.com - Cali Business Center
                cartagena@coopserp.com - Cartagena
                cartago@coopserp.com - Cartago
                cucuta@coopserp.com - Cúcuta
                duitama@coopserp.com - Duitama
                ibague@coopserp.com - Ibagué
                ipiales@coopserp.com - Ipiales
                jamundi@coopserp.com - Jamundí
                launion@coopserp.com - La Unión
                leticia@coopserp.com - Leticia
                manizales@coopserp.com - Manizales
                medellin@coopserp.com - Medellín
                monteria@coopserp.com - Montería
                neiva@coopserp.com - Neiva
                palmira@coopserp.com - Palmira
                pasto@coopserp.com - Pasto
                pereira@coopserp.com - Pereira
                popayan@coopserp.com - Popayán
                riohacha@coopserp.com - Riohacha
                roldanillo@coopserp.com - Roldanillo
                sanandres@coopserp.com - San Andrés
                santamarta@coopserp.com - Santa Marta
                santanderdequilichao@coopserp.com - Santander de Quilichao
                sevilla@coopserp.com - Sevilla
                sincelejo@coopserp.com - Sincelejo
                tulua@coopserp.com - Tulua
                tunja@coopserp.com - Tunja
                valledupar@coopserp.com - Valledupar
                villavicencio@coopserp.com - Villavicencio
                yopal@coopserp.com - Yopal
                yumbo@coopserp.com - Yumbo
                zarzal@coopserp.com - Zarzal
 -->





<!--  <select class="custom-select js-select2" id="agencia" name="agencia" >
                <option selected value="0">Seleccione</option>
                <option value="armenia@coopserp.com">Armenia</option>
                <option value="barranquilla@coopserp.com">Barranquilla</option>
                <option value="bogotacentro@coopserp.com">Bogotá Centro</option>
                <option value="elemento@coopserp.com">Bogotá Elemento</option>
                <option value="bogota.gob@coopserp.com">Bogotá Gobernación Cundinamarca</option>
                <option value="bogotanorte@coopserp.com">Bogotá Norte</option>
                <option value="bogotatc@coopserp.com">Bogotá Torre Central</option>
                <option value="bucaramanga@coopserp.com">Bucaramanga</option>
                <option value="buenaventura@coopserp.com">Buenaventura</option>
                <option value="buga@coopserp.com">Buga</option>
                <option value="caicedonia@coopserp.com">Caicedonia</option>
                <option value="cali@coopserp.com">Cali</option>
                <option value="calibc@coopserp.com">Cali Business Center</option>
                <option value="cartagena@coopserp.com">Cartagena</option>
                <option value="cartago@coopserp.com">Cartago</option>
                <option value="cucuta@coopserp.com">Cúcuta</option>
                <option value="duitama@coopserp.com">Duitama</option>
                <option value="ibague@coopserp.com">Ibagué</option>
                <option value="ipiales@coopserp.com">Ipiales</option>
                <option value="jamundi@coopserp.com">Jamundí</option>
                <option value="launion@coopserp.com">La Unión</option>
                <option value="leticia@coopserp.com">Leticia</option>
                <option value="manizales@coopserp.com">Manizales</option>
                <option value="medellin@coopserp.com">Medellín</option>
                <option value="monteria@coopserp.com">Montería</option>
                <option value="neiva@coopserp.com">Neiva</option>
                <option value="palmira@coopserp.com">Palmira</option>
                <option value="pasto@coopserp.com">Pasto</option>
                <option value="pereira@coopserp.com">Pereira</option>
                <option value="popayan@coopserp.com">Popayán</option>
                <option value="riohacha@coopserp.com">Riohacha</option>
                <option value="roldanillo@coopserp.com">Roldanillo</option>
                <option value="sanandres@coopserp.com">San Andrés</option>
                <option value="santamarta@coopserp.com">Santa Marta</option>
                <option value="santanderdequilichao@coopserp.com">Santander de Quilichao</option>
                <option value="sevilla@coopserp.com">Sevilla</option>
                <option value="sincelejo@coopserp.com">Sincelejo</option>
                <option value="tulua@coopserp.com">Tulua</option>
                <option value="tunja@coopserp.com">Tunja</option>
                <option value="valledupar@coopserp.com">Valledupar</option>
                <option value="villavicencio@coopserp.com">Villavicencio</option>
                <option value="yopal@coopserp.com">Yopal</option>
                <option value="yumbo@coopserp.com">Yumbo</option>
                <option value="zarzal@coopserp.com">Zarzal</option>
            </select> -->

