Edit file File name : mithaas-printInvoice.php Content :<?php session_start(); include("../include/config.php"); include("../include/functions.php"); validate_admin(); $objmithaas = new DB($db_namemithaas, $hostmithaas, $usernamemithaas, $passwordmithaas); if($_REQUEST['order_id']!=''){ $sql=$objmithaas->query("select * from $tbl_order where id=".$_REQUEST['order_id']); $result=$objmithaas->fetchNextObject($sql); $prosub=array(); if($result->sub_id){ $subArr=explode(",",$result->sub_id); if(count($subArr)>0){ foreach($subArr as $value){ $sqlsubs=$objmithaas->query("SELECT b.product_id,b.subscription_type FROM user_subscription as a left join user_subscription_order_details as b on a.sub_id=b.subs_id WHERE a.userid='" . $result->user_id . "' and a.sub_id=$value"); $Subresult = $objmithaas->fetchNextObject($sqlsubs); $prosub[$Subresult->product_id]=$Subresult->subscription_type; } } } } ?> <!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"> 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['id'];?>" /> <table width="100%" cellpadding="0" cellspacing="0"> <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->order_date); if($added_date[0]!='0000'){ echo date("d M Y H:i",strtotime($result->order_date)); }?></td> <td width="14%"><strong>Order ID:</strong></td> <td width="34%"><?php echo stripslashes($result->id); ?></td> </tr> <tr> <td width="18%"><strong>User ID:</strong></td> <td width="34%"><?php echo stripslashes($result->user_id);?></td> <td width="14%"><strong>Email:</strong></td> <td width="34%"><?php echo stripslashes($result->ship_email);?></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->ship_fname);?></td> <td width="14%"><strong> Last Name:</strong></td> <td width="34%"><?php echo stripslashes($result->ship_lname);?></td> </tr> <tr> <td width="18%"><strong> House Number:</strong></td> <td width="34%"><?php echo stripslashes($result->ship_house_no);?></td> <td width="14%"><strong> Street:</strong></td> <td width="34%"><?php echo stripslashes($result->ship_street);?></td> </tr> <tr> <td width="18%"><strong> Complex:</strong></td> <td width="34%"><?php echo stripslashes($result->ship_complex);?></td> <td width="14%"><strong> Landmark:</strong></td> <td width="34%"><?php echo stripslashes($result->ship_landmark);?></td> </tr> <tr> <td width="18%"><strong> City:</strong></td> <td width="34%"><?php echo getField('city',$tbl_city,$result->ship_city_id);?></td> <td width="14%"><strong> Area:</strong></td> <td width="34%"><?php echo $result->area;?></td> </tr> <tr> <td width="18%"><strong> Pincode:</strong></td> <td width="34%"><?php echo stripslashes($result->ship_pincode);?></td> <td width="14%"><strong> </strong></td> <td width="34%"> </td> </tr> <tr> <td width="18%"><strong> Mobile:</strong></td> <td width="34%"><?php echo stripslashes($result->ship_mobile);?></td> <td width="18%"><strong> Phone:</strong></td> <td width="34%"><?php echo stripslashes($result->ship_phone);?></td> </tr> </table> </td> </tr> <tr> <td class="paddBot11 paddRt14" colspan="2"> </td> </tr> <?php if($result->coupon_code!=''){ ?> <tr> <td class="paddBot11 paddRt14" colspan="2"><h2>Discount 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>Coupoun Code Used:</strong></td> <td width="34%"><?php echo stripslashes($result->coupon_code);?></td> <td width="14%"> </td> <td width="34%"> </td> </tr> </table> </td> </tr> <?php } ?> <tr> <td class="paddBot11 paddRt14" colspan="2"><h2>Payment 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>Payment Method:</strong></td> <td width="34%"><?php echo stripslashes($result->payment_method);?></td> <td width="14%"> </td> <td width="34%"> </td> </tr> <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->delivery_note;?></td> <td width="34%"> </td> <td width="14%"> </td> <td width="34%"> </td> </tr> </table> </td> </tr> <tr> <td class="paddBot11 paddRt14" colspan="2"> </td> </tr> <tr> <td class="paddBot11 paddRt14" colspan="2"><h2>Ordered Products</h2></td> </tr> <tr><td colspan="2"> <?php $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>"; $itmesArr=$objmithaas->query("select * from $tbl_order_itmes where order_id='".$result->id."'"); while($resultItem=$objmithaas->fetchNextObject($itmesArr)){ $custumdate='2021-07-08 00:00:00'; $substype=''; if($result->order_date > $custumdate){ if($resultItem->subscription_type=='Weekly' || $resultItem->subscription_type=='Bi Weekly' || $resultItem->subscription_type=='Monthly'){ $substype=" ($resultItem->subscription_type Subscription)"; } } else { $substype=$prosub[$resultItem->product_id]; if($substype=='Weekly' || $substype=='Bi Weekly' || $substype=='Monthly'){ $substype=" ($substype Subscription)"; } } $enq_message.="<tr> <td><strong>".$resultItem->product_name.' '.$resultItem->size.$resultItem->size_type.$substype."</strong></td> <td>".$resultItem->user_replacement_option."</td> <td>".$resultItem->qty."</td> <td>".number_format($resultItem->price,2)."</td> <td>$website_currency_symbol ".number_format($resultItem->price*$resultItem->qty,2)."</td> </tr>"; } $enq_message.=" <tr> <td> </td> <td> </td> <td>Billed Amount</td> <td>$website_currency_symbol ".number_format($result->amount,2)."</td> </tr> <tr> <td> </td> <td> </td> <td>Tax</td> <td>$website_currency_symbol ".number_format($result->tax_value,2)."</td> </tr> <tr> <tr>"; if($result->special_discount!=''){ $enq_message.="<tr> <td> </td> <td> </td> <td>Special Discount</td> <td>$website_currency_symbol ".number_format($result->special_discount,2)."</td> </tr>"; } if($result->other_discount>0){ $enq_message.="<tr> <td> </td> <td> </td> <td>".$result->other_discount_via." Discount</td> <td>$website_currency_symbol".number_format($result->other_discount,2)."</td> </tr>"; } $enq_message.=" <td> </td> <td> </td> <td>Discounts</td> <td>$website_currency_symbol ".number_format($result->discount,2)."</td> </tr>"; if($result->expres_amt>0){ $enq_message.="<tr> <td> </td> <td> </td> <td>Express Delivery</td> <td>$website_currency_symbol ".number_format($result->expres_amt,2)."</td> </tr>"; }else{ $enq_message.="<tr> <td> </td> <td> </td> <td>Delivery Charges</td> <td>$website_currency_symbol ".number_format($result->shipping_amount,2)."</td> </tr>"; } $enq_message.="<tr> <td> </td> <td> </td> <td>Minimum Order Charge</td> <td>$website_currency_symbol ".number_format($result->min_order_charge,2)."</td> </tr>"; $enq_message.="<tr> <td> </td> <td> </td> <td>Tip</td> <td>$website_currency_symbol ".number_format($result->drivertip,2)."</td> </tr>"; if($result->saving>0){ $enq_message.="<tr> <td> </td> <td> </td> <td>Saving</td> <td>$website_currency_symbol ".number_format($result->saving,2)."</td> </tr>"; } $enq_message.=" <tr> <td> </td> <td> </td> <td><strong>Total Amount:</strong></td> <td>$website_currency_symbol ".number_format($result->total_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> </table> </form> </td> </tr> <tr><td align="center"> </td></tr> </table> </body> </html> <script> var is_chrome = function () { return Boolean(window.chrome); } if(is_chrome) { window.print(); setTimeout(function(){window.close();}, 20000); //give them 10 seconds to print, then close } else { window.print(); window.close(); } </script> Save