<?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" style="<?php if($_GET['Box'] != ""){ echo "margin-left: 0px;"; }?>">
        <!-- Content Header (Page header) -->
        <section class="content-header">
          <h1>
            Saidas
            <small>listagem de saidas</small>
          </h1>
          <ol class="breadcrumb">
            <li><a href="index.php?Box=<?php echo $_GET['Box'];?>"><i class="fa fa-dashboard"></i> Home</a></li>
            <li><a href="listar_saidas.php?Box=<?php echo $_GET['Box'];?>">saidas</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 Saídas</h3>
                  <button type="button" class="btn btn-primary" style=" float:right;" onclick="location.href='manutencao_saidas_novo.php?Box=<?php echo $_GET['Box'];?>';">Novo saída</button>
                <!-- /.box-header -->
                <div class="box-body">
                  <table id="example1" class="table table-bordered table-striped">
                    <thead>
                      <tr>
                        <th style="cursor:pointer">Cód.</th>
                        <th style="cursor:pointer">Tipo</th>
                        <th style="cursor:pointer">Pacote</th>
                        <th style="cursor:pointer">Valor</th>
                        <th style="cursor:pointer">Qtde. Disponivel</th>
                        <th style="cursor:pointer">Data de Saída</th>
                        <th style="cursor:pointer">Data de Retorno</th>
                        <th style="cursor:pointer">Esgotado?</th>
                      </tr>
                    </thead>
                    <tbody>
					<?php
                    $cor_fundo = "#FFFFFF";		                                         
                    $seleciona = Seleciona("saida_hotel_novo", "WHERE excluido IS NULL", "ORDER BY idsaida_hotel DESC");                    
                    while($linha=mysql_fetch_array($seleciona)){	
					
					$SelecionaPacote = Seleciona("pacotes", "WHERE idpacote='".$linha['idpacote']."'", "LIMIT 0,1");
					while($pacote = mysql_fetch_array($SelecionaPacote)){
						$NomePacote = $pacote['titulo'];	
					}
                    
					if($linha['esgotado'] == "Sim"){
                    $cor_fundo = "#FFCFBF";
                    }					
					
                    ?>
                      <tr style="cursor:pointer" onclick="location.href='manutencao_saidas_novo.php?idsaida_hotel=<?php echo $linha['idsaida_hotel'];?>&Box=<?php echo $_GET['Box'];?>';">
                        <td bgcolor="<?php echo $cor_fundo;?>"><strong><?php echo $linha['idsaida_hotel'];?></strong></td>
                        <td bgcolor="<?php echo $cor_fundo;?>" style="font-size:11px;"><strong><?php echo $linha['tipo'];?></strong></td>
                        <td bgcolor="<?php echo $cor_fundo;?>" style="font-size:11px;"><?php echo $NomePacote;?></td>
                        <td bgcolor="<?php echo $cor_fundo;?>" style="font-size:11px;"><strong><?php echo $linha['valor'];?></strong></td>
                        <td bgcolor="<?php echo $cor_fundo;?>" style="font-size:11px;"><strong><?php echo $linha['quantidade'];?></strong></td>
                        <td bgcolor="<?php echo $cor_fundo;?>"  data-search='<?php echo InverteDataNovoSeparador($linha['datasaida'], "-", "/");?>' data-order='<?php echo $linha['datasaida'];?>'><strong><?php echo InverteDataNovoSeparador($linha['datasaida'],"-","/");?></strong></td>
                        <td bgcolor="<?php echo $cor_fundo;?>"  data-search='<?php echo InverteDataNovoSeparador($linha['dataretorno'], "-", "/");?>' data-order='<?php echo $linha['dataretorno'];?>'><strong><?php echo InverteDataNovoSeparador($linha['dataretorno'],"-","/");?></strong></td>
                        <td bgcolor="<?php echo $cor_fundo;?>" style="font-size:11px;"><strong><?php echo $linha['esgotado'];?></strong></td>
                      </tr>
                      <?php 		  
					  $NomePacote = "";
					  $cor_fundo = "";
					  }?>
                    </tbody>
                  </table>
                </div><!-- /.box-body -->
              </div><!-- /.box -->
            </div><!-- /.col -->
          </div><!-- /.row -->
        </section><!-- /.content -->
      </div><!-- /.content-wrapper -->
<?php require_once('rodape.php');?>