Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Bom dia pessoal!
Estou terminando um sisteminha de controle de serviços, o único probleminha aqui é que eu preciso fazer uma páginação no arquivo onde exibe os resultados:
<?php
include("action/config.php");
$ac=mysql_query("select * from os where status=0 order by data desc");
while($r=mysql_fetch_array($ac)) {
$data=$r['data'];
$departamento=$r['departamento'];
$id=$r['id'];
$status=$r['status'];
if ($status=='0') { $status="<a href='action/sendmail.php?id=$id'>Em Aberto</a>"; }
if ($status=='1') { $status="Serviço Feito"; }
if ($status=='2') { $status="Serviço Feito"; }
$html=addslashes(implode("", file("tpls/viewos.htm")));
eval ("\$vhtml = \"$html\";");
@$bgcolor = ($coralternada++ %2 ? 'FFFFFF' : '#FFEFE6');
echo $vhtml; }
?>
Template:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<link href="../css/css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.topo2 {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 14px;
font-style: normal;
font-weight: bold;
font-variant: normal;
color: #CCC;
background-color: #333;
}
.topo3 {
color: #CCC;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 14px;
}
-->
</style></head>
<body>
<center><img src="img/linha.png" width="800" height="2" border="0">
</center><table width="800" border="0" align="center" cellpadding="0" cellspacing="3">
<tr bgcolor="#333333" class="topo3">
<th width="250" class="topo2" scope="col">Data</th>
<th width="250" scope="col">Departamento</th>
<th width="108" scope="col">Vizualização</th>
<th width="170" scope="col">Status</th>
</tr>
</table>
<table bg color="#FFFFCB" width="800" border="0" align="center" cellpadding="0" cellspacing="2" bgcolor="$bgcolor" class="ft10">
<tr bgcolor="#F7F7F7">
<td width="4%"><center>
<img src="img/icone_relogio.gif" width="12" height="12">
</center> </td>
<td width="25%"><b>$data</b></td>
<td width="30%">$departamento</td>
<td width="13%"><center>
<a href="upos.php?id=$id">Ver Serviço</a>
</center> </td>
<td width="20%"><center>
$status
</center> </td>
</tr>
</table>
</body>
</html>
No caso gostaria que fossem mostrados 10 resultados por página.. Qualquer ajuda é bem vinda, algum texto, exemplo.. Obrigado!
[]'s
Carregando comentários...