<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
// +----------------------------------------------------------------------+
// | PHP version 4/5                                                      |
// +----------------------------------------------------------------------+
// | This source file is a part of iScripts Multicart                     |
// +----------------------------------------------------------------------+
// | Authors: Programmer<programmer@armia.com>        		              |
// +----------------------------------------------------------------------+
// | Copyrights Armia Systems, Inc and iScripts.com � 2005                |
// | All rights reserved                                                  |
// +----------------------------------------------------------------------+
// | This script may not be distributed, sold, given away for free to     |
// | third party, or used as a part of any internet services such as      |
// | webdesign etc.                                                       |
// +----------------------------------------------------------------------+
?>
<?php
include "../includes/config.php";
include "../includes/session.php";
include "../includes/functions.php";

if (get_magic_quotes_gpc()) {
    $_POST = array_map('stripslashes_deep', $_POST);
    $_GET = array_map('stripslashes_deep', $_GET);
    $_COOKIE = array_map('stripslashes_deep', $_COOKIE);
}

if(isset( $_SESSION["sess_artistid"]) and $_SESSION["sess_artistid"]!= ""){
	$artistid = $_SESSION["sess_artistid"];
}else{
	header("Location:login.php");
	exit;
}
if(isset( $_GET["orderid"]) and $_GET["orderid"]!= ""){
	$orderid = $_GET["orderid"];
}else if(isset( $_POST["orderid"]) and $_POST["orderid"]!= ""){
	$orderid = $_POST["orderid"];
}else{
	header("Location:orders.php");
	exit;
}



$itemlist = $_POST["chkitems"];
$ddlStatus = $_POST["ddlStatus"];

if($_POST["btnGo"]){

	$ar = explode("_",$btn );
	$sid = $ar[1] ;
	$ddl = "ddlStatus_".$sid;
	$status = $_POST[$ddl];
	
	$message = "";
	
	if($message  == "")
	{
		$sql ="UPDATE  ".$tableprefix."order_details SET
		item_status = '".addslashes($ddlStatus)."'
		WHERE 	order_id = '".addslashes($orderid)."' AND artist_id='".addslashes($artistid)."'";
		
		$res = mysql_query($sql);
		$orderstatus_new = getArtistOrderStatus($orderid, $artistid);

		// Send Order Satus Change Mail To Buyer 
		// Update Item Delivery Time
		if($ddlStatus=="4")
		{
		
			   $sql_deliverytime_up	= "UPDATE  ".$tableprefix."order_details SET item_delivery_date =now()
										WHERE order_id = '".addslashes($orderid)."' AND artist_id = '".addslashes($artistid)."' ";
								
				mysql_query($sql_deliverytime_up) or die(mysql_error());
		}
                
		if(isset($_POST['chkStatus']) && $_POST['chkStatus']=='Y')
		{
			// Order Status Change Mail to Buyer 
                    
                    sendOrderStatusChangeMailToBuyer($orderid,$artistid,$orderstatus_new,'S');
		
		}
		
		// End 
		//echo "<br>".$sql;
		$message = MSG_CH_SAVE_SUC;
	}else{
		 $message = VAL_MSG_PLS_CORRECT . $message;
	}

}
if(isset($_GET["msg"]) and $_GET["msg"]!=""){
	$msg = $_GET["msg"];
	switch($msg){
		case "deleted": $message = MSG_USER_DELETED;break;
		default:
			;
	} // switch

}
$currencycode=getSellerCurrencySybol($artistid);
$currencySymbol=getCurrencySybol($currencycode);
/*---------Multicart 2.0 Upgradation---------*/
$hide_shipping_display = 0;
$select_order = "SELECT prd.product_id 
                 FROM ".$tableprefix."products prd,".$tableprefix."orders ord,".$tableprefix."order_details ord_det
                 WHERE ord.order_id = ord_det.order_id
                  AND ord_det.product_id = prd.product_id
                  AND prd.vdigital_product = 'Y'
                  AND ord.order_id = ".$orderid;
				  
$result_order = mysql_query($select_order) or die(mysql_error());

