$id_canais=1;?>
$id_canais_new=6;
$titulo_canal="";
$texto_canal="";
$query1="Select * from canais where id_canais='$id_canais_new' and online='Sim' order by ordem";
//echo $query;
$result1 = mysql_query($query1) or die("Query failed : " . mysql_error());
$nrlinhas1=mysql_num_rows($result1);
if($nrlinhas1>0){
while($row1 = mysql_fetch_object($result1)){
$titulo_canal=$row1->titulo;
$texto_canal=$row1->texto;
}
}
?>
| |
|
|
|
$query = "Select * from loja_produtos where novidade='Sim' and online='Sim' order by ordem_novidade";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
$nr=mysql_num_rows($result);
$items=5;
$nr1=$nr/$items;
$max=(int)($nr1);
//echo "max=$max nr=$nr nr1=$nr1 pag=$pag ";
if($max!=$nr1)
$max++;
if($pag=="")$pag=1;
if(($pag<=0)||($pag>$max))
$pag=1;
$pag1=($pag-1)*$items;
//echo "max=$max nr=$nr nr1=$nr1 pagteste=$pag ";
$pag1=(int)($pag1);
$items=(int)($items);
$query1="Select * from loja_produtos where novidade='Sim' and online='Sim' order by ordem_novidade limit $pag1,$items";
//echo $query;
$result1 = mysql_query($query1) or die("Query failed : " . mysql_error());
$nrlinhas1=mysql_num_rows($result1);
if($nrlinhas1>0){
?>
|
|
while($row1 = mysql_fetch_object($result1)){
$produto_foto=$row1->foto_destaque;
if($produto_foto=="")$produto_foto="transparente.png";
$produto_breve=$row1->breve;
//echo $produto_breve." ";
$produto_breve=str_replace(""",'"',$produto_breve);
$produto_breve=str_replace("'","'",$produto_breve);
//$produto_breve=str_replace(" "," ",$produto_breve);
$tmp="";
$aux=$produto_breve;
$limite_breve=500;
for($a=0;$a<$limite_breve;$a++)
$tmp.=$aux[$a];
if(strlen($produto_breve)>$limite_breve)
$tmp.="...";
$produto_breve=$tmp;
?>
id_loja_produtos_categoria&id_loja_produtos_sub_categoria_new=$row1->id_loja_produtos_sub_categoria&id_loja_produtos_new=$row1->id_loja_produtos\">nome]\" title=\"$row1->nome\" width=\"90\" height=\"120\">";?> |
id_loja_produtos_categoria&id_loja_produtos_sub_categoria_new=$row1->id_loja_produtos_sub_categoria&id_loja_produtos_new=$row1->id_loja_produtos\">$row1->nome";?>
|
|
|
|
Preço |
|
preco_especial;?> € |
|
|
|
|
|
|
|
}
}
?>
1){?>
$pag_aux=$pag-1;if($pag>1)echo "< Página Anterior"; ?> |
if($pag<3){
$inicio=1;
$fim=5;
if($fim>$max)
$fim=$max;
}
else{
if($pag+2>$max){
$fim=$max;
$inicio=$max-4;
if($inicio<0)
$inicio=1;
}
else{
$fim=$pag+2;
$inicio=$pag-2;
if($inicio<0)
$inicio=1;
if($fim>$max)
$fim=$max;
}
}
for($i=$inicio;$i<=$fim;$i++){
if($i==$pag)
echo "$i";
else
echo "$i";
echo " ";
}?>
|
$pag_aux=$pag+1;if($pag<$max)echo "Página Seguinte >"; ?> |
|
}?>
|
|
|
|