<?php

  if( $_POST['action'] == 'add' ){

    $position   = '../../../';
  	require_once($position.'../switch/access.php');
  	require_once($position.'assets/global.php');
  	require_once($position.'assets/session.php');
  	require_once($position.'assets/funciones.php');

  }

?>
<div class="card Proveedor">
  <div class="card-body">

    <!-- Btn Del -->
    <button
      type="button"
      class="btn btn-danger btn-sm BtnDelPro"
      style="position:absolute;top:0px;right:0px;"
    >
      <i class="fa fa-times"></i>
    </button>
    <!-- End Btn Del -->

    <div class="form-group col-md-12">
      <label for="inputPu" class="col-form-label">Proveedor<span class="text-danger">*</span></label>
      <div class="controls">
        <select name="pros[]" class="form-control chosen-select">
          <option></option>
          <?php
            //Proveedores
            $Query = "
              SELECT
                pro.Id, pro.nombre
              FROM proveedores pro
              ORDER BY pro.nombre ASC
            ";
            $Pros = $mysqli->query($Query);
            mysqli_data_seek($Pros, 0);
            while($pro = mysqli_fetch_array($Pros)) {
          ?>
            <option
              <?php
                if( $pro['Id'] == $ProSel['fk_proveedor'] ){
                  echo 'selected="selected"';
                }
              ?>
              value="<?php echo $pro['Id']; ?>"
            >
            <?php echo $pro['nombre']; ?>
            </option>
          <?php } ?>
        </select>
      </div>
    </div>

  </div>
</div>
