<?php 
$query="SELECT  id,money_receipt_no,paid,trans_date,b.debtor_no,b.debtor_ref,b.name,b.address FROM ".$prefix2."order_payment AS a,".$prefix."debtors_master AS b WHERE a.debtor_no=b.debtor_no";
$resultType=mysqli_query($linkid,$query);
?>
<script type="text/javascript">
/*------------------------------------Delete Student---------------------------------------------*/
 function delMR(id)
	{
	   var row=confirm("Confirm Delete ?");
	   if(row==true)
	   {
		 deleteLoc(id);	 
	   }
	   else 
	   return false;
	 }
	 
	function deleteLoc(id)
	{
	  var param="id="+id;
	  //alert(param);
	  $.ajax({
		type: "POST",
		url: "modules/production-print/delmoney.php",
		data:param,
		cache: false,
		success: function(html)
		{
		//alert(html);
		if(html=='OK')
		$(".bar"+id).slideUp('slow', function() {$(this).remove();});
		//else
		//alert("This is relational ID.Can't delete!");
		}
		});
	 }

</script>
<div id="contentwrapper">
  <div class="main_content">
    <nav>
      <div id="jCrumbs" class="breadCrumb module">
        <ul>
          <li> <a href="#"><i class="icon-home"></i></a> </li>
          <li> <a href="#">Money Receipts Datagrid</a> </li>
        </ul>
      </div>
    </nav>
    <div class="row-fluid">
      <div class="span12">
        <h3 class="heading">Money Receipts</h3>
        <table class="table table-striped table-bordered dTableR" id="dt_a">
          <thead>
            <tr>
              <th> MR No.</th>
			  <th> Date</th>
              <th> Name </th>
			  <th> Phone </th>
			  <th> Amount </th>
			  <th> Action </th>
            </tr>
          </thead>
          <tbody>
            <?php 

			  if($resultType)

				{

				while($mydata = mysqli_fetch_assoc($resultType))

				{

				$dateval=explode("-",$mydata['trans_date']);

			    $monthval=date("d M-Y",mktime(0,0,0,$dateval[1],$dateval[2],$dateval[0]));

				

			  ?>
            <tr class="bar<?php echo $mydata['id']?>" >
              <td><?php echo $mydata['money_receipt_no']?></td>
			  <td><?php echo $mydata['trans_date']?></td>
              <td><?php echo $mydata['name']?></td>
			  <td><?php echo $mydata['debtor_ref']?></td>
              <td><?php echo $mydata['paid']?></td>
              <td><table width="80%" border="0">
                  <tr>
                    <td><a href="money-receipt-payment.php?mid=<?php echo $mydata['money_receipt_no']?>" target="_blank" title="Print"><i class="icon-print"></i></a></td>
					<!--<?php
					if($name=='Administrator')
					{
					?><td><a href="javascript:void(0);" onclick="delMR('<?php echo $mydata['id']?>')" title="Delete"><i class="icon-trash"></i></a></td>
					<?php
					}
					?>-->
                  </tr>
                </table></td>
            </tr>
            <?php 

				 }

				 } 

?>
          </tbody>
        </table>
      </div>
    </div>
  </div>
</div>
