<?php

/*

osCommRes, Services Oline 
http://www.oscommres.com 
Copyright (c) 2005 osCommRes 

Freeway eCommerce 
http://www.zac-ware.com/freeway 
Copyright (c) 2007 ZacWare

Released under the GNU General Public License
*/
// Set flag that this is a parent file
	define( '_FEXEC', 1 );
  require('includes/application_top.php');
  require(DIR_WS_CLASSES . 'split_page_results_report.php');
  define(BOX_WIDTH1,'125');

	// get initial parameters, check the session for previous settings
	$page=(isset($input_params["page"])?$input_params["page"]:1);
	// create the query for fetching registered subscribers
	 $sql = "select ao_customer_id,order_id,payment_date,payment_method,payment_info from " . TABLE_AO_PAYMENTS."";
	 $sql_temp=$sql;
	// split the report
	 $query_split = new splitPageResultsReport($page, REPORT_MAX_ROWS_PAGE, $sql_temp, $query_split_numrows);
		
	 $sql_result = tep_db_query($sql);
	if (tep_db_num_rows($sql_result)>0) $found_results=true;
?>
<!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">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
<div id="spiffycalendar" class="text"></div>
	<!-- header //-->
	<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
	<!-- header_eof //-->
	<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
	<tr> 
		<!-- body_text //-->	  
		<td width=100% align=left valign="top">
		<table border="0" width="100%" cellspacing="0" cellpadding="2">
			<tr>
				<td class="pageHeading"><?php echo HEADING_AOPAYMENT_DETAILS;?></td>	
			<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>
								<td class="smallText" align="left">
									<?php echo $query_split->display_links($query_split_numrows, REPORT_MAX_ROWS_PAGE, REPORT_MAX_LINKS_PAGE, $page,tep_get_report_params()); ?>&nbsp;
								</td>
							</tr>
						</table>
						</td>
					</tr>
					<tr>
						<td>
						<table border="0" width="100%" cellspacing="1" cellpadding="1">
							<tr class='dataTableHeadingRow'>
								<td class='dataTableHeadingContent' width="30">#</td>
								<td class='dataTableHeadingContent' width="50"><?php echo TEXT_AOID;?></td>
								<td class='dataTableHeadingContent' width="50"><?php echo TEXT_ORDER_ID;?></td>
								<td class='dataTableHeadingContent' width="100"><?php echo TEXT_PAY_DATE;?></td>
								<td class='dataTableHeadingContent' width="130"><?php echo TEXT_PAY_METHOD;?></td>
								<td class='dataTableHeadingContent' width="130"><?php echo TEXT_PAY_INFO;?></td>
							</tr>

				<?php
				if($found_results){
					$i=1;
          			while($row = mysql_fetch_assoc($sql_result)) {
					?>
				  <tr class='dataTableRow' height="20" onMouseOver="rowOverEffect(this)" onMouseOut="rowOutEffect(this)" onClick="javascript:location.href='<?php echo tep_href_link(FILENAME_ORDERS ,'oId='.$row['order_id'] .'&return=aop&page=1&action=edit&oID='.$row['order_id']."");?>'">
						  <td class='dataTableContent' style="cursor:hand"><?php echo $i?></td>
						  <td class='dataTableContent' style="cursor:hand"><?php echo $row['ao_customer_id'];?></td>
						  <td class='dataTableContent' style="cursor:hand"><?php echo $row['order_id'];?></td>
						  <td class='dataTableContent' style="cursor:hand"><?php echo format_date($row['payment_date']);?></td>
						  <td class='dataTableContent' style="cursor:hand"><?php echo $row['payment_method'];?></td>
						  <td class='dataTableContent' style="cursor:hand"><?php echo $row['payment_info'];?></td>
					  </tr>
      			<?php 
						$i++;						
					} // for $icnt
				} else {
			     echo '<tr><td colspan=7 class=dataTableContent align=center><b>No Ao Payment Found<b></td></tr>';
			    }?>
					
				</table>
				</TD>
			</tr>
	</table>
	</td>
</tr>
</table>	
	<!-- footer //-->
	<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
	<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>