<?php require_once('topo.php');?>
<?php require_once('lateral.php');?>
      <!-- Right side column. Contains the navbar and content of the page -->
      <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
          <h1>
            Compras de Matéria Bruta
            <small>listagem de compras cadastradas</small>
          </h1>
          <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
            <li><a href="#">Compras de Matéria Bruta</a></li>
            <li class="active">Listagem</li>
          </ol>
        </section>

        <!-- Main content -->
        <section class="content">
          <div class="row">
            <div class="col-xs-12"><!-- /.box -->

              <div class="box">
                <div class="box-header">
                  <h3 class="box-title">Listagem de Compras Matéria Bruta</h3>
                  <button type="button" class="btn btn-primary" style=" float:right;" onclick="location.href='manutencao_compras_bruta.php';"><i class="fa fa-plus-circle" aria-hidden="true"></i> Nova Compra</button>
                </div><!-- /.box-header -->
                <div class="box-body">
                  <table id="example1" class="table table-bordered table-striped">
                    <thead>
                      <tr>
                        <th style="cursor:pointer">Código</th>
                        <th style="cursor:pointer">Data Compra</th>
                        <th style="cursor:pointer">Fornecedor</th>
                        <th style="cursor:pointer">Valor Total</th>
                        <th style="cursor:pointer">NF</th>
                        <th style="cursor:pointer">Status</th>
                        <th style="cursor:pointer">Cadastrado por</th> 
                        <th style="cursor:pointer"></th>                        
                      </tr>
                    </thead>
                    <tbody>
                    <?php
					$Seleciona = Seleciona("compras_bruta", "WHERE excluido <> 'sim'", "ORDER BY datacompra DESC");
					while($linha = mysql_fetch_array($Seleciona)){
					?>
                      <tr style="cursor:pointer">
                        <td><a href="manutencao_compras_bruta.php?idcompra_bruta=<?php echo $linha['idcompra_bruta'];?>&Filtro=DetalheCompra"><?php echo $linha['idcompra_bruta'];?></a></td>
                        <td><?php echo InverteDataNovoSeparador($linha['datacompra'], "-", "/");?></td>
                        <td><?php echo $linha['idfornecedor'];?></td>
                        <td><?php echo $linha['valor_total'];?></td>
                        <td><?php echo $linha['nf'];?></td>
                        <td><?php echo $linha['status'];?></td>
                        <td><?php echo LoginUsuario($linha['idusuario_cadastro']);?></td> 
                        <td><button type='button' class='btn btn-success'><i class="fa fa-refresh" aria-hidden="true"></i></button></td>
                      </tr>
                      <?php }?>
                    </tbody>
                  </table>
                </div><!-- /.box-body -->
              </div><!-- /.box -->
            </div><!-- /.col -->
          </div><!-- /.row -->
        </section><!-- /.content -->
      </div><!-- /.content-wrapper -->
<?php require_once('rodape.php');?>