Location: PHPKode > projects > Battle Cart > order/admin/index.php
<?
require "basic.inc.php";
require "header.inc.php";
?>
<body>
<h1><b>All Unprinted Orders (oldest first)</b></h1>
<table width="700">
  <tr><td><b>Transaction ID</b></td>
    <td><b>Order Time</b></td>
    <td><b>Customer Name</b></td></tr>
<?
$result = mysql_query("SELECT txn_id,DATE_FORMAT(time,'%m-%d-%y %r') as time,first_name,last_name,payment_date FROM orders WHERE payment_status='Completed' AND fulfilled='0' ORDER BY time");
while ($txn = mysql_fetch_array($result)) {
	?>
	<tr><td><a href="txn.php?id=<? echo $txn['txn_id'] ?>"><? echo $txn['txn_id'] ?></a></td><td><? echo date("M d, Y g:ia",strtotime($txn['payment_date'])) ?></td>
    <td><? echo $txn['first_name'] ?> <? echo $txn['last_name'] ?> (<a href="action.php?action=remove_txn&txn_id=<? echo $txn['txn_id'] ?>">remove</a>) 
      (<a href="edit.php?txn_id=<? echo $txn['txn_id'] ?>">edit</a>) </td>
  </tr>
<?
}
?>
</table>
<span class="print">print/archive next: <a href="labels.php?action=print&num=10">10</a> 
<a href="labels.php?action=print&num=30">30</a></span> | <a href="edit.php?action=add">Manually 
Add Order </a> 
<h1>&nbsp;</h1>
<h1><b> Label Batches (last 30)</b></h1>
<table>
  <tr>
    <td><b>Printing Time</b></td>
  </tr>
  <?
$result = mysql_query("SELECT txn_id,DATE_FORMAT(fulfilled_time,'%Y-%m-%d %r') as fulfilled_time,first_name,last_name FROM orders WHERE payment_status='Completed' AND fulfilled='1' GROUP BY fulfilled_time ORDER BY fulfilled_time DESC LIMIT 30");
while ($txn = mysql_fetch_array($result)) {
	?>
  <tr>
    <td><a href="labels.php?action=reprint&batch=<?=$txn['fulfilled_time']?>"><? echo $txn['fulfilled_time'] ?></a> 
      (<a href="labels.php?action=reprint&batch=<?=$txn['fulfilled_time']?>">reprint 
      labels</a>) (<a href="labels.php?action=showtxns&batch=<?=$txn['fulfilled_time']?>">view 
      individual txns</a>) (<a href="action.php?action=unfulfill&batch=<?=$txn['fulfilled_time']?>">move 
      back to unprinted queue</a>)</td>
  </tr>
  <?
}
?>
</table><br>
<a href="batches.php">Archived batches &raquo;</a> 
<h1>&nbsp;</h1>
<h1><b>All Pending Orders (oldest first)</b></h1>
<table width="700">
  <tr><td><b>Transaction ID</b></td>
    <td><b>Order Time</b></td>
    <td><b>Customer Name</b></td></tr>
  <?
$result = mysql_query("SELECT txn_id,DATE_FORMAT(time,'%m-%d-%y %r') as time,first_name,last_name FROM orders WHERE payment_status!='Completed' ORDER BY time");
while ($txn = mysql_fetch_array($result)) {
	?>
	<tr><td><a href="txn.php?id=<? echo $txn['txn_id'] ?>"><? echo $txn['txn_id'] ?></a></td>
    <td><? echo date("M d, Y g:ia",strtotime($txn['payment_date'])) ?></td>
    <td><? echo $txn['first_name'] ?> <? echo $txn['last_name'] ?> (<a href="action.php?action=remove_txn&txn_id=<? echo $txn['txn_id'] ?>">remove</a>) 
      (<a href="edit.php?txn_id=<? echo $txn['txn_id'] ?>">edit</a>) </td>
  </tr>
  <?
}
?>
</table>
</body>
</html>
Return current item: Battle Cart