<?php
session_start();
require_once('../conexion.php');
require_once('../include/sesiones.php'); 
$pen_id=$_GET['pen_id'];
?>
<div id="resultados_clie"></div>
<input type="hidden" name="pen_id" id="pen_id" value="<?php echo $pen_id;?>" >

<label></label>
<div class="input-group">
<?php
    $can=mysqli_query($con,"SELECT * from cliente c,pedido cc where c.clie_id=cc.clie_id and cc.pen_id='$pen_id' and cc.empresa='$empresa' ") or die(mysqli_error($con)); 
    if($dato=mysqli_fetch_array($can))
{ 
    $clie_id=$dato['clie_id'];
    ?>
    <span class="input-group-addon">
        <a data-toggle="modal" href="#nuevocliente" type='button'>NUEVO </a>
    </span> 
    <section id="intro" >
        <select name="clie_id" id="clie_id"  class="form-control name_list" onchange="return update_cliente(1,this.value);">
            <?php
                echo' <option value="'.$dato['clie_id'].'">'.$dato['clie_cc'].' - '.$dato['clie_nombre'].'</option>';
            ?>
            <option value=""> - </option>
            <?php
                $datoss = mysqli_query($con,"SELECT * FROM cliente WHERE clie_id<>'$clie_id' and empresa='$empresa' order by clie_nombre asc") ;
                while( $filas = mysqli_fetch_array( $datoss ) )
                {
                    echo' <option value="'.$filas['clie_id'].'">'.$filas['clie_cc'].' - '.$filas['clie_nombre'].'</option>';
                }
            ?>
        </select>
    </section>
    <span class="input-group-addon">
         <a data-id="<?php echo $dato['clie_id'];?>" class="btn-edit_cli22" title="Actualizar Cliente"><i class="btn-icon-only icon-edit"></i></a>
    </span> 
      
</div>
<?php } ?>
</br>
 <script type="text/javascript">
  

    $(".btn-edit_cli22").click(function(){
        id = $(this).data("id");
        $.get("./php_clientes/form_modificar_cliente_ven.php","id="+id,function(data){
            $("#cli-edit").html(data);
        });
        $('#edit_cliente').modal('show');
    });
</script>

<div class="modal fade" id="edit_cliente" tabindex="-1" role="dialog" aria-labelledby="editModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">Modificar Cliente</h4>
            </div>
            <div id="cli-edit"></div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<script type="text/javascript">
        $(setup)
    function setup() {
        $('#intro select').zelect({ placeholder:'' })
    }
</script>