<? include("top.php");
//Define the maximum items while listine
$PageSize=10;
//Define the maximum items while adding
$max=$PageSize;
//$thumb_width=98;
//$thumb_height=42;

switch ($showing):
	default:
		if(!empty($keyword)){
			$strSQL="select * from transaction where (Date like '%$keyword%' or Card_id like '%$keyword%' or Pos_id like '%$keyword%' or Amount like '%$keyword%' or Employee_id like '%$keyword%' or Action like '%$keyword%') order by Date desc";
		}
		else{
			$strSQL="select * from transaction order by Date desc";
			$objRS=mysql_query($strSQL);
			$total=mysql_num_rows($objRS);
			$strSQL=makePages ($strSQL,$PageSize,$p);
		}
		$objRS=mysql_query($strSQL);
		?>
		<form action="<? echo $filename; ?>?menu=<?=$menu?>&sub=<?=$sub?>&lang=<?=$LangId?>" method="post">
            <table cellspacing="5" cellpadding="5" class="listing" width="100%">
                <tr>
                <td height="35" align="right">search <input name="keyword" value="<? echo $keyword; ?>" size="30" /><input type="submit" name="Search" value=" " class="search" /></td>
                </tr>
            </table>
        </form>
        <form action="<? echo $filename; ?>?menu=<?=$menu?>&sub=<?=$sub?>&lang=<?=$LangId?>&sec=<?=$type?>&action=delete" method="post" name="del" id="del">
            <table cellspacing="5" cellpadding="5" class="listing">
                <tr>
                <th width="125">Date</th>
                <th width="125">Card</th>
                <th width="125">Machine</th>
                <th width="125">Employee ID</th>
                <th width="125">Amount</th>
                <th width="125">Action</th>
               </tr>
                <? 
                while ($row=mysql_fetch_object($objRS)):
                ?>
                    <tr>
                    <td><? echo date("Y-m-d",$row->Date); ?></td>
                    <td><? echo $row->Card_id; ?></td>
                    <td><? echo $row->Pos_id; ?></td>
                    <td><? echo $row->Employee_id; ?></td>
                    <td><? echo $row->Amount; ?></td>
                    <td><? echo $row->Action; ?></td>
                  </tr>
                <? endwhile; ?>
                <tr>
                <th colspan="12"><?=dispPages ($total,$PageSize,$p,'menu='.$menu.'&sub='.$sub.'&lang'.$LangId.'&sec'.$type)?></th>
                </tr>
            </table>
		</form>
<? 
break;
endswitch;
include("bottom.php"); ?>
