
   <head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
	<!-- El CSS de DataTables -->
	<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/jszip-2.5.0/pdfmake-0.1.18/dt-1.10.12/af-2.1.2/b-1.2.2/b-colvis-1.2.2/b-flash-1.2.2/b-html5-1.2.2/b-print-1.2.2/cr-1.3.2/fc-3.2.2/fh-3.1.2/kt-2.1.3/r-2.1.0/rr-1.1.2/sc-1.4.2/se-1.2.0/datatables.min.css"/>
	<!-- El CSS de Bootstrap -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
	<!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css">-->
</head>

  <!-- Content Header (Page header) -->
  <section class="content-header">
    <h4 class="page-header">
                        OPCIONES PRINCIPALES INVENTARIO ALMACEN COMERCIAL"<small>seleccione la categoría <code>!seleccione correctamente¡</code><code></code></small>
                   </h4>
   
    
  </section>
  
  <!-- Main content -->
  <section class="content">
    <div class="row">
      <div class="col-lg-12 col-xs-12">
        <div class="alert alert-info alert-dismissable">
          <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
          <p style="font-size:15px">
            <i class="icon fa fa-user"></i> Bienvenido <strong><?php echo $_SESSION['name_user']; ?></strong> a la aplicación de inventario de productos.
          </p>        
        </div>
      </div>  
    </div>
   
   <!--     Perdmisos para administrar MERCADOTECNIA    -->
   
   
    <!-- Small boxes (Stat box) 
	
	
	<div class="small-box bg-info">
  <div class="inner">
    <h3>150</h3>
    <p>New Orders</p>
  </div>
  <div class="icon">
    <i class="fas fa-shopping-cart"></i>
  </div>
  <a href="#" class="small-box-footer">
    More info <i class="fas fa-arrow-circle-right"></i>
  </a>
</div>-->
	
	
	
	
	
	
	
    <div class="row">
      <div class="col-lg-3 col-xs-6">
        <!-- small box -->
        <div style="background-color:#00c0ef;color:#fff" class="small-box bg-info">
          <div class="inner">
          <h3>Salidas</h3>
          <p>REIMPRIME</p>
          </div>
          <div class="icon">
          <i ></i>
          </div>
                <a href="?module=medicines_consulta_enc" class="small-box-footer" title="Imprimir" data-toggle="tooltip"><i class="fa fa-print"></i></a>
                <a class="small-box-footer"><i class="fa"></i> MAS INFORMACION <i class="fa fa-arrow-circle-right"></i></a>   
          </div>
          </div><!-- ./col -->
		

     <div class="row">
      <div class="col-lg-3 col-xs-6">
        <!-- small box -->
        <div style="background-color:#FF5233;color:#ffff" class="small-box">
          <div class="inner">
          <h3>Reporte Salidas</h3>
          <p>CONSULTA</p>
          </div>
          <div class="icon">
          <i ></i>
          </div>
                <a href="?module=stock_report_folio" class="small-box-footer" title="Imprimir" data-toggle="tooltip"><i class="fa fa-print"></i></a>
                <a class="small-box-footer"><i class="fa"></i> MAS INFORMACION <i class="fa fa-arrow-circle-right"></i></a>   
          </div>
          </div><!-- ./col -->  
 		
		
	 <div class="row">
      <div class="col-lg-3 col-xs-6">
        <!-- small box -->
        <div style="background-color:#00a65a;color:#fff" class="small-box">
          <div class="inner">
          <h3>Transacciones	</h3>
          <p>CONSULTA</p>
          </div>
          <div class="icon">
          <i ></i>
          </div>
                <a href="?module=stock_report" class="small-box-footer" title="Imprimir" data-toggle="tooltip"><i class="fa fa-print"></i></a>
                <a class="small-box-footer"><i class="fa"></i> MAS INFORMACION <i class="fa fa-arrow-circle-right"></i></a>   
          </div>
          </div><!-- ./col -->
		  
		  <!-- Small boxes (Stat box) -->
		  
		  
		  <div class="row">
      <div class="col-lg-3 col-xs-6">
        <!-- small box -->
        <div style="background-color:#FFC133;color:#ffff" class="small-box">
          <div class="inner">
          <h3>Kardex</h3>
          <p>CONSULTA</p>
          </div>
          <div class="icon">
          <i ></i>
          </div>
                <a href="?module=view_kardex" class="small-box-footer" title="Imprimir" data-toggle="tooltip"><i class="fa fa-print"></i></a>
                <a class="small-box-footer"><i class="fa"></i> MAS INFORMACION <i class="fa fa-arrow-circle-right"></i></a>   
          </div>
          </div><!-- ./col -->
		  
		</div><!-- ./col -->  
	 </div><!-- ./col -->	  
    </div><!-- /.row -->
    </div><!-- /.row -->
  </section><!-- /.content -->
  
   <!--     Fin Perdmisos para administrar Exp    -->
   <!-- Main content -->
