<!-- #include file="conexao.asp" -->
<%
Set conexao =Server.CreateObject("ADODB.RecordSet")
conexao.cursorlocation = 3
msql = "SELECT * FROM servicos ORDER BY codigo DESC"
conexao.open msql, Conn, 3, 3

conexao.PageSize = 15

'Criamos as Validações
if conexao.eof then
   Mensagem = "Nenhum Registro Encontrado"
   Response.End
else
   'Definimos em qual pagina o visitante está
   if Request.QueryString("pagina")="" then
      intpagina = 1
   else
      if cint(Request.QueryString("pagina"))<1 then
intpagina = 1
      else
if cint(Request.QueryString("pagina"))>conexao.PageCount then  
    intpagina = conexao.PageCount
         else
    intpagina = Request.QueryString("pagina")
end if
      end if   
   end if   
        end if
%>
<html>
<head>
<title>Painel de Controle</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
a { color: #000000; text-decoration: none; }
a:hover {color: #cccccc; text-decoration: none; }
-->
</style>
</head>

<body LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#999999">
  <tr>
    <td width="67%" bgcolor="#999999"><font size="2" face="Tahoma"><strong>[Painel 
      de Controle]</strong></font></td>
    <td width="33%" bgcolor="#999999"><div align="right"><font size="2" face="Tahoma">        [<a href="http://www.planegeo.com.br">Sair</a>] </font></div></td>
  </tr>
</table>
<br>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"> 
<tr> 
  <td width="160" valign="top"> <!--#include file="menu.txt" --></td>
<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr> 
      <td height="37"><div align="center"> 
          <hr>
        </div></td>
    </tr>
    <tr> 
      <td height="12" bgcolor="#666666"><font color="#FFFFFF" size="1" face="Verdana, Arial, Tahoma"><strong>- 
        Editar Servicos</strong></font></td>
    </tr>
  </table> 
  <div align="center"><br>
  </div>
  <table width="100%" border="0" cellpadding="1" cellspacing="1">
    <tr> 
      <%
   'Iniciamos o Loop
    conexao.AbsolutePage = intpagina
    intrec = 0
    While intrec<conexao.PageSize and not conexao.eof  
  %>
          <td height="19" bgcolor="#E2E2E2"><table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td width="5%" height="18"><div align="center"><font size="1" face="Verdana, Arial, Tahoma"><%= conexao("codigo") %> - </font></div></td>
              <td width="80%"><div align="left"><font size="1" face="Verdana, Arial, Tahoma"><%= conexao("titulo") %></font></div></td>
              <td width="15%" bgcolor="#FFFFFF"><div align="center"><font size="1" face="Verdana, Arial, Tahoma"><a href="upload_foto_servico.asp?codigo=<%=conexao("codigo")%>">Inserir Foto</a> | <a href="form_edit_servico.asp?codigo=<%=conexao("codigo")%>">Editar</a></font></div></td>
            </tr>
          </table></td>
    </tr>
    <%
    conexao.MoveNext
    intrec = intrec + 1
    if conexao.eof then
       response.write " "
    end if   
    Wend  
  %>
  </table> 
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td><div align="center"><%
    'Criamos as Validações para a navegação "Anterior" e "Próximo"  
    if intpagina>1 then
    %>
    <a href="edit_servico.asp?pagina=<%=intpagina-1%>">Anterior</a>
    <%
    end if
    if StrComp(intpagina,conexao.PageCount)<>0 then  
    %>
     | 
	<a href="edit_servico.asp?pagina=<%=intpagina + 1%>">Próximo</a>  
    <%
    end if
    conexao.close
    Set conexao = Nothing
    %></div></td>
    </tr>
  </table></td>
</tr>
<tr bgcolor="#999999"> 
  <td height="19" colspan="2" valign="top">&nbsp;</td>
</tr></table>
</body> </html> 