<?php session_start();  //Developed by ITechScripts
?>
<style type="text/css">
<!--
.style1 {
	color: #666666;
	font-weight: bold;
}
.style3 {color: #666666; font-size: 11px; font-family:Arial, Helvetica, sans-serif}
-->
</style>
>
<?php
require 'include/configurations.php'; // ITECHBIDS Configuration File
require 'include/header.php';
?>
<?
require 'tsearch.php';
?>
<?
$makesearch=$_POST['makesearch'];
$array1=array($_POST['cboAyear'],$_POST['cboAmonth'],$_POST['cboAday']);
$array2=array($_POST['cboByear'],$_POST['cboBmonth'],$_POST['cboBday']);
$adate=implode('-',$array1);
$bdate=implode('-',$array2);

if($makesearch != "yes"){
$secsql="select * from usertransaction order by shipped desc limit 20";
$secres=mysql_query($secsql);
}
if($makesearch == "yes"){
$secsql="select * from usertransaction where trans_date >=$adate and trans_date <= $bdate order by shipped desc";
$secres=mysql_query($secsql);
}
?>
<br />

<table width="100%"  border="0" cellpadding="5" cellspacing="1" class="ft" align="center">
 <tr class="ct" height="25"><td colspan="11">
<?
if($makesearch != "yes"){
?>
Last 20 Transactions
<?
}
?>
<?
if($makesearch == "yes"){
?>
Search Result(s)
<?
}
?>
</td></tr>
 <tr class="ct" height="25">
<td class="ct"><b>No.</b> </td>
<td class="ct"><b>User Id</b> </td>
<td class="ct"><b>TransAction Id</b> </td>
<td class="ct" >Item ID</td>
<td  class="ct"><b>Date</b> </td>
<td  class="ct"><b>TXN ID</b>  </td>
<td  class="ct"><b>Amount</b>  </td>
<td  class="ct"><b>Details</b>  </td>
<td  class="ct"><b>Status</b>  </td>
<td  class="ct"><b>Shipped</b>  </td>
<td  class="ct"><b>Type</b>  </td>
</tr>
 <?php
$n=1;
 while($pay_row=mysql_fetch_array($secres))
 {
$itemid=$pay_row['itemid'];
$trans_date=$pay_row[trans_date];
$trans_batchnumber=$pay_row['trans_batchnumber'];
$trans_amount=$pay_row['trans_amount'];
$trans_details=$pay_row['trans_details'];
$currency=$pay_row['currency'];
$txn_id=$pay_row['txn_id'];
$tuser=$pay_row['user_id'];
$status=$pay_row['status'];
$shipped=$pay_row['shipped'];
$purchase=$pay_row['purchase'];

if($purchase=='yes')
{
$ptype="Purchase";
}
if($purchase=='no')
{
$ptype="Won";
}
 ?>
 <tr >
<td >
<? echo $n;?>
</td>
<td><?  echo $tuser ?> </td>
<td><?  echo $trans_batchnumber ?> </td>
<td><?  echo $itemid ?> </td>
<td><?  echo $trans_date ?> </td>
<td> <?  echo $txn_id ?> </td>
<td> <?  echo $trans_amount ?> </td>
<td> <?  echo $trans_details ?> </td>
<td> <?  echo ucfirst($status); ?> </td>
<td> <?  echo ucfirst($shipped); ?> </td>
<td> <?  echo $ptype ?> </td>
</tr>
  <?php
$n++;
 }
 ?>
 </table>
<br /><br />
<?
	require 'include/footer.php';
?>