<?php header("Content-type: text/html; charset=utf-8");
include('include/config.php');
mysql_query ("set character_set_results='utf8'");	 
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Customer Address List</title>
    <link rel="icon" href="img/favicon.ico" type="image/x-icon" /> 
</head>
<body>

<table align="center" cellpadding="0" cellspacing="0" border="0" width="100%" style="font-size:11px; margin-top:30px;">
<?php

	
	$query="select * from customer where status = 1 and subscription in ('2','4','5','6')";
	$r=mysql_query($query);
	$cnt=0;
	$i=1;
	static $t=0;
	while($rs=mysql_fetch_array($r))
	{	 
		$t++;
		if($t-1%3==0){				
			echo "<tr>";
		}  
	?>

     <td align="center" style="width:6.4cm;height:3.8cm;">
     <div style="margin-left:0px; margin-top:0px;">
     

     <div style="font-size:12px;">
		<?php if(trim($rs['name'])!='') {  ?><b><?php echo trim($rs['name']); ?></b> <?php } else {  ?><b><?php echo ucfirst($rs['en_name']); ?></b> <?php } ?> &nbsp;&nbsp;
        <b><?php echo $rs['cust_number']; ?> </b> 
        </div>    
		
        <?php if($rs['address_1']!='') { ?>	<div> <?php echo $rs['address_1']; ?>   </div> <?php } ?>
        <?php if($rs['address_2']!='') { ?>	<div> <?php echo $rs['address_2']; ?>   </div> <?php } ?>
        <?php if($rs['address_3']!='') { ?>	<div><?php echo $rs['address_3'];?>	</div> <?php } ?>
    
      <div><b>તા. - </b> <?php echo $rs['talukanm']; ?>&nbsp;&nbsp;&nbsp;<b>જિ. - </b><?php echo $rs['disnm']; ?>  </div>
    <div style="font-size:12px;"><b><?php echo $rs['ctnm']." - ".$rs['pincode']; ?></b>&nbsp;&nbsp; : &nbsp;<b>State</b>&nbsp;<?php echo $rs['stnm'];?></div>
      
     </div>   
   </td>
<?php                            
                             if($t%3==0 && $t != 0){
                                    echo "</tr>";						
                                    }
                                   
									if($t%21==0)
									{
											echo "<tr> <td style='height:1.6cm;'><br/></td></tr>";
											
									}	
									
						
									
									$i++;
									
									
 } 
 
 
 ?>
</table>

</body>
</html>