if(mysql_num_rows($result_order) > 0)
{
	$hide_shipping_display = 1;
}		
$sellerCurrency=getSellerCurrencySybol($artistid);
$select_order_gift = "SELECT prd.product_id 
                      FROM ".$tableprefix."products prd,".$tableprefix."orders ord,"
                                    .$tableprefix."order_details ord_det,".$tableprefix."categories cat
                      WHERE ord.order_id = ord_det.order_id
                      AND ord_det.product_id = prd.product_id
                      AND prd.product_category = cat.category_id
                      AND cat.gift_certificate_flag = 'Y'
                      AND ord.order_id = ".$orderid;
				  
$result_order_gift = mysql_query($select_order_gift) or die(mysql_error());

if(mysql_num_rows($result_order_gift) > 0)
{

	$hide_shipping_display = 1;

}						

/*---------Multicart 2.0 Upgradation---------*/
//$qryopt1 .= " AND o.vorder_currency = cm.vcurrency_code ";
$qryopt1 = " ";
      /* $sql=" SELECT o.*, u.user_name, u.email,s.order_status,od.product_discount,od.product_quantity, cm.nexchange_price,vcurrency_name,
		      sum((od.product_price-(od.product_price*product_discount/100)) * od.product_quantity) as total ,sd.nshipping_cost
	         FROM ".$tableprefix."orders o,".$tableprefix."currency_master cm
		INNER JOIN ".$tableprefix."users u ON o.user_id = u.user_id
		INNER JOIN ".$tableprefix."order_status s ON o.order_status = s.order_status_id
		INNER JOIN ".$tableprefix."order_details od ON o.order_id = od.order_id
		INNER JOIN ".$tableprefix."shipping_details sd ON sd.norder_id = od.order_id
		WHERE od.artist_id = '".addslashes($artistid)."' 
		 AND o.vorder_currency = cm.vcurrency_code
		 AND o.order_id = '".addslashes($orderid)."'
		" . $qryopt . "GROUP BY o.order_id ORDER BY o.order_date DESC";*/
     
	 $taxtotal =0;
        
      $sql="SELECT o.*, u.user_name, u.email, od.product_discount,sum( (od.product_price-(od.product_price*product_discount/100)) * od.product_quantity) as total,sum(od.product_tax)as taxtotal
		FROM ".$tableprefix."orders o
		INNER JOIN ".$tableprefix."users u ON o.user_id = u.user_id
		INNER JOIN ".$tableprefix."order_details od ON o.order_id = od.order_id
		WHERE od.artist_id = '".addslashes($artistid)."'
                AND o.order_id = '".addslashes($orderid)."'
		AND o.vpayment_status != 'P'" . $qryopt1 . " GROUP BY o.order_id ORDER BY o.order_date,o.order_id DESC ";



      //exit;
		//echo $sql;
$result = mysql_query($sql);
if(mysql_num_rows($result) != 0){
	$row = mysql_fetch_array($result);
	$ordernumber = $row["order_id"];
	$username = $row["user_name"];
	if($row['vorder_currency']!=$sellerCurrency and $row['vorder_currency']!="USD")
	{
		$get_conversion_price=getCurrencyrate($sellerCurrency);
		$ordertotal = $row["total"];
	}
	else
	{
		
		$ordertotal =$row["total"];

	
	}
	
	$taxtotal = $row["taxtotal"];
	
	//$ordertotal+=$row["taxrate"];
	
	$orderdate = $row["order_date"];
	$orderdate = dateFormat($orderdate,"Y-m-d","m/d/Y");
	$userid = $row["user_id"];
}


$statlist= getStatusList();
//$statlist= array();
//print_r($statlist);

for($i=1;$i<=6;$i++){
	switch ($statlist[$i])
	{
		case 'Pending':$statlist[$i]=TEXT_PENDING;
		break;
		case 'Cancelled' :$statlist[$i]=TEXT_CANCELLED;
		break;
		case 'Shipped':$statlist[$i]=TEXT_SHIPPED;
		break;
		case 'Delivered':$statlist[$i]=TEXT_DELIVERED;
		break;
		case 'Returned to Seller':$statlist[$i]=TEXT_RET_SELLER;
		break;
		case 'Seller Received Back':$statlist[$i]=TEXT_SELLER_RECVD;
		break;
	}
}


