<?php
/*
  $Id: order_check_packingslip.php, v 2.0 20/08/2006 Gnidhal Exp $
  Part of contribution OrdersCheck. 
  This script is not included in the original version of osCommerce

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

require('includes/application_top.php');

require(DIR_WS_CLASSES . 'currencies.php');
$currencies = new currencies();

$ocID = tep_db_prepare_input($HTTP_GET_VARS['ocID']);
$orders_query = tep_db_query("select orders_id from " . TABLE_HOLDING_ORDERS . " where orders_id = '" . tep_db_input($ocID) . "'");

include(DIR_WS_CLASSES . 'order_check.php');
$order = new order($ocID);
?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
<!-- body_text //-->

<table border="0" width="100%" cellspacing="0" cellpadding="2">
	<tr>
		<td>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
	<tr>
		<td class="pageHeading"><?php echo nl2br(STORE_NAME_ADDRESS); ?></td>
		<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce', '204', '50'); ?></td>
	</tr>
</table>
		</td>
	</tr>
	<tr>
		<td>
<table width="100%" border="0" cellspacing="0" cellpadding="2">
	<tr>
		<td colspan="2"><?php echo tep_draw_separator(); ?></td>
	</tr>
	<tr>
		<td valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="2">
	<tr>
		<td class="main"><b><?php echo ENTRY_SOLD_TO; ?></b></td>
	</tr>
	<tr>
	<td class="main"><?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, '&nbsp;', '<br>'); ?></td>
	</tr>
	<tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
	</tr>
	<tr>
		<td class="main"><?php echo $order->customer['telephone']; ?></td>
	</tr>
	<tr>
		<td class="main">
<?php echo '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>'; ?>
		</td>
	</tr>
</table>
		</td>
		<td valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="2">
	<tr>
		<td class="main"><b><?php echo ENTRY_SHIP_TO; ?></b></td>
	</tr>
	<tr>
		<td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '&nbsp;', '<br>'); ?></td>
	</tr>
</table>
		</td>
	</tr>
</table>
		</td>
	</tr>
	<tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
	</tr>
	<tr>
		<td>
<table border="0" cellspacing="0" cellpadding="2">
	<tr>
	<td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td>
	<td class="main"><?php echo $order->info['payment_method']; ?></td>
	</tr>
</table>
		</td>
	</tr>
	<tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
	</tr>
	<tr>
		<td>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
	<tr class="dataTableHeadingRow">
	<td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
	<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>
	</tr>

<?php
for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
	echo '
<tr class="dataTableRow">' . "\n" .
'<td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . '&nbsp;x</td>' . "\n" .
'<td class="dataTableContent" valign="top">' . $order->products[$i]['name'];

	if (sizeof($order->products[$i]['attributes']) > 0) {
		for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
			echo '
<br><nobr><small>&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' 
. $order->products[$i]['attributes'][$j]['value'];
			echo '</i></small></nobr>';
		}
	}

	echo '
</td>' . "\n" .
'<td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n" .
'</tr>' . "\n";
}
?>

</table>
		</td>
	</tr>
</table>

<!-- body_text_eof //-->

</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
