<?php
session_start();
///Construtoras listar
include "../phpconfig/config.php";
include "../phpconfig/valida_login.php";
include "../phpconfig/funcoes.php";
include "../includes/topo.php"; 

// ALTEARAR NOME DO BANCO


$sql = mysql_query("SELECT * FROM recap");
$num = mysql_num_rows($sql);

?>

<script type="text/javascript">
  // When the document is ready set up our sortable with it's inherant function(s)
  $(document).ready(function() {
    $("#test-list").sortable({
      handle : '.handle',
      update : function () {
      var order = $('#test-list').sortable('serialize');
      $("#info").load("process-sortable.php?"+order);  
   

      }
    });
}); 

</script>

        <ul class="breadcrumb">
          <li><a href="<?php echo sti('adm');  ?>">Home</a></li>
          <li class="active"><?php echo $num;    ?> Notícias</li>
        </ul>


        <table class="table table-bordered">

        <thead>
          <tr>
            <th  colspan='4'> 

              <a href="add.php" class="btn btn-success" >Adicionar novo <i class="icon-plus icon-white"></i></a>
              
            </th>

          </tr>
          <tr>
            <th>MOVER</th>

            <th></th>   
            
            
            
              
            
             
              
           
            
            <!-- 
            
            
            
            ALTERACAO
            
            
--><th>ID </th>
<th>ATIVA</th>
<th>RECAPITULANDO</th>
            <th>TIPO RECAPITULANDO</th>

             <th>Ação</th>
          </tr>
        </thead>
        <tbody id='test-list'>

          <div id="info"></div>
          <?php  

          while($lin = mysql_fetch_assoc($sql)){  ?>
          <tr id="listItem_<?php echo $lin['id']; ?>">
            <td> <div class="box_img handle" style="cursor:move;display:block">
            <div class="mover"><i class='glyphicon glyphicon-move'></i></div></td>
            
            
            
            
           <!--ALTEARAR NOME DO BANCO-->
           
           

            <td style='width:100px'><?php if(!$lin['imagem']==''){  ?><img width='100' src="<?php echo sti('up').'atividade_nivel_5/'.$lin['imagem'];  ?>" /><?php  } ?></td>
            

 <!--ANTIGO titulo_pt -->
<td><?php echo $lin['id'];  ?></td>



<td><?php
if ($lin['ativo'] == 1) {
    echo "ATIVA";
}
?></td>
            <td><?php echo $lin['recapi'];  ?></td>
            <td><?php echo $lin['cnae'];  ?></td>
              <td>
              <a href="edit.php?id=<?php echo $lin['id'];  ?>" class="btn btn-default" ><i class="glyphicon glyphicon-pencil"></i></a>
              <a href="del.php?id=<?php echo $lin['id'];  ?>" onclick="return confirma('Deseja deletar esta novidade?');" class="btn btn-default" ><i class="glyphicon glyphicon-trash"></i></a>
            </td>
          </tr>
          <?php  } if($num==0){echo "<tr><td  colspan='4'>Não há cadastro de notícias</td></tr>";} ?>


        </tbody>
      </table>

<!--div class="pagination">
  <ul>
    <li><a href="#">Prev</a></li>
    <li><a href="#">1</a></li>
    <li><a href="#">2</a></li>
    <li><a href="#">3</a></li>
    <li><a href="#">4</a></li>
    <li><a href="#">Next</a></li>
  </ul>
</div-->

<?php include "../includes/rodape.php"; ?>
