    

   <style type="text/css">

    @media print
    {
		
		
    	#non-printable { display: none; }
    	#printableArea { display: block; font-size:20;margin-top:0; margin-bottom:0;


    margin: 0 0 0 0;
    overflow: hidden;  
		}
    }
    </style>
	<script>

 

	function printDiv(divName) {
     var printContents = document.getElementById(divName).innerHTML;
     var originalContents = document.body.innerHTML;

     document.body.innerHTML = printContents.fontsize(28);
     window.print();


}
	</script>








<ul class="nav nav-tabs bordered">
			<li class="active">
            	<a href="#list" data-toggle="tab"><i class="entypo-menu"></i> 
					
					<form name="print" method="post" action="">
<input type="submit" id="print"  border="1" accesskey="p" class="btn btn-primary"  name="print"onclick="printDiv('printableArea')" value="Click here to Print" />
</form>
                    	</a></li>
			
						
						
						
		</ul>
    	<!------CONTROL TABS END------>
        
		<div class="tab-content">
            <!----TABLE LISTING STARTS-->
            <div class="tab-pane box active" id="list">
				
     


 <div class="panel panel-primary" data-collapsed="0" >
  <div id="printableArea">
  <h2>
  <?php 


 echo $this->session->flashdata('imagemsg1'); 
		 
		    
$session_data = $this->session->userdata('logged_in');


$data['surname'] = $session_data['surname'];
$data['id'] = $session_data['id'];

$surname=$data['surname'];
   $userid=$data['id'];
$data['companyid'] = $session_data['companyid'];
	 $companyid = $data['companyid'];
	 
	 
		 $data['usertype'] = $session_data['usertype'];
	 $usertype = $data['usertype'];	
	 $data['branchid'] = $session_data['branchid'];
	 $branchid = $data['branchid'];		

  	
$data['firstname'] = $session_data['firstname'];

 $countbranch=$this->usermodel->countbranches($companyid);
 $firstname=$data['firstname'];

  	echo $this->session->flashdata('msg'); 
		if(validation_errors()):
		 endif;
 if(!is_array($mypayment)) 

 {




    
       echo '<div class="alert alert-warning text-center">There is no Payment found by now from system..Try again</div>';
   
    }else {
?>
    
             <?php 
  
  	foreach ($mypayment as $row): 



             ?>
			 
 <table  align="center" width="100%" border="1">
 
		<tr>
			<td colspan="2">
			<div style="text-align:center; " >
			
				<?php
				
								$profile = $this->usermodel->populateall('smsconfig','id',$companyid);
		
	
		if(is_array($profile)) 

 {


          
  	foreach ($profile as $c){ 
$photo= $c->logo;
		 	if($photo!=""){
		    
		
		
	
			
		
		$img=$c->logo;
	
		$img1='uploads/';
	$url = base_url().$img1.$img;

 
 ?>

<img class="img-circle"  src="<?php echo $url ?>" height="100" width="100" style="border-radius:4px; ">			 





	 <?php }
		
	} }?>
			
			  
			  <p>
			  <center>
					<b>
					
					
					
					<?php 
										 if( $countbranch>1){
										 $mybranches= $this->usermodel->populateallarray('branch','id',$branchid);
										$branchdescription=$mybranches[0]['description']; if(isset($branchdescription)) {echo   $branchdescription; }


										}else{
									$bussinessname=$configuration[0]['businessname']; if(isset($bussinessname)) {echo   $bussinessname; }
 
											 
										 }
										?>
					
					
					
					
					
					
					
					</b>
				</center>
			  </p>
			
	
				<p style="margin-center;">
				RECEIPT.</p>
			</div></td>
		</tr>
		<tr>
			<td width="40%">RECEIPT NO</td>
			<td width="60%">:<?php echo $row->transactioncode ; ?></td>
		</tr>
		<tr>
			<td>PRINTED DATE </td>
			<td style="padd-left:30px">:<?php $date = date("Y-m-d"); echo $date ?></td>
		</tr>
	
	
		<tr>
			
			<td>PLOT NAME</td>
			<td>:<?php echo $plotnames[0]['name'] ."(".$row->plotno.")"  ; ?></td>
		</tr>
		<tr>
			
			<td>ROOM NO</td>
			<td>:<?php echo $row->houseno ; ?></td>
		</tr>
		
		
		       <?php 
			   $transactioncode=$row->transactioncode;
			   					$allpayment = $this->usermodel->populateall('invoice', 'paymentcode',$transactioncode);

			   	 if(!is_array($allpayment)) 

 {
  
    }else {
  $mygrandtotal=0;
    $mygrandvat=0;

	
  	foreach ($allpayment as $myrow) {
		
	
	$mygrandvat=$mygrandvat+$myrow->vat;
	
						   $chargename = $this->usermodel->populateallarray('charges','id', $myrow->type);
 $chargename=$chargename[0]['type'];
	
	
	?>
	<tr>
	
			<td width="40%"><?php echo$chargename ?></td>
			<td width="60%">:<?php echo($myrow->paid * (1))?></td>
		</tr>
		
	<?php
	}
	?>
		<?php if($mygrandvat>0){ ?>
		<tr>
			<tr>
			
			<td><b>TAX </b></td>
			<td><b>:Ksh.<?php echo $mygrandvat; ?></b></td>
		</tr>	
			
		
	
	
	<?php
		}
	}
	?>
	
	
			
			<td>TOTAL AMOUNT </td>
			<td>:Ksh.<?php echo ((1)*($row->amount)) ; ?></td>
		</tr>
		
		
		       <?php 
			   $mybalanace =0;
			     $myoverpayment =0;
				//$balance= $this->accomodationmodel->getplotreceiptallbybalancerent($plotno,$houseno, $tenantid);
$mybalanace=$balance[0]["totalamount"];
$myoverpayment=$balance[0]["overpayment"];

			   	 if($mybalanace>0)

 {

  	 $mybalanace= $balance[0]["totalamount"];	   
    }else {
 $mybalanace =0;


	}
	
	
			   	 if($myoverpayment>0)

 {
	$myoverpayment=$balance[0]["overpayment"];
    }else {
 	$myoverpayment=0;

	}
	
	
	
	?>
	<tr>
	
			<td width="40%">BALANCE</td>
			<td width="60%">:<?php echo $mybalanace;?></td>
		</tr>
	

		<tr>
	
			<td width="40%">OVERPAYMENT</td>
			<td width="60%">:<?php echo $myoverpayment;?></td>
		</tr>
	
		
			<!--<tr>
			
			<td>TAX  INCLUSIVE</td>
			<td>: A003393830</td>
		</tr>
	-->
			<tr>
			
			<td>PAID BY </td>
						<td>:<?php echo $row->paidby ; ?></td>
		</tr>
		</h2>


             <?php endforeach; ?>

              <?php }?>
			  	</table>
	<div style="text-align: left; text-size:16px ; margin-left:20px; ">
	<h3>
		</br>
Thank you  <br>
You have been served by :<?php echo $firstname ; ?> <br>

Developed by Robisearch LTD (0780655987)<br>
.............*******...............
</h3>
</div>

</div>
		</div>
		
		</div>
		</div>
		</div>	  
	