<?php session_start();  //Developed by ITechScripts
require 'include/announcements.php'; // ITECHBIDS Configuration File
require 'include/itechbids.php'; // ITECHBIDS Configuration File
$locheckuser=$_SESSION[username];
$locheckpass=$_SESSION[checkpass];
if((strlen($locheckuser)==0) || (strlen($locheckpass)==0))
{
echo '<meta http-equiv="refresh" content="0; url=index.php">';
exit();
} 
$lochecksql="select * from member_details where user_name='$locheckuser' and password='$locheckpass' and verified='yes' and approved='yes' and payment_status='yes'";
$locheckre=mysql_query($lochecksql);
if(mysql_num_rows($locheckre)==0)
{
echo '<meta http-equiv="refresh" content="0; url=index.php">';
exit();
} 
$user_id=$_SESSION[userid];
$mode=$_GET[mode];
$trans=$_GET[trans];
if((($mode=="Complete")||($mode=="Queued"))&&($trans=="change"))
{
$tid=$_GET[tid];

edit_transaction($mode, $tid);
}
$type=$_GET[type];
$status=$_GET[status];


$cboType=$_POST['cboType'];
$cbostatus=$_POST['cbostatus'];
$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"){
if(($type!="")&&($status!=""))
{
$pay_sql="select * from usertransaction where user_id=$user_id and status='$status' and type='$type' order by pay_id desc";
}
if(($type=="")&&($status==""))
{
 $show_all="yes";
 $pay_sql="select * from usertransaction where user_id=$user_id and status='Complete' order by pay_id desc limit 10";
}
 $pay_res=mysql_query($pay_sql);
 $pay_total_records=mysql_num_rows($pay_res);
}
if($makesearch == "yes"){
 $pay_sql="select * from usertransaction where user_id=$user_id and and status='$cbostatus' and trans_date >=$adate and trans_date <= $bdate and type=$cboType order by pay_id desc";
 $pay_res=mysql_query($pay_sql);
 $pay_total_records=mysql_num_rows($pay_res);
}
?>
<? require'themes/transaction.tpl'; 
?></table>
</body>
</html>