<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"><?php echo $content_top; ?>
  <?php if ($error_warning) { ?>
  <div class="warning"><?php echo $error_warning; ?></div>
  <?php } ?>
  <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="edit">
    <h3 style="position:relative;left:-185px;">EARNINGS & PAYMENTS</h3>
	<hr style="margin-left:-190px;">
	  <div id="tabs" class="htabs">
			<!-- <a href="#tab-summary">SUMMARY</a> -->
			<a href="#tab-credits">EARNINGS</a>
			<a href="#tab-coupons">PAYMENTS</a>
	  </div>
	 
	  
  <!--   <div class="content" id="tab-summary">

    </div> --->
	<br>
	<div class="content" id="tab-credits">	

   <div style="	border:1px solid #EDEDED;height: 30px;border-radius:3px;box-shadow: -2px 8px 11px -8px grey;margin-bottom: 5px;width:90px;float:left;">
		<span style="position: relative; top: 8px;left:30px;">Date</span>
   </div>
   <div style="	border:1px solid #EDEDED;height: 30px;border-radius:3px;box-shadow: -2px 8px 11px -8px grey;margin-bottom: 5px;width:90px;float:left;">
		<span style="position: relative; top: 8px; left:24px;">Order Id</span>
   </div>
   <div style="border:1px solid #EDEDED;height: 30px;border-radius:3px;box-shadow: -2px 8px 11px -8px grey;margin-bottom: 5px;width:195px;float:left;">
		<span style="position: relative; top: 8px;left:25px;">Description</span> 
   </div>
   <div style="border:1px solid #EDEDED;height: 30px;border-radius:3px;box-shadow: -2px 8px 11px -8px grey;margin-bottom: 5px;width:150px;float:left;">
		<span style="position: relative; top: 8px;left:28px;">Customer Name</span>
   </div>
   <div style="border:1px solid #EDEDED;height: 30px;border-radius:3px;box-shadow: -2px 8px 11px -8px grey;margin-bottom: 5px;width:125px;float:left;">
		<span style="position: relative; top: 8px;left:33px;">Sale Value</span>
   </div>
   <div style="border:1px solid #EDEDED;height: 30px;border-radius:3px;box-shadow: -2px 8px 11px -8px grey;margin-bottom: 5px;width:100px;float:left;">
		<span style="position: relative; top: 8px;left:46px;">Credit</span> 
   </div>
      <?php if ($credits) { ?>
            <?php foreach ($credits as $credit) { ?>
   <div style=" height: 30px; margin-bottom: 5px;width:90px;float:left;">
		<span style="position: relative; top: 8px;left:16px;"><?php echo $credit['date_added']; ?></span>
   </div>
   <div style="	 height: 30px; margin-bottom: 5px;width:90px;float:left;">
		<span style="position: relative; top: 8px; left:36px;">#<?php echo $credit['order_id']; ?></span>
   </div>
   <div style=" height: 30px; margin-bottom: 5px;width:195px;float:left;">
		<span style="position: relative; top: 8px;left:25px;"><?php echo $credit['pname']; ?>
		<?php if(isset($credit['optionname'])) { ?>
		<?php echo $credit['optionname']; ?>
		<?php } ?>
		</span>
   </div>
   <div style=" height: 30px; margin-bottom: 5px;width:150px;float:left;">
		<span style="position: relative; top: 8px;left:37px;"><?php echo $credit['cname']; ?></span>
   </div>
   <div style=" height: 30px; margin-bottom: 5px;width:125px;float:left;">
		<span style="position: relative; top: 8px;left:33px;"><?php echo sprintf('%0.2f', $credit['sale_amount']).' '.$credit['currency']; ?></span>
   </div>
   <div style=" height: 30px; margin-bottom: 5px;width:100px;float:left;">
		<span style="position: relative; top: 8px;left:46px;"><?php echo $credit['reward_amount']; ?></span>
   </div>
	 <?php } ?>
            <?php } ?>
			
	</div>
	<div class="content" id="tab-coupons">	
	
   <div style="border:1px solid #EDEDED;height: 30px;border-radius:3px;box-shadow: -2px 8px 11px -8px grey;margin-bottom: 5px;width:150px;float:left;">
		<span style="position: relative; top: 8px;left:56px;">Date</span>
   </div>
   <div style="border:1px solid #EDEDED;height: 30px;border-radius:3px;box-shadow: -2px 8px 11px -8px grey;margin-bottom: 5px;width:330px;float:left;">
		<span style="position: relative; top: 8px; left:35px;">Description</span>
   </div> 
   <div style="border:1px solid #EDEDED;height: 30px;border-radius:3px;box-shadow: -2px 8px 11px -8px grey;margin-bottom: 5px;width:150px;float:left;">
		<span style="position: relative; top: 8px;left:46px;">Amount</span>
   </div>
    <?php if ($credits) { ?>
            <?php foreach ($credits as $credit) { ?>
			<?php if ( trim($credit['payment_details']) != '' && $credit['payment_details'] != ' ') { ?>
   <div style=" height: 30px; margin-bottom: 5px;width:150px;float:left;">
		<span style="position: relative; top: 8px;left:41px;"><?php echo $credit['payment_date']; ?></span>
   </div>
   <div style=" height: 30px; margin-bottom: 5px;width:330px;float:left;">
		<span style="position: relative; top: 8px; left:35px;"><?php echo $credit['payment_details']; ?></span>
   </div> 
   <div style=" height: 30px; margin-bottom: 5px;width:150px;float:left;">
		<span style="position: relative; top: 8px;left:46px;"><?php echo $credit['reward_amount']; ?></span>
   </div>
    <?php } ?>
    <?php } ?>
            <?php } ?>

	</div>
	
  </form>
  <?php echo $content_bottom; ?></div>
<?php echo $footer; ?>
<script type="text/javascript"><!--
$('#tabs a').tabs();
//--></script> 