<?php

////////////////////// FUNCTION | MODULE FUNCTION (c) i2d Technologies //////////////////////////////////

if (!function_exists('view_record_order')) {
	function view_record_order($id,$settings){
if (array_key_exists('table', $settings)) {
   $table=$settings['table'];
   }
   if (array_key_exists('id_col', $settings)) {
   $id_col=$settings['id_col'];
   }
   if (array_key_exists('ref', $settings)) {
   $ref=$settings['ref'];
   }
   if (array_key_exists('no_rows', $settings)) {
   $rows=$settings['no_rows'];
   }
   
$array_cols1=array(id_col,order_dated,order_fname,order_company,order_address,order_payment_method,order_city
,order_postal,order_province,order_country,order_cell,order_email,order_zip,order_total,order_ref,order_full_name);

$tdsettings2=array(
	'table'=>order_table,
	'id_col'=>id_col,
	'ref_value'=>'order_entry',
	'where_col'=>id_col,
	'fields_array'=>$array_cols1,
	'where_value'=>$id,
	'echo'=>'0',
	'status_vaue'=>'Active',
	'type'=>'cart_fetch');

$count1=db_fetch($tdsettings2);

   
	?>
   <!-- PAGE FUNCTION STARTS (c) i2d Technologies Website Engine -->
   <div id="page-right-content" style="padding-top:40px !IMPORTANT;">

                    <div class="container">
                        <div class="row">
							<div class="col-sm-12">
								<div id="start">
									<div class="row">
				
	
							

	
	
	
	
								<div class="tab-content">
                                <div class="tab-pane active" id="home-b1">
                                    <div class="row">
                                        <div class="col-md-12">
                                            <!-- Personal-Information -->
                                            <div class="panel panel-default panel-fill">
                                                <div class="panel-heading">
                                                    <h3 class="panel-title">Order Information</h3>
                                                </div>
                                                <div class="panel-body">
                                                    
				
	
		

													<div class="m-b-20">
                                                        <?php 
														
if($count1){
foreach($count1 as $count_item1){

	echo "<h4>Order Tracking / Ref"." : ".$count_item1[order_ref]."</h4><br />";
	echo "<strong>Order Date</strong>"." : ".$count_item1[order_dated]."<br />";
	echo "<strong>Customer Name</strong>"." : ".$count_item1[order_full_name]."<br />";
	echo "<strong>Company / Organization</strong>"." : ".$count_item1[order_company]."<br />";
	echo "<strong>Shipping Address</strong>"." : ".$count_item1[order_address]."<br />";
	echo "<strong>Cell / Phone</strong>"." : ".$count_item1[order_cell]."<br />";
	echo "<strong>Email</strong>"." : ".$count_item1[order_email]."<br />";
	echo "<strong>City</strong>"." : ".$count_item1[order_city]."<br />";
	echo "<strong>Zip Code</strong>"." : ".$count_item1[order_zip]."<br />";
	echo "<strong>Province</strong>"." : ".$count_item1[order_province]."<br />";
	echo "<strong>Country</strong>"." : ".$count_item1[order_country]."<br />";
	echo "<h4>Order Amount"." : ".$count_item1[order_total]."</h4><br />";
	echo "<strong>Payment Method</strong>"." : ".$count_item1[order_payment_method]."<br />";
	
}
}

		
	

														
														?>
                                                        </div>

													

 <div class="panel-heading">
                                                    <h5 class="header-title">Order Items</h5>
                                                </div>
                                               

													<div class="m-b-20">

<?php 
$token=db_ref(order_table,id_col,$id,order_ref);

$array_cols=array(id_col,order_product_token,order_product_sku,order_product_title,order_product_price,order_product_photo,order_product_qty,order_product_status);

$tdsettings2=array(
	'table'=>order_table,
	'id_col'=>id_col,
	'ref_value'=>'order_product_entry',
	'where_col'=>order_product_token,
	'fields_array'=>$array_cols,
	'where_value'=>$token,
	'echo'=>'0',
	'status_vaue'=>'Active',
	'type'=>'cart_fetch');

$count=db_fetch($tdsettings2);

if($count){
foreach($count as $count_item){

$title=$count_item[order_product_title];
$img=$count_item[order_product_photo];
$qty=$count_item[order_product_qty];
$price=$count_item[order_product_price];
$sku=$count_item[order_product_sku];
?>

<strong>Item : </strong><?php echo $title; ?><br />
<strong>Price :</strong><?php echo $price; ?><br />
<strong>Qty : </strong><?php echo $qty; ?><br /><br /><br />
<strong>SKU : </strong>BB-<?php echo $sku; ?><br /><br /><br />
<img src="<?php echo MAIN_SITE_PATH; ?>images/campaigns/og/<?php echo $img; ?>" class="responsive" style="max-width:20%"/><br /><br /><br />	
<?php
}
}

?>




</div>													
														
	
                                                    
                                                </div>
                                            </div>
                                            <!-- Personal-Information -->

                                            <!-- Social -->
                                            
                                            <!-- Social -->
                                        </div>



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

	

								</div>
								</div>
								<div class="text-center">
	  <button type="button" class="btn btn-danger m-t-10" onclick="history.go(-1);">Close View</button>
      <p>&nbsp;</p>
	  
   </div>
								
								
								
								</div>
								</div>
								</div>
							
 <!-- PAGE FUNCTION ENDS (c) i2d Technologies Website Engine -->   
<?php   
}
}
//////////////////////////// HTML FUNCTION ENDS (c) i2d Technologies ///////////////////////////////////////



















?>