$select_shipping_cost = "SELECT sd.vshipping_name, sd.nshipping_cost,sd.nshp_productname
                             FROM ".$tableprefix."shipping_details sd
                             INNER JOIN ".$tableprefix."order_details  od ON (od.product_id=sd.nshp_productid AND od.product_option_id=sd.nproduct_option_id AND od.order_id=sd.norder_id)
                             WHERE sd.norder_id = ".$orderid." AND od.artist_id = '".addslashes($artistid)."' AND  sd.nshp_status = 'C' order by sd.nshp_productname";


/*$select_shipping_cost = "SELECT sd.vshipping_name, sd.nshipping_cost,od.product_name
                           FROM ".$tableprefix."shipping_details sd,".$tableprefix."order_details  od
                          WHERE od.product_id=sd.nshp_productid
                            AND norder_id = ".$orderid."
                            AND nshp_status = 'C'
                            AND od.artist_id = '".addslashes($artistid)."'
                            order by  od.product_name";*/
$result_shipping_cost = mysql_query($select_shipping_cost);
if(mysql_num_rows($result_shipping_cost) > 0)
{
    $totalshippingcost = 0;
    while($shipping_row=mysql_fetch_array($result_shipping_cost))
    {
        $totalshippingcost+=$shipping_row['nshipping_cost'];
    }
}


$ordertotal=$ordertotal+$totalshippingcost+$taxtotal;

include "../includes/htmltop.php";
?>
<SCRIPT>
function confirmDelete(){
	if(confirm("<?php echo QTN_REC_DEL;?>") ){
		return true;
	}
	return false;
}
</SCRIPT>


		<body>
		
		<center>
		
		<div align="left" id="layout">
		
		
				
				
				<!--header area start -->
<?php

	include_once("../includes/topheader_seller.php")

?>
				
				<!--header area end -->
				
				
				
				
				<div align="left" class="main_body">
				<!--main body start -->
				
				
				
<?php
		include_once("../includes/artisttopmenu.php")
