Preview: insta-vieworder-detail.php
Size: 9.70 KB
/home/godevadmin/public_html/admin/insta-vieworder-detail.php
<?php
session_start();
include("../include/config.php");
include("../include/functions.php");
include("../include/simpleimage.php");
require_once("../include/insta.class.php");
validate_admin();
$instaObj = new Instacart($obj);
if($_REQUEST['order_id']!=''){
$orderId = $_REQUEST['order_id'];
$condS = '';
if(!empty($_REQUEST['sid'])) {
$sid = $_REQUEST['sid'];
$condS = " AND storeid='$sid' ";
}
$where = " and order_id='$orderId' $condS";
$result= $instaObj->getAllorders($where,'','','','','SUBCAT');
//echo "<pre>";print_r($result);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo SITE_TITLE; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="middle" class="headingbg bodr text14"><em><img src="images/arrow2.gif" width="21" height="21" hspace="10" align="absmiddle" /></em>Admin: order Details </td>
</tr>
<tr>
<td height="100" align="left" valign="top" bgcolor="#f7faf9" class="bodr"><form name="frm" method="POST" enctype="multipart/form-data" action="" onSubmit="return validate(this)">
<input type="hidden" name="submitForm" value="yes" />
<input type="hidden" name="id" value="<?php echo $_REQUEST['order_id'];?>" />
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="paddBot11 paddRt14" colspan="2"><h2>Order Details</h2></td>
</tr>
<tr>
<td class="paddBot11 paddRt14" colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="18%"><strong>Order Date:</strong></td>
<td width="34%"><?php $added_date=explode("-",$result[0]['order_date']); if($added_date[0]!='0000'){ echo date("d M Y H:i",strtotime($result[0]['order_date'])); }?></td>
<td width="14%"><strong>Order ID:</strong></td>
<td width="34%"><?php echo stripslashes($result[0]['order_id']); ?></td>
</tr>
<tr>
<td width="18%"><strong>User ID:</strong></td>
<td width="34%"><?php echo stripslashes($result[0]['user_id']);?></td>
<td width="14%"></td>
<td width="34%"></td>
</tr>
</table></td>
</tr>
<tr>
<td class="paddBot11 paddRt14" colspan="2"><h2>Delivery Information</h2></td>
</tr>
<tr>
<td class="paddBot11 paddRt14" colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="18%"><strong> First Name:</strong></td>
<td width="34%"><?php echo stripslashes($result[0]['customer_fname']);?></td>
<td width="14%"><strong> Last Name:</strong></td>
<td width="34%"><?php echo stripslashes($result[0]['customer_lname']);?></td>
</tr>
<tr>
<td width="18%"><strong> House Number:</strong></td>
<td width="34%"><?php echo stripslashes($result[0]['delivery_street_1']);?></td>
<td width="14%"></td>
<td width="34%"></td>
</tr>
<tr>
<td width="18%"><strong> Complex:</strong></td>
<td width="34%"></td>
<td width="14%"><?php echo stripslashes($result[0]['delivery_street_2']);?></td>
<td width="34%"></td>
</tr>
<tr>
<td width="18%"><strong> City:</strong></td>
<td width="34%"><?php echo stripslashes($result[0]['delivery_city']);?></td>
<td width="14%"></td>
<td width="34%"></td>
</tr>
<tr>
<td width="18%"><strong> Pincode:</strong></td>
<td width="34%"><?php echo stripslashes($result[0]['ship_pincode']);?></td>
<td width="14%"><strong> </strong></td>
<td width="34%"> </td>
</tr>
</table></td>
</tr>
<td class="paddBot11 paddRt14" colspan="2"><h2>Delivery Notes (if any)</h2></td>
</tr>
<tr>
<td class="paddBot11 paddRt14" colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="18%"><?php echo $result[0]['remarks'];?></td>
<td width="34%"> </td>
<td width="14%"> </td>
<td width="34%"> </td>
</tr>
</table></td>
</tr>
<tr>
<td class="paddBot11 paddRt14" colspan="2"><h2>Ordered Products</h2></td>
</tr>
<tr>
<td colspan="2"><?php
$enq_message = '';
$enq_message.="<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='100%'><table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr style='background:#e7f6f1;' >
<td width='40%' height='30'><h3>Product Purchased</h3></td>
<td width='15%' height='15'><!--<h3>User Remarks</h3>--></td>
<td width='10%'><h3>Qty</h3></td>
<td width='22%'><h3>Unit Price($website_currency_symbol)</h3></td>
<td width='23%'><h3>Price ($website_currency_symbol)</h3></td>
</tr>
<tr>
<td><strong> </strong></td> <td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>";
$billed_amount = 0;
$tax_amount = 0;
$discount_amount = 0;
$total_amount = 0;
foreach ($result as $resultItem) {
$product_name = $resultItem["product_name"];
$size_type = $resultItem["size"];
$qty = $resultItem["qty"];
$instacart_online_price = $resultItem["instacart_online_price"];
$GMV = $resultItem["GMV"];
$tax_value = $resultItem["tax_value"];
$discountAmt = $resultItem["discount"];
$billed_amount = $billed_amount + ($resultItem["instacart_online_revenue"] *$qty);
$tax_amount = $tax_amount + $tax_value;
$discount_amount = $discount_amount + $discountAmt;
$total_amount = $total_amount + $GMV;
$subCatName = getMainCategory($resultItem["sub_category"]);
if($subCatName !=$prevSubCat) {
$enq_message.="<tr style='background:#76c5b8;'>
<td><strong style='color:#FFFFFF'>".$subCatName." "."</strong></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>";
$prevSubCat = $subCatName;
}
$enq_message.="<tr>
<td><strong >".$product_name." ".$size." ".$size_type." "."</strong></td>
<td></td>
<td>".$qty."</td>
<td>".number_format($instacart_online_price,2)."</td>
<td>$website_currency_symbol ".number_format($instacart_online_price*$qty,2)."</td>
</tr>";
}
$enq_message.=" <tr>
<td> </td>
<td> </td>
<td>Billed Amount</td>
<td>$website_currency_symbol ".number_format($billed_amount,2)."</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td>Tax</td>
<td>$website_currency_symbol ".number_format($tax_amount,2)."</td>
</tr>
<tr>";
if($result->special_discount!=''){
$enq_message.="<tr>
<td> </td>
<td> </td>
<td>Special Discount</td>
<td>$website_currency_symbol ".number_format($discount_amount,2)."</td>
</tr>";
}
$enq_message.="
<tr>
<td> </td>
<td> </td>
<td><strong>Total Amount:</strong></td>
<td>$website_currency_symbol ".number_format($billed_amount,2)."</td>
</tr>
</table></td>
</tr>
</table>";
echo $enq_message;?>
</td>
</tr>
<tr>
<td width="43%" align="right" class="paddRt14 paddBot11"> </td>
<td width="57%" align="left" class="paddBot11"></td>
</tr>
<tr>
<td colspan="4" class="paddRt14 paddBot11"><strong>Forgot to order something?</strong><br>
To add items to an undelivered order, please start a new order and select ‘Pick up from Stores’ at checkout. You will not be charged any delivery fee or minimum store order fee. Once you receive the order confirmation email, please reply to that email informing our operations staff to combine this and your previous order by providing both Order IDs.<br></td>
</tr>
<tr>
<td colspan="4" class="paddRt14 paddBot11"><strong>Cancellation/Returns/Refund/Replacement Policy -</strong><br>
1) Any order cancelled after 2 hours of placing the order will be levied a 50% cancellation charge. <br>
2) No order can be cancelled after 1 PM on delivery day.<br>
3) Any items missing or not delivered in good condition need to be notified to MyValue365 within 3 hours of receiving the delivery. No item will be replaced, refunded or returned after that.<br></td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td align="center"></td>
</tr>
</table>
</body>
</html>
Directory Contents
Dirs: 10 × Files: 414