<?php
include '../../session.php';

$vcod = 0;
if (isset($_REQUEST['idreclamo'])) {
    $vcod = $_REQUEST['idreclamo'];
} else {
    $vcod = $_SESSION['idreclamo'];
}
?>

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <?php
        require '../../conexion.php';
        require '../../menu/css_lte.ctp';
        ?>
    </head>
    <body class="hold-transition skin-blue sidebar-mini">
        <div class="wrapper">
            <?php require '../../menu/cabecera.ctp'; ?><!--BARRA DE HERRAMIENTAS-->
            <?php require '../../menu/izquierda.ctp'; ?><!--BARRA DE HERRAMIENTAS-->

            <div class="content-wrapper">
                <div class="content">   
                    <!--impresion del titulo de la pagina-->
                    <div class="row">
                        <div class="col-lg-12">
                            <h3 class="page-header">Detalles de Reclamos
                                <a href="reclamos_index.php" 
                                   class="btn btn-primary btn-circle pull-right" 
                                   rel='tooltip' title="Atras">
                                    <i class="glyphicon glyphicon-arrow-left"></i>
                                </a> 
                            </h3>   
                        </div>     
                    </div>
                    <!--impresion del titulo de la pagina-->
                    <!--impresion cabecera-->
                    <div class="row">
                        <div class="col-lg-12">
                            <div class="panel panel-primary">
                                <div class="panel-heading">
                                    Datos Cabecera
                                </div>
                                <?php
                                $reclamoscons = consultas::get_datos("select * from v_servicios_reclamos where id_reclamo =" . $vcod);
                                ?>                         
                                <!-- /.panel-heading -->
                                <div class="panel-body">
                                    <div class="table-responsive">
                                        <table width="100%"
                                               class="table table-bordered">
                                            <thead>
                                                <tr>
                                                    <th class="text-center">#</th>
                                                    <th class="text-center">Orden</th>
                                                    <th class="text-left">Cliente</th>
                                                    <th class="text-center">Fecha</th>
                                                    <th class="text-left">Comentario</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <?php foreach ($reclamoscons as $reclamos) { ?> 
                                                    <tr>
                                                        <td class="text-center"><?php echo $reclamos['id_reclamo']; ?></td>
                                                        <td class="text-center"><?php echo $reclamos['id_ordent']; ?></td>
                                                        <td class="text-left"><?php echo $reclamos['cliente']; ?></td>
                                                        <td class="text-center"><?php echo date("d/m/Y", strtotime($reclamos['rec_fecha'])); ?></td>
                                                        <td class="text-left"><?php echo $reclamos['rec_obs']; ?></td>

                                                    </tr>
                                                <?php } ?>
                                            </tbody>
                                        </table>                         
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div> 
                    <!--impresion cabecera-->
                    <!--Inicio de listado-->
                    <?php
                    $detallereclamo = consultas::get_datos("select * from v_servicios_reclamos_detalle where id_reclamo = " . $vcod);
                    ?>
                    <!--div detalle"-->
                    <div class="row">
                    <div class="col-lg-12">
                        <div class="panel panel-primary">
                            <div class="panel-heading">
                                Detalle de Reclamos
                            </div>
                            <?php if (!empty($detallereclamo)) { ?>
                                <div class="table-responsive">
                                    <table class="table table-striped">
                                        <thead>
                                            <tr>
                                                <th class="text-left">Articulo</th>
                                                <th class="text-left">Tipo de Articulo</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php foreach ($detallereclamo as $detallereclamo1) { ?>
                                                <tr>
                                                    <td class="text-left"><?php echo $detallereclamo1['art_descri']; ?></td>
                                                    <td class="text-left"><?php echo $detallereclamo1['tipo_art']; ?></td>
                                                </tr>
                                            <?php } ?>
                                        </tbody>
                                    </table>
                                <?php } else { ?>
                                    <div class="col-md-12">
                                        <div class="alert alert-info
                                             alert-dismissable">
                                            <button type="button" class="close"
                                                    data-dismiss="alert" aria-hidden="true">&times;
                                            </button>
                                            <strong>No se encontraron detalles...!</strong>
                                        </div>
                                    </div> 
                                <?php } ?>
                            </div>
                        </div>  
                    </div>
                  </div>
                    <!--/div detalle-->
                </div>
            </div>
        </div>

        <!--archivos js-->  
        <?php require '../../menu/js_lte.ctp'; ?>  
    </body>
</html>