?>		
																					
								
					<div align="left" class="content_area">
					
					<!--content area start -->
							
					<div align="left" class="page_title"><?php echo TEXT_VIEW_ORDER;?>(#<?php echo $orderid;?>)</div>
					<div align="center" class="text_information grey_tr"><?php echo $message?></div>
            		<br>
											
					<div align="left">																			
					<div class="mycatalog_fld">
					<form name="frmFeedback" action="<?php echo $_SERVER["PHP_SELF"]?>" method="POST">
					
					<input type="hidden" name="orderid" value="<?php echo htmlentities($orderid);?>">
					<table width="100%" border="0">
						<tr>
					<td colspan="3">
					<fieldset>
					<legend class="page_title2"><?php echo TEXT_ORDER_DTLS;?></legend>
					<table cellpadding="2" cellspacing="2" class="table_spacestyle" width="100%" border="0">
                                        <?php if(checkDigitalOrder($orderid)==true) { ?>
                                         					<tr><td align="left" width="22%" >Order Type &nbsp;</td>
					<td width="2%" >:</td>
                                        <td width="76%" align="left" class="innertextCopy2"><?php echo  TEXT_DPROD_ORDER;?></td></tr>
                                        <?php } ?>
					<tr><td align="left" width="22%" ><?php echo TEXT_ORDER_NO;?>&nbsp;</td>
					<td width="2%" >:</td>
					<td width="76%" align="left" class="innertextCopy2"><?php echo $ordernumber;?></td></tr>
					<tr><td align="left" ><?php echo TEXT_ORDER_DATE;?> &nbsp;</td><td >:</td>
					<td align="left" class="innertextCopy2"><?php echo $orderdate;?></td></tr>
					<tr><td align="left" ><?php echo TEXT_ORDER_TOTAL;?>&nbsp;</td><td >:</td>
					<td align="left" class="innertextCopy2"><?php echo $adminCurrency['currency_symbol'];?><?php echo number_format($ordertotal,2,".","" );?></td>
					</tr>
					<tr><td align="left" valign="top"><?php echo TEXT_ORDER_BY;?>&nbsp;</td><td >:</td>
					<td align="left" class="innertextCopy2"><?php echo $username;?></td></tr>
					<tr><td align="left" ><?php echo TEXT_ORDER_STATUS;?>&nbsp;</td><td >:</td>
					<?php 
					$orderstatus = getArtistOrderStatus($orderid, $artistid);
				
	
	switch ($orderstatus){
	
		case 'Pending':$stat=TEXT_PENDING;
		break;
		case 'Cancelled' :$stat=TEXT_CANCELLED;
		break;
		case 'Shipped':$stat=TEXT_SHIPPED;
		break;
		case 'Delivered':$stat=TEXT_DELIVERED;
		break;
		case 'Returned to Seller':$stat=TEXT_RET_SELLER;
		break;
		case 'Seller Received Back':$stat=TEXT_SELLER_RECVD;
		break;
	}?>
					<td align="left" class="innertextCopy2"><?php echo $stat;?></td></tr>
					</table>
					</fieldset>
					</td>
						</tr>

						<tr>
							<td colspan="3">
								
										<table width="100%"  border="0" cellpadding="0" cellspacing="0" class="manage_table">
											<tr  class="form_header">
												<th width="4%">#</th>
												<th width="15%"><?php echo TEXT_PRODUCT;?><?php echo TEXT_NAME;?></th>
												<th width="18%"><?php echo TEXT_PRODUCT;?><?php echo TEXT_CODE;?></th>
												<th width="13%"><?php echo TEXT_RATE;?></th>
												<th><?php echo TEXT_QUANTITY;?></th>
												<th width="18%"><?php echo TEXT_TOTAL;?><?php echo TEXT_PRICE;?></th>
												<th width="11%"><?php echo TEXT_STATUS;?></th>
											</tr>
											<?php
											$sql=" SELECT od.*,o.vorder_currency,o.taxrate ,s.order_status,gm.ngift_product_id,gm.vgift_coupon_code  FROM ".$tableprefix."order_details od
													INNER JOIN ".$tableprefix."order_status s ON s.order_status_id = od.item_status
													LEFT JOIN ".$tableprefix."orders o ON o.order_id=od.order_id 
													LEFT JOIN ".$tableprefix."giftcertificates gm ON gm.ngift_product_id=od.product_id AND gm.ngift_order_id=od.order_id
													WHERE od.artist_id = '".addslashes($artistid)."' and od.order_id = '".addslashes($orderid)."'
													" . $qryopt . "  ";

											$result1 = mysql_query($sql);
                                                                                        
                                                                                        
											$i=$begin+1;
                                            $price_total = 0;
											
											
											while($rw = mysql_fetch_array($result1))
                                                                                         {
												$check = "<input type='checkbox' class='textbox' name='chkitems[]' value='" . $rw["order_detail_id"] . "' > ";
												
														$rate=$rw["product_price"];
														$shippingcost=$row["nshipping_cost"];
														          
												$qty = $rw["product_quantity"];
												$price = $rate * $qty;
												$discountstr="";
												if($rw["product_discount"] !="0")
                                                                                                {
                                                                                                    $price=$price-($price*$rw["product_discount"]/100);
                                                                                                    $discountstr="<br>discount(".$rw["product_discount"]."%)";
												}
												$rate  = number_format($rate,2,".","" );
												$price = number_format($price,2,".","" );
                                                                                                $price_total +=$price;
                                                                                                
                                                 //Set language file for status
                                                 $ordrst=$rw["order_status"];
                                                                              
                                                 switch ($ordrst){
                                                                              		
                                                       case 'Pending':$st=TEXT_PENDING;
                                                                        	break;
                                                                                                	case 'Cancelled' :$st=TEXT_CANCELLED;
                                                                                                	break;
                                                                                                	case 'Shipped':$st=TEXT_SHIPPED;
                                                                                                	break;
                                                                                                	case 'Delivered':$st=TEXT_DELIVERED;
                                                                                                	break;
                                                                                                	case 'Returned to Seller':$st=TEXT_RET_SELLER;
                                                                                                	break;
                                                                                                	case 'Seller Received Back':$st=TEXT_SELLER_RECVD;
                                                                                                	break;
                                                                                                }
                                                                                                
                                                 
                                                                                                
											?>
											<tr>
												<td valign=top align="left"><?php  echo $i; ?></td>
												<td valign=top align="left"><?php echo ($rw["product_name"]).$discountstr; ?>
																	<br><br><?php if($rw['vgift_coupon_code']!='') {  ?><span class="required"><?php echo TEXT_GIFT_CERT_CODE;?> : <?php echo $rw['vgift_coupon_code'];?></span><?php } ?>

												</td>
												<td valign=top align="left"><?php echo htmlentities($rw["product_code"]); ?></td>
												<td valign=top align="left"><?php echo $adminCurrency['currency_symbol'];?> <?php echo htmlentities($rate); ?></td>
												<td align="left" valign=top><?php echo htmlentities($qty); ?> </td>
												<td valign=top align="left"><?php echo $adminCurrency['currency_symbol'];?> &nbsp; <?php echo htmlentities($price); ?></td>
												<td valign=top align="left"><?php echo $st; ?>&nbsp;</td>
											</tr>
											<?php
                                                                                        $i++;
                                              //htmlentities($rw["order_status"]                                              
											}
                                                                                        
                                                                                        //echo $shipping_total;
											?>
											
											
											
											<tr class="whitebg">
												<td height="37" colspan="5" align="right"><?php echo TEXT_PRODUCT_COST;?> :</td>
											    <td><?php echo $adminCurrency['currency_symbol'];?> &nbsp; <?php echo htmlentities(number_format($price_total,2,".","" ));?></td>
											    <td>&nbsp;</td>
											    <td width="1%">&nbsp;</td>
											</tr>
											
											<?php
                                                                                        if($totalshippingcost !="")
                                                                                        {
                                                                                            //$grand_total= $price+$shippingcost+$totaltax;
                                                                                            $grand_total= $price_total+$totalshippingcost+$taxtotal;

											?>
											

											<tr class="whitebg">
												<td height="37" colspan="5" align="right"><?php echo TEXT_SHIP_COST;?> :</td>
											    <td><?php echo $adminCurrency['currency_symbol'];?> &nbsp; <?php echo htmlentities(number_format($totalshippingcost,2,".","" ));?></td>
											    <td>&nbsp;</td>
											    <td width="1%">&nbsp;</td>
											</tr>
											
											
											<?php
                                                }
											else
											{
                                                                                            //$grand_total=$price;
                                                                                            $grand_total = $price_total +$taxtotal;
											}
											?>
											<tr class="whitebg">
											  <td height="37" colspan="5" align="right"><?php echo TEXT_TAX_RATE;?>: </td>
											  <td><?php echo $currencySymbol;?> <?php echo htmlentities(number_format($taxtotal,2,".","" ));?></td>
											  <td>&nbsp;</td>
											  <td>&nbsp;</td>
										  </tr>
											<tr class="whitebg">
												<td height="37" colspan="5" align="right" class="total_red"><b><?php echo TEXT_ORDER_TOTAL;?>  :</b></td>
											    <td class="total_red"><?php echo $adminCurrency['currency_symbol'];?> &nbsp; <?php echo number_format($grand_total,2,".","" ); ?></td>
											    <td>&nbsp;</td>
											    <td>&nbsp;</td>
											</tr>
											
                                                                                        <?php 
								if($row['vgiftcertificate_code']!='' && $row['nused_gift_amount']!=0 ){
                                                                    
                                                                            if($row['nused_gift_amount']>0)
                                                                            {
                                                                                $total_after_discount   =   $grand_total - $row['nused_gift_amount'];
                                                                            }
									?>
											
											<tr class="total_red">
												<td height="37" colspan="5" align="right"><?php echo GC_AMOUNT_USED;?> : </td>
											    <td><?php echo $adminCurrency['currency_symbol'];?> &nbsp;<?php echo number_format($row['nused_gift_amount'],2,".","" ); ?></td>
											    <td>&nbsp;</td>
											    <td width="1%">&nbsp;</td>
											</tr>
											
											<tr class="total_red">
												<td height="37" colspan="5" align="right"><?php echo TEXT_GIFT_CERT_CODE;?> : </td>
											    <td>&nbsp;<?php echo $row['vgiftcertificate_code']; ?></td>
											    <td>&nbsp;</td>
											    <td width="1%">&nbsp;</td>
											</tr>
                                                                                        
                                                                                        <tr class="whitebg">
												<td height="37" colspan="5" align="right" class="total_red"><b><?php echo ORDER_AMOUNT_AFTER_GC_DISCOUNT;?>  :</b></td>
											    <td class="total_red"><?php echo $adminCurrency['currency_symbol'];?> &nbsp; <?php echo number_format($total_after_discount,2,".","" ); ?></td>
											    <td>&nbsp;</td>
											    <td>&nbsp;</td>
											</tr>
								<?php } ?>			
<?php
										if(isNotNull($check))
										{
											
/*----------Multicart 2.0 Upgradation-----------------------*/								
								
											if($rw["order_status"] != "Cancelled" && getOrderStatus($orderid) != 'Delivered')
											{	
												$data=makeDropDownList("ddlStatus", $statlist, $ddlStatus, false, "textarea2" , $properties, $behaviors);
// 												switch($statlist){
// 													case 'Pending':$st=TEXT_PENDING;
// 													break;
// 													case 'Cancelled' :$st= TEXT_CANCELLED;
// 													break;
// 													case 'Shipped':$st=TEXT_SHIPPED;
// 													break;
// 												}
?>
												<tr align="left" valign="middle" class="whitebg">
												  <td colspan="8" class="btn_gotbl"><?php echo TEXT_CHANGE_ORDER_ST;?>:	<?php echo makeDropDownList("ddlStatus", $statlist, $ddlStatus, false, "textarea2" , $properties, $behaviors)?>&nbsp;&nbsp;&nbsp;
                                                    <input name="chkStatus" type="checkbox" id="chkStatus" value="Y">
Inform Order Staus Change To Buyer 
												  <input type="submit" name="btnGo" value="<?php echo BTN_GO;?>" class="button"  > &nbsp;&nbsp;</td>
										  </tr>
												<tr align="left" valign="middle" class="whitebg">
												  <td colspan="8" class="btn_gotbl">&nbsp;</td>
										  </tr>
<?php
											
												}
												
												
											}
?>
											
										</table>
								
							</td>
						</tr>
                                                
                                                

							
						
<?php

if($hide_shipping_display == 0)
{

?>								
						
						<tr>
							<td colspan="3">
								<fieldset>
									<legend class="page_title2"><?php echo TEXT_SHIP_DTLS;?></legend>
                                                                        
                                                                        
                                                                          <?php								

/*---------Display the shipping cost if available----------*/

 $select_shipping_cost = "SELECT sd.vshipping_name, sd.nshipping_cost,sd.nshp_productname
                             FROM ".$tableprefix."shipping_details sd
                             INNER JOIN ".$tableprefix."order_details  od ON (od.product_id=sd.nshp_productid AND od.product_option_id=sd.nproduct_option_id AND od.order_id=sd.norder_id)
                             WHERE sd.norder_id = ".$orderid." AND od.artist_id = '".addslashes($artistid)."' AND  sd.nshp_status = 'C' order by sd.nshp_productname";

$result_shipping_cost = mysql_query($select_shipping_cost);
?>
	
		
	<div class="border_bgclr">
            <br>
	<table width="100%" border="0" cellpadding="3" cellspacing="3" class="manage_table">
	<tr class="shopcart_heads">
	<td> <b><?php echo PRODUCT_NAME_TEXT1;?></b> </td> <td><b><?php echo SHIP_TYPE_TEXT;?></b> </td><td><b><?php echo SHIPPING_COST_TEXT;?></b></td></tr>
	<?php
	/*---------Display the shipping cost if available----------*/								
if(mysql_num_rows($result_shipping_cost) > 0)
{
	while($shipping_row=mysql_fetch_array($result_shipping_cost))
	{
	    $totalshippingcost+=$shipping_row['nshipping_cost'];		
?>	
<tr><td><?php echo stripslashes($shipping_row['nshp_productname']); ?></td>
<td><?php echo stripslashes($shipping_row['vshipping_name']); ?></td><td><?php echo $currencySymbol;?> <?php echo number_format($shipping_row['nshipping_cost'],2,".","" ); ?></td></tr>
<?php 
    } // end while 
} // end if number of rows
else
{
?>
<tr><td colspan="3" class="text_information"> <?php echo NO_SHIP_DETAILS_TEXT;?></td></tr>
<tr><td colspan="3">&nbsp; </td></tr>
<?php

} // ens else
?>
	</table>
            <br><br>
	</div>                                              

                                                                        
										<table cellpadding="2" class="table_spacestyle" cellspacing="2" width="100%">
												
							<?php if($row["prefered_shippin_method"] !=""){?>

													 <tr><td align="left" width="22%" class=maintext ><?php echo TEXT_SHIP_METHOD;?>&nbsp;</td><td width="2%" >:</td>
													 <td class="maintext" width="76%" align="left" ><b><?php echo htmlentities($row["prefered_shippin_method"]);?></b></td></tr>
													<tr><td align="left" width="22%" ><?php echo TEXT_SHIP_COST;?>&nbsp;</td><td width="2%" >:</td>
													<td width="76%" align="left" class="innertextCopy2"><?php echo $adminCurrency['currency_symbol'];?> <?php echo htmlentities(number_format($totalshippingcost,2,".","" ));?></td></tr>
												<?php } ?>
											<tr><td align="left" width="22%" ><?php echo TEXT_FIRST_NAME;?>&nbsp;</td><td width="2%" >:</td>
											<td width="76%" align="left" class="innertextCopy2"><?php echo ($row["shipping_first_name"]);?></td></tr>
											<tr><td align="left" ><?php echo TEXT_LAST_NAME;?>&nbsp;</td><td >:</td>
											<td align="left" class="innertextCopy2"><?php echo ($row["shipping_last_name"]);?></td></tr>
											<tr><td align="left" ><?php echo TEXT_ADDR1;?>&nbsp;</td><td >:</td>
											<td align="left" class="innertextCopy2"><?php echo ($row["shipping_address1"]);?></td></tr>
											<tr><td align="left" ><?php echo TEXT_ADDR2;?>&nbsp;</td><td >:</td>
											<td align="left" class="innertextCopy2"><?php echo ($row["shipping_address2"]);?></td></tr>
											<tr><td align="left" ><?php echo TEXT_CITY;?>&nbsp;</td><td >:</td>
											<td align="left" class="innertextCopy2"><?php echo ($row["shipping_city"]);?></td></tr>
											<tr><td align="left" ><?php echo TEXT_STATE;?>&nbsp;</td><td >:</td>
											<td align="left" class="innertextCopy2"><?php echo htmlentities($row["shipping_state"]);?></td></tr>
											<tr><td align="left" ><?php echo TEXT_COUNTRY;?>&nbsp;</td><td >:</td>
											<td align="left" class="innertextCopy2"><?php echo htmlentities($row["shipping_country"]);?></td></tr>
											<tr><td align="left" ><?php echo TEXT_ZIP;?>&nbsp;</td><td >:</td>
											<td align="left" class="innertextCopy2"><?php echo htmlentities($row["shipping_zip"]);?></td></tr>
											<tr><td align="left" ><?php echo TEXT_PHONE;?>&nbsp;</td><td >:</td>
											<td align="left" class="innertextCopy2"><?php echo htmlentities($row["shipping_phone"]);?></td></tr>
											<tr><td align="left" ><?php echo TEXT_FAX;?>&nbsp;</td><td >:</td>
											<td align="left" class="innertextCopy2"><?php echo htmlentities($row["shipping_fax"]);?></td></tr>
											<tr><td align="left" ><?php echo TEXT_EMAIL;?>&nbsp;</td><td >:</td>
											<td align="left" class="innertextCopy2"><?php echo htmlentities($row["shipping_email"]);?></td></tr>
											
										</table>
								</fieldset>
							</td>
						</tr>
						
						
<?php

}

?>
                                                
                                                
               <?php if($row['buyer_comments']!='') { ?>


                <tr><td colspan="3">
<br>
                        <div class="border_bgclr">
                            <table cellpadding="2" cellspacing="2" width="100%">

                                <tr><td class="page_title2"> <b><?php echo TEXT_BUYER_COMMENTS;?> </b> </td></tr>
                                
                                    <tr><td> <?php echo stripslashes($row['buyer_comments']) ;?></td></tr>
                            </table>
                        </div>
                    </td></tr>

                <?php  } ?>


						
						<tr>
							<td colspan="3">
								<fieldset>
									<legend class="page_title2"><?php echo TEXT_BILL_DTLS;?></legend>
										<table class="table_spacestyle" cellpadding="2" cellspacing="2" width="100%">
											<tr><td align="left" width="22%" ><?php echo TEXT_FIRST_NAME;?>&nbsp;</td><td width="2%" >:</td>
											<td width="76%" align="left" class="innertextCopy2"><?php echo ($row["billing_first_name"]);?></td></tr>
											<tr><td align="left" ><?php echo TEXT_LAST_NAME;?> &nbsp;</td><td >:</td>
											<td align="left" class="innertextCopy2"><?php echo ($row["billing_last_name"]);?></td></tr>
											<tr><td align="left" ><?php echo TEXT_ADDR1;?>&nbsp;</td><td >:</td>
											<td align="left" class="innertextCopy2"><?php echo ($row["billing_address1"]);?></td></tr>
											<tr><td align="left" ><?php echo TEXT_ADDR2;?>&nbsp;</td><td >:</td>
											<td align="left" class="innertextCopy2"><?php echo ($row["billing_address2"]);?></td></tr>
											<tr><td align="left" ><?php echo TEXT_CITY;?>&nbsp;</td><td >:</td>
											<td align="left" class="innertextCopy2"><?php echo ($row["billing_city"]);?></td></tr>
											<tr><td align="left" ><?php echo TEXT_STATE;?>&nbsp;</td><td >:</td>
											<td align="left" class="innertextCopy2"><?php echo htmlentities($row["billing_state"]);?></td></tr>
											<tr><td align="left" ><?php echo TEXT_COUNTRY;?>&nbsp;</td><td >:</td>
											<td align="left" class="innertextCopy2"><?php echo htmlentities($row["billing_country"]);?></td></tr>
											<tr><td align="left" ><?php echo TEXT_ZIP;?>&nbsp;</td><td >:</td>
											<td align="left" class="innertextCopy2"><?php echo htmlentities($row["billing_zip"]);?></td></tr>
											<tr><td align="left" ><?php echo TEXT_PHONE;?>&nbsp;</td><td >:</td>
											<td align="left" class="innertextCopy2"><?php echo htmlentities($row["billing_phone"]);?></td></tr>
											<tr><td align="left" ><?php echo TEXT_FAX;?>&nbsp;</td><td >:</td>
											<td align="left" class="innertextCopy2"><?php echo htmlentities($row["billing_fax"]);?></td></tr>
											<tr><td align="left" ><?php echo TEXT_EMAIL;?>&nbsp;</td><td >:</td>
											<td align="left" class="innertextCopy2"><?php echo htmlentities($row["billing_email"]);?></td></tr>
											<tr><td colspan="3">&nbsp;</td></tr>
										</table>
								</fieldset>
							</td>
						</tr>
						<tr><td colspan="3" align="center"><input type="button" class="button"  value="<?php echo BTN_BACK_TO_ORDERS;?>" onClick="window.location.href='orders.php'" ></td></tr>
					</table>
					</form>
					<div class="clear"></div>
					</div>
					
					</div>
						
						
				<!--content area end-->
								
				</div>
				
								
					<div align="left" class="clear_float"><img src="<?php echo $imagefolder;?>/clear.gif" alt="" width="1" height="1" /></div>
				<!--main body end -->
				</div>
				
				
<?php
	include "../includes/footer.php";
?>