<div class="container marg_top" >
<div class="row">
<div class="col-md-12  registor">
<style>
table {}
td { padding:3px;}
.hd_e { font-family:"Century Gothic";  font-weight:bold; font-size:14px;}
.sido td { padding:10px; text-align:left; border:1px solid #dddddd;}
#myInput { display:none;}

</style>
<?php
$total_amt = 0;

if($result2):

if($shipdetails): 

?>


<p style="text-align:left; color:#FF0000;"><?php echo $final_report; ?></p>


<div class="col-md-12 ">
<br />
<h4>Thank You,<br /> Your order has been Placed successfully.</h4>
</div>


<div class="col-md-3">


<p>&nbsp;</p>
<table width="100%">
<tr><td colspan="2"  class="hd_e"><u>Shipping Date & Time</u></td></tr>


<tr class="tr_2">
    <td width="40%">Delivery Type</td>
    <td width="60%">: &nbsp;&nbsp;<?php 
	
	if($shipdetails->dtype==1) { echo "Shop Delivery";}
	if($shipdetails->dtype==2) { echo "Door  Delivery";}
	
	?></td>
</tr>


<tr class="tr_2">
    <td width="40%">Delivery Date</td>
    <td width="60%">: &nbsp;&nbsp;<?=$shipdetails->ddate?></td>
</tr>

<tr class="tr_2">
    <td >Delivery Time</td>
    <td >: &nbsp;&nbsp;<?=$shipdetails->dtime?></td>
</tr>


<tr class="tr_2">
    <td>Order Status</td>
    <td>: &nbsp;&nbsp;
     <?php

    switch($shipdetails->status)

	{

		case 'P' : $status =  'Pending' ; break; 

		case 'D' : $status =  'Couriered' ; break; 

		case 'C' : $status =  'Cancelled by you' ; break; 
		
		case 'A' : $status =  'Cancelled by Admin' ; break; 

		case '1' : $status =  'Confirmed' ; break; 

		default : $status =  'Pending' ; 

	}

	echo $status ;

	?>
    </td>
</tr> 


<tr class="tr_2">
    <td>Payment Method</td>
    <td>: &nbsp;&nbsp;<?php if($shipdetails->gifts==1){ echo "Cash On Delivery"; } elseif($shipdetails->gifts==2){  echo "Online Payment";  } else{  echo "Card on Delivery";  }?></td>
</tr> 


<tr class="tr_2">
    <td>Payment Status</td>
    <td>: &nbsp;&nbsp;
    
     <?php if($shipdetails->payment=='' || $shipdetails->payment=='0') {  echo"Not Paid"; } 
  elseif ($shipdetails->payment==1) { echo "Paid, Transaction Complete"; }
  elseif ($shipdetails->payment==3) { echo "Payment Failed"; }
  elseif ($shipdetails->payment==5) { echo "Paid, Transaction Complete"; }
  elseif ($shipdetails->payment==6) { echo "Paid, Transaction Complete"; }
 ?>
    
    </td>
</tr> 



<!--<tr><td colspan="2" style="text-align:left; font-size:16px; font-weight:bold;"><u>Track Details</u></td></tr>

<tr class="tr_2">
    <td colspan="2"><?php echo $shipdetails->track_det=='' ? 'not available' : $shipdetails->track_det ; ?></td>
</tr>-->

</table>

<table width="100%">



<!--<tr><td colspan="2" class="hd_e" ><u>Gift Or Not</u></td></tr>
<tr class="tr_2">
    <td width="40%" tyle="text-align:left; font-size:16px; font-weight:bold;" >Gift  </td>
    <td width="60%">: &nbsp;&nbsp; <?php if($shipdetails->gifts==1){ echo "Gift Odder";} if($shipdetails->gifts==2){ echo "Not Gift";} ?> </td>
</tr>

<tr class="tr_2">
    <td width="30%" tyle="text-align:left; font-size:16px; font-weight:bold;" >Gift Message </td>
    <td width="70%">: &nbsp;&nbsp;<?=$shipdetails->giftmsg?>  </td>
</tr>-->




</table>


</div>


<div class="col-md-3">

<p>&nbsp;</p>
<table>
<tr><td colspan="2" class="hd_e" ><u>Shipping Details</u></td></tr>

<tr class="tr_2">
    <td width="30%">Deliver To</td>
    <td width="70%">: &nbsp;&nbsp;<?=$shipdetails->name?></td>
</tr>

<tr class="tr_2">
    <td>Address</td>
    <td>: &nbsp;&nbsp;<?=$shipdetails->address?></td>
</tr>

<tr class="tr_2">
    <td>Land Mark</td>
    <td>: &nbsp;&nbsp;<?=$shipdetails->city?></td>
</tr>


<tr class="tr_2">
    <td>Postal Area</td>
    <td>: &nbsp;&nbsp;<?=$shipdetails->post?></td>
</tr>


<tr class="tr_2">
    <td>Telephone</td>
    <td>: &nbsp;&nbsp;<?=$shipdetails->tel?></td>
</tr>

<tr class="tr_2">
    <td>Mobile</td>
    <td>: &nbsp;&nbsp;<?=$shipdetails->mobile?></td>
</tr> 


<tr class="tr_2">
    <td>Pincode</td>
    <td>: &nbsp;&nbsp;<?=$shipdetails->pin?></td>
</tr>

</table>
</div>

<!-- show order details -->
<div class="col-md-6">
<table width="100%" border="0" cellpadding="10" cellspacing="10" align="center" class="sido" >

<tr><td colspan="2">Order ID : <b><?=$shipdetails->order_id?></b></td>
<td colspan="2" style="text-align:right;">Date : <b><?=get_datetime($shipdetails->order_date)?></b></td></tr>  

<tr bgcolor="#333333" style="color:#FFF;">
    <td>Product Name</td>
    <td> Quantity</td>
    <td>Unit Price(Rs.)</td>
    <td>Sub Total(Rs.)</td>
</tr>
  
<?php foreach($result2 as $row): ?>

  <tr bgcolor="#FAFAFA">
    <td><?php foreach($product as $prow): 
  if($prow['pid']==$row['prod_id']):
   ?>
  
    <?php endif; endforeach; ?>
   <?=$row['prod_name']?>
    </td>
    <td><?=$row['prod_qty']?></td>
    <td><?=$row['prod_price']?></td>
    <td style="text-align:right;"><?=$row['subtotal']?></td>
  </tr>
    
<?php 

$total_amt+=$row['subtotal'] ;

endforeach; 

?>

  <tr bgcolor="#F5F5F5"  >
    <td colspan="3" align="center">Shipping Charge <!--(<?=get_area_by_id($shipdetails->area)?>)--></td>
    <td style="text-align:right;"><?=$shipdetails->ship_charge?></td>
  </tr>
  
<?php $total_amt+= $shipdetails->ship_charge ; ?>  

<tr bgcolor="#dddddd" style="color:#000000;text-align:center;">
<td colspan="3">Total Amount Payable</td><td  style="text-align:right; font-size:20px; font-weight: bold;">Rs.&nbsp;&nbsp;<?=$total_amt?></td>
</tr> 
        
</table>
</div>


<!-- show shipping details -->




<div class="clr"></div>

<?php if($shipdetails->status=='P') { echo "<h4 style='color:#FF0000;' >Thank you, We will contact you shortly... <a href='https://www.novelkart.com/'> Get Back</a></h4> "; } ?>
<?php if($shipdetails->status=='D') { echo "<h4 style='color:#FF0000;' >Thank you, This Order  Delivered</h4>"; } ?>
<?php if($shipdetails->status=='C') { echo "<h4 style='color:#FF0000;' >Thank you, This Order Cancelled  by you. </h4>"; } ?>
<?php if($shipdetails->status=='1') { echo "<h4 style='color:#FF0000;' >Thank you, This Order Confirmed by Admin.</h4>"; } ?>

<?php endif; ?>
<?php endif; ?>

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