<?php
require '../../conexion.php';
session_start();
$detalles = consultas::get_datos("select * from v_servicios_presupuesto_detalle "
        . "where id_presu =".$_REQUEST['vcod']." and id_articulo='".$_REQUEST['vart']."'");
//var_dump($detalles);
?>
<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Close">x</button>
    <h4 class="modal-title"><i class="fa fa-edit"></i> <strong>Editar Item Presupuesto</strong></h4>
</div>
<form action="detpres_control.php" method="post" accept-charset="UTF-8" class="form-horizontal">
    <input type="hidden" name="accion" value="2"/>
    <input type="hidden" name="pagina" value="detpresupuesto_agregar.php?vcod=<?php echo $_REQUEST['vcod'];?>"/>
    <input type="hidden" name="vcod" value="<?php echo $_REQUEST['vcod'];?>"/>
    <input type="hidden" name="vart" value="<?php echo $detalles[0]['id_articulo'];?>"/>
    <input type="hidden" name="vdep" value="<?php echo $detalles[0]['cod_depo'];?>"/>
    <div class="modal-body">
        <div class="form-group">
            <label class="control-label col-lg-2 col-md-2 col-sm-2">Articulo:</label>
            <div class="col-lg-10 col-md-10 col-sm-10">
                <input type="text" class="form-control" value="<?php echo $detalles[0]['art_descri'];?>" disabled=""/>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-lg-2 col-md-2 col-sm-2">Tipo Articulo:</label>
            <div class="col-lg-6 col-md-6 col-sm-6">
                <input type="text" class="form-control" value="<?php echo $detalles[0]['descripcion'];?>" disabled=""/>
            </div>
        </div>  
        <?php if(!empty($detalles[0]['dep_descrip'])){?>
        <div class="form-group">
            <label class="control-label col-lg-2 col-md-2 col-sm-2">Deposito:</label>
            <div class="col-lg-6 col-md-6 col-sm-6">
                <input type="text" class="form-control" value="<?php echo $detalles[0]['dep_descrip'];?>" disabled=""/>
            </div>
        </div>          
        <?php }?>
        <div class="form-group">
            <label class="control-label col-lg-2 col-md-2 col-sm-2">Cantidad:</label>
            <div class="col-lg-3 col-md-3 col-sm-3">
                <input type="number" class="form-control" name="vcant" value="<?php echo $detalles[0]['cantidad'];?>"/>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-lg-2 col-md-2 col-sm-2">Precio:</label>
            <div class="col-lg-4 col-md-4 col-sm-4">
                <input type="number" class="form-control" name="vprecio" value="<?php echo $detalles[0]['precio_unit'];?>"/>
            </div>
        </div>        
    </div>
    <div class="modal-footer">
        <button type="reset" data-dismiss="modal" class="btn btn-default" 
                data-title="Cerrar ventana" rel="tooltip">
            <i class="fa fa-close"></i> Cerrar
        </button>
        <button type="submit" class="btn btn-warning" data-title="Actualizar item" rel="tooltip">
            <i class="fa fa-edit"></i> Editar
        </button>
    </div>
</form>
