<?php
if (isset($con))
{
?>
	<!-- Modal -->
	<div class="modal fade" id="rubroModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					<h4 class="modal-title" id="myModalLabel"><i class='glyphicon glyphicon-edit'></i> Editar rubro</h4>
				</div>
			  	<form class="form-horizontal" method="post" id="editar_rubro" name="editar_rubro">
					<div class="modal-body">
						<div id="resultados_ajax_rubro"></div>
						<div class="form-group">
							
							<label for="user_name" class="col-sm-3 control-label">Nombre del Rubro</label>
							<div class="col-sm-8">
							<select class="form-control" id="nombre_rubro2" name="nombre_rubro2" required>
                <option value="">Selecciona un rubro</option>
                <?php
                // Consultamos la tabla rubros
                $sql_rubros = mysqli_query($con, "SELECT id_rubro, rubro FROM rubros ORDER BY rubro ASC");
                while ($rw = mysqli_fetch_array($sql_rubros)) {
                    $id_rubro_lista = $rw['id_rubro'];
                    $nombre_rubro_lista = $rw['rubro'];
                    ?>
                    <option value="<?php echo $nombre_rubro_lista; ?>"><?php echo $nombre_rubro_lista; ?></option>
                    <?php
                }
                ?>
              </select>
              <input type="hidden" id="mod_id_rubro" name="mod_id_rubro">
			  			</div>
		 	 		</div>
		 	 		</div>
		  			<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
						<button type="submit" class="btn btn-primary" id="actualizar_datos">Actualizar datos</button>
		  			</div>
		  		</form>
			</div>
	  	</div>
	</div>
<?php
}
?>