<section class="content">
  <div class="row">
    <div class="col-md-20">
	<h3 class="box-title center" >MONITOR DE REMISIONES ACTIVAS:</h3>
      <div class="box box-primary">
        <div class="box-body">
         
         <table id="dataTables2" class="table table-bordered table-striped table-hover">           
            <thead>
              <tr>
               <th class="center">Folio</th>
              
				<th class="center">Tipo</th>
                <th class="center">Fecha</th>
                <th class="center">Status</th>
				<th class="center">Acciones</th>
				 
              </tr>
            </thead>         
            <tbody>
            <?php  
				$query = mysqli_query($mysqli, "
						    SELECT a.id, a.serie, a.folio, a.fecha, b.tipo_transaccion AS 'Tipo', a.status
                            FROM remision_encabezado AS a
                            JOIN remision_detalle AS b ON b.idenc = a.id
                            JOIN usuarios AS u ON b.created_user = u.id_user
                            WHERE a.status = 'A'
                            GROUP BY a.folio
                            ORDER BY a.id DESC;
                            ")
                or die('error '.mysqli_error($mysqli));

           
            while ($data = mysqli_fetch_assoc($query)) { 
              $folio = $data['folio'];  //  Adrian
              $fecha    = $data['fecha'];
              $exp      = explode('-',$fecha);
              $fecha2   = $exp[2]."-".$exp[1]."-".$exp[0];
              $sta = $data['status'];

              echo "<tr>
                                     
                      <td width='100' class='center'>$data[serie]$data[folio]</td>
					           
					            <td width='80' class='center'>$data[Tipo]</td>
                      <td width='100' class='center'>$fecha</td>
                      <td width='100' class='center'>$sta</td>
					  <td width='100' class='center'>
                      <a href='modules/trade/remision/reprint.php?id=$data[id]' class='btn-circle' target='_blank'><i class='glyphicon glyphicon-print' data-toggle='tooltip' title='Reimprimir'></i></a>
                      <a href='?module=remision_consulta&id=$data[id]' class='btn-circle'><i class='glyphicon glyphicon-remove' data-toggle='tooltip' title='Cancelar' onclick='return cancelar(\"$data[status]\");'></i></a>
                      <a href='modules/trade/remision/surtir.php?id=$data[id]' target='_blank' class='btn-circle'><i class='glyphicon glyphicon-ok' data-toggle='tooltip' title='Surtir'  onclick='return surtir(\"$data[status]\");'></i></a>                      
                      </td> 
				
                            
                      </td>     
                    </tr>";
            }
            ?>
            </tbody>
          </table>
		  
        </div><!-- /.box-body -->
      </div><!-- /.box -->
    </div><!--/.col -->
  </div>   <!-- /.row -->
</section><!-- /.content-->
<script language="javascript" src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
	<!-- El JavaScript de DataTables -->
	<script language="javascript" type="text/javascript" src="https://cdn.datatables.net/v/dt/jszip-2.5.0/pdfmake-0.1.18/dt-1.10.12/af-2.1.2/b-1.2.2/b-colvis-1.2.2/b-flash-1.2.2/b-html5-1.2.2/b-print-1.2.2/cr-1.3.2/fc-3.2.2/fh-3.1.2/kt-2.1.3/r-2.1.0/rr-1.1.2/sc-1.4.2/se-1.2.0/datatables.min.js"></script>
	<!-- El JavaScript de BootStrap -->
	<script language="javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

<script type="text/javascript">


<script >
$('#dataTables2').dataTable( 

  
{
	
    "drawCallback": function( settings ) {
         $('ul.pagination').addClass("pagination-sm");
		 
    }
	
	
});
	</script>   
   
 