<?php

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

    $Position   = '../';
    require_once($Position.'config/config.php');
    require_once($Position.'config/conexion.php');

  }else{

  }

  //CatalogoTemas
  $Query = "
    SELECT
      tem.Id, tem.Clave, tem.Nombre
    FROM CatalogoTemas tem
    WHERE tem.Id != '0'
    ORDER BY tem.Nombre ASC
  ";
  $Temas = $mysqli->query($Query);

?>
<div class="ItemOpc row form-group">

  <div class="col-sm-6">
    <select name="Temas[]" class="form-control chosen-select">
      <option value=""></option>
      <?php
        mysqli_data_seek($Temas, 0);
        while($Tema = mysqli_fetch_array($Temas)) {
      ?>
        <option
          <?php if( $Tem[Fk_Tema] == $Tema[Clave] ){ echo "selected='selected'"; } ?>
          value="<?php echo $Tema[Clave]; ?>"
        >
          <?php echo $Tema[Nombre];?>
        </option>
      <?php } ?>
    </select>
  </div>
  <div class="col-sm-3">
    <button type="button" class="DelItemOpc btn btn-sm btn-danger"><i class="fa fa-times"></i></button>
  </div>

</div>
