<? if(!empty($magento_result) && $operation['type']=='profile'){
	foreach($magento_result as $magento_clientdetails) 
	   {?>
		<div class="popover-content">
		   <?  echo "<h5 class='font-bold'>". $magento_clientdetails['magento_url'] ."</h5><br>";  ?>
		   <div class="col-sm-12 line b-b line-lg pull-in"></div>
		   <br>
		   <div class="row m-b-sm">
			  <div class="col-sm-6">
				 <label class="font-bold m-r-sm"><?php echo $vis_language['TXTFIRSTNAME'];?></label>:
				 <label class="m-l-sm">
					<?php echo $magento_clientdetails['userinfo']['firstname']; ?></span>
			  </div>
			  <div class="col-sm-6"><label class="font-bold m-r-sm"><?php echo $vis_language['TXTADDRESS'];?></label><label class="m-l-sm"><?php echo $magento_clientdetails['address']['street']; ?></span></div>
		   </div>
		   <div class="row m-b-sm">
			   <div class="col-sm-6"><label class="font-bold m-r-sm"><?php echo $vis_language['TXTLASTNAME'];?></label>:<label class="m-l-sm"><?php echo $magento_clientdetails['userinfo']['lastname']; ?></span></div>
			   <div class="col-sm-6"><label class="font-bold m-r-sm"><?php echo $vis_language['TXTCITY'];?></label>:<label class="m-l-sm"><?php echo $magento_clientdetails['address']['city']; ?></span></div>
		   </div>
		   <div class="row m-b-sm">
			   <div class="col-sm-6"><label class="font-bold m-r-sm"><?php echo $vis_language['TXTEMAIL'];?></label>:<label class="m-l-sm"><?php echo $magento_clientdetails['userinfo']['email']; ?></span></div>
			   <div class="col-sm-6"><label class="font-bold m-r-sm"><?php echo $vis_language['TXTCOUNTRY'];?></label>:<label class=" m-l-sm"><?php echo $magento_clientdetails['address']['country_id']; ?></span></div>
		   </div>
		   <div class="row m-b-sm">
			   <div class="col-sm-6"><label class="font-bold m-r-sm"><?php echo $vis_language['TXTCONTACTNUMBER'];?></label>:<label class="m-l-sm"><?php echo $magento_clientdetails['address']['telephone']; ?></span></div>
			   <div class="col-sm-6"><label class="font-bold m-r-sm"><?php echo $vis_language['TXTZIPCODE'];?></label>:<label class="m-l-sm"><?php echo $magento_clientdetails['address']['postcode']; ?></span></div>
		   </div>
		</div>
	<? }
}elseif(!empty($final_result) && $operation['type']=='activity'){
	foreach($final_result as $final_details) 
	   {?>
		<div class="popover-content">
		   <?  echo "<h5 class='font-bold'>". $final_details['magento_url'] ."</h5><br>";  ?>
		  
		   <table class="table table-hover b-t b-light m-b-none" data-ride="datatables">
			   <thead class="table_head">
				  <tr>
					 <th class="txt_nowrap"><? echo $vis_language['TXTORDER'];?>#</th>
					 <th class="txt_nowrap"><? echo $vis_language['TXTDATE']; ?></th>
					 <th class="txt_nowrap"><? echo $vis_language['TXTTO'];?></th>
					 <th class="txt_nowrap"><? echo $vis_language['TXTTOTAL']; ?></th>
					 <th class="txt_nowrap"><? echo $vis_language['TXTSTATUS']; ?></th>
				  </tr>
			   </thead>
			   <tbody>
			   <? foreach($final_details['order_list'] as $order_details){
				    echo '<tr><td>'.$order_details['increment_id'].'</td>';
					echo '<td>'.format_datetime(strtotime($order_details['created_at'])).'</td>';
					echo '<td>'.$order_details['shipping_firstname'].' '.$order_details['shipping_lastname'].'</td>';
					echo '<td>'.round($order_details['base_grand_total'], '2').' '.$order_details['order_currency_code'].'</td>';
					echo '<td>'.ucfirst($order_details['status']).'</td></tr>';
					
					
				  }?>    
			   </tbody>
			</table>
		</div>
	<? }
 }elseif(!empty($invoice_result) && $operation['type']=='invoice'){
	
	foreach($invoice_result as $invoice_details) 
	   {?>
		<div class="popover-content">
		   <?  echo "<h5 class='font-bold'>". $invoice_details['magento_url'] ."</h5><br>";  ?>
		  
		   <table class="table table-hover b-t b-light m-b-none" data-ride="datatables">
			   <thead class="table_head">
				  <tr>
					 <th class="txt_nowrap"><? echo $vis_language['TXTINVOICE'];?>#</th>
					 <th class="txt_nowrap"><? echo $vis_language['TXTINVOICEDATE']; ?></th>
					 <th class="txt_nowrap"><? echo $vis_language['TXTORDER'];?>#</th>
					 <th class="txt_nowrap"><? echo $vis_language['TXTORDERDATE']; ?></th>
					 <th class="txt_nowrap"><? echo $vis_language['TXTBILLTONAME']; ?></th>
					 <th class="txt_nowrap"><? echo $vis_language['TXTTOTAL']; ?></th>
				  </tr>
			   </thead>
			   <tbody>
			   <? foreach($invoice_details['invoice'] as $invoice_order_details){
				    echo '<tr><td>'.$invoice_order_details['invoice_details']['increment_id'].'</td>';
					echo '<td>'.format_datetime(strtotime($invoice_order_details['invoice_details']['created_at'])).'</td>';
					echo '<td>'.$invoice_order_details['order_details']['increment_id'].'</td>';
					echo '<td>'.format_datetime(strtotime($invoice_order_details['order_details']['created_at'])).'</td>';
					echo '<td>'.$invoice_order_details['order_details']['billing_name'].'</td>';
					echo '<td>'.round($invoice_order_details['invoice_details']['grand_total'], '2').' '.$invoice_order_details['invoice_details']['order_currency_code'].'</td></tr>';
					
					
				  }?>    
			   </tbody>
			</table>
		</div>
	<? }
 }else include(VIS_PATH_TEMPLATE.'no_record_yet.php');?>
