<?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>
            Departamentos
            <small>listagem de departamentos cadastrados</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_departamentos.php?Box=<?php echo $_GET['Box'];?>">Departamentos</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 Departamentos</h3>
                  <button type="button" class="btn btn-primary" style=" float:right;" onclick="location.href='manutencao_departamentos.php?Box=<?php echo $_GET['Box'];?>';">Novo Departamento</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">Titulo</th>                     
                      </tr>
                    </thead>
                    <tbody>
                    <?php

						$Seleciona = Seleciona("departamentos", "", "ORDER BY titulo ASC");	
					while($linha = mysql_fetch_array($Seleciona)){
					?>
                      <tr style="cursor:pointer" onclick="location.href='manutencao_departamentos.php?iddepartamento=<?php echo $linha['iddepartamento'];?>&?Box=<?php echo $_GET['Box'];?>';">
                        <td><?php echo $linha['iddepartamento'];?></td>
                        <td><?php echo $linha['titulo'];?></td>                      
                      </tr>
                      <?php }?>
                    </tbody>                    
                  </table>
                </div><!-- /.box-body -->
              </div><!-- /.box -->
            </div><!-- /.col -->
          </div><!-- /.row -->
        </section><!-- /.content -->
      </div><!-- /.content-wrapper -->
<?php require_once('rodape.php');?>