
	<? 
	require 'templates/'.$tfold.'/header.php'; ?>
	</td>
  </tr>
  
 <tr>
 <td>
 <table cellpadding="0" cellspacing="0" width=100% border="0" class="ft2">
 <th class="tr_border" colspan="6"><font size="2"><b><div align="left">
 &nbsp;&nbsp;<? echo "$lang_144" ?>&nbsp;</div> </b></font> </th>
  <? 
 $recordset=mysql_query($query);
 $total_records=mysql_num_rows($recordset);

 if($total_records>0)
{ 
//get the total records
if(strlen($currec)==0) //check firstpage 
$currec = 1;  
$start = ($currec - 1) * $limitsize;
$end = $limitsize;
$query .=" limit $start,$end";
}
 $rec_sql="select  * from genaralsettings where set_id=54";
 $rec_res=mysql_query($rec_sql);
 $rec_row=mysql_fetch_array($rec_res); 
 $limitsize=$rec_row[set_value]; 

if($total_records==0)
{
 ?>
 <tr><td align="center" class="warning_color" colspan="5">
<br>
<br>
<br>
<font size="3" color="red">
<?
echo $err_48;
?> </font>
<br>
<br>
<br></td></tr>
</table>
<tr align="center">
<td colspan="5"><? require 'templates/'.$tfold.'/footer.php'?></td></tr>
</table>
</td></tr></table>
</body></html>
<? 
exit();
} 
?>
<tr bgcolor="#DDDDDD">
<td>&nbsp;</td>
<td><font class="head_font" ><b><? echo "$lang_622" ?></b></font></td>
<td colspan="3"><font class="head_font" ><b><? echo "$lang_145" ?></b></font></td>


<td><font class="head_font" ><b><? echo "$lang_623" ?></b></font></td></tr>
<?
if($total_records > 0)
{
?>
<tr align="left">
<? 
$net=($currec-1*$limitsize+$end)-$total_records;
$dis=$limitsize+$start;
if($net <= 0) $net=$end;
if($dis<=$total_records)
{
?>
<td colspan=4 align="right">
<font size="2"><? echo "$lang_624" ?>  <? echo $start+1; ?>
 <? echo " - ". $dis; ?> <? echo "$lang_625" ?> <? echo $total_records; ?> <? echo "$lang_545" ?> </font></td>
<? 
}
 else 
{
?>
<tr align="left"><td colspan=4 align="right">
<font size="2"><? echo "$lang_624" ?>  <? echo $start+1;?>  <? echo "$lang_626" ?> <? echo $total_records; ?> <? echo "$lang_626" ?> </font></td>
<?
}
if($currec!=1)
{
?>
<td>
<a href="all_classifieds.php?currec=<?=($currec - 1);?>&view=<?=$view;?>&cate_id=<?=$cate_id;?>" >
<font size="2" color="red" face="Arial, Helvetica, sans-serif"><? echo "$lang_547" ?> </font></a></td>
<?
} 
$net=$total_records-($currec*$limitsize+$end) + $end;
if($net >$limitsize) $net=$limitsize;
if($net <= 0) $net=$end;
if($total_records > ($start + $end)) 
{
?>  
<td><a href="all_classifieds.php?currec=<?=($currec + 1);?>&view=<?=$view;?>&cate_id=<?=$cate_id;?>" >
<font class="head_font" color="red" face="Arial, Helvetica, sans-serif"> <? echo "$lang_546" ?> </font> </a></td>
<?
 }
?>
</tr>
<?
} 
?>
<?
 $c=1;
 
 $recordset=mysql_query($query);
 while($record=mysql_fetch_array($recordset))
 {
$bid_sql="select * from site_bids where productid=$record[productid]";
$bid_res=mysql_query($bid_sql);
$bid=mysql_fetch_array($bid_res);
$tot_bid=mysql_num_rows($bid_res);
$fea_sql="select * from featuredproducts where productid=".$record['productid'];
$fea_res=mysql_query($fea_sql);
$fea=mysql_fetch_array($fea_res);
  if(($fea[border]=="Yes") && ($fea[highlight]=="Yes"))
  $both="Yes";
  else if ($fea[border]=="Yes")
  $both="border";
  else if ($fea[highlight]=="Yes")
  $both="highlight";

if($tot_bid!=0)
{
$current_price=$bid['bidding_amount'];
$no_bids=$tot_bid;
}
else
{
$current_price=$record['min_bid_amount'];
$no_bids="No Bid";
}
$expire_date =$record[expire_date]; 
require 'ends.php';
  if($c==1)
  {
  $c=0;
  if($both=="Yes")
  {
   ?>
  <tr class="both">  
  <?
  }
  else if($both=="border")
  {
  echo "border";
  $c=0;
  ?>
<tr class="border_tr">  
    <?
  }
  else if($both=="highlight")
  {
  $c=0;
  ?>
<tr class="highlight">  
    <?
  }
else
  {
  $c=0;
  ?>
<tr class="tr_color_1">  
    <?
  }
  }
  else 
  {
  if($both=="Yes")
  {
   ?>
  <tr class="both">  
  <?
  }
  else if($both=="border")
  {
  $c=0;
  ?>
<tr class="border_tr">  
    <?
  }
  else if($both=="highlight")
  {
  $c=0;
  ?>
<tr class="highlight">  
    <?
  }
  else
  {
  ?>
  <tr class="tr_color_2">
  <? 
  $c=1;
  }
  } ?>
   <td width=30 align=center>
 		<a href="classifieds.php?productid=<?= $record['productid'];?>&qty=1">
		<img src="templates/<? echo "$tfold" ?>/img_files/classi.gif" border="0" alt="<? echo "$lang_117" ?> "></a>
   </td>
 <td>
 <? 
 	if(!empty($record[picture1]))
	{
	
	               $img=$record['picture1'];
				   list($width, $height, $type, $attr) = getimagesize("uploads/$img");
				   $h=$height;
				   $w=$width;
				   if($h>80)	
				   {
				   $nh=80;
				   $nw=($w/$h)*$nh;
				   $h=$nh;
				   $w=$nw;
				   }
				  if($w>80)
				  {
				  $nw=80;
				  $nh=($h/$w)*$nw;
				  $h=$nh;
				  $w=$nw;
				  }
	 ?>
	 <a href="classifieds.php?productid=<? echo $record['productid']; ?>">
	 <img src="uploads/<? echo $record['picture1']; ?>" border=0  width=<?= $w; ?> height=<?=$h?>></a> 
     <?
	 }
	 else
	 {
	 ?>
	 <a href="classifieds.php?productid=<? echo $record['productid']; ?>">
	 <img src="templates/<? echo "$tfold" ?>/img_files/no-image.gif" border=0  width=<?= $w; ?> height=<?=$h?> ></a> 
     <? 
     }
     ?> 		 
  </td>
  <td colspan="3">
 <a href="classifieds.php?productid=<? echo $record['productid']; ?>"><?=$record['producttitle']; ?></a></td>
<td><?= $string_difference; ?></td></tr>
<?
} //while($record=mysql_fetch_array($recordset))
?>
</table>
<tr align="center"><td ><? require 'templates/'.$tfold.'/footer.php'?></td></tr>
</table>