All pastes #104419 Raw Edit

Untitled

public text v1 · immutable
#104419 ·published 2006-07-28 21:37 UTC
rendered paste body
<?
if ($_GET['account']) {
?>
<table width=100% id="top" border=0>
<tr>
	<td width="14%" class="heading">Date of Transaction</td>
	<td width="14%" class="heading">From / Paid To</td>
	<td width="14%" class="heading">Comment</td>
	<td width="14%" class="heading">Transaction Method</td>
	<td width="14%" class="heading">Deposit or Withdrawl</td>
	<td width="14%" class="heading">Transaction Amount</td>
	<td width="14%" class="heading">Updated Balance</td>
</tr>
<?
include('include/connect.php');
$result = mysql_query("select * from transactions where id = ".$_GET['account']."") or die(mysql_error());
while($r=mysql_fetch_array($result))
{	
	$id=$r["id"];
	$deposit=$r["deposit"];
	$comment=$r["comment"];
	$name=$r["name"];
	$type=$r["type"];
	$amount=$r["amount"];
	$date=$r["date"];
	$balance=$r["balance"];
?>
<tr class="trans">
	<td width="14%" class="trans2"><?print$date;?></td>
	<td width="14%" class="trans1"><?print$name;?></td>
	<td width="14%" class="trans2"><?print$comment;?></td>
	<td width="14%" class="trans1"><?print$type;?></td>
	<td width="14%" class="trans2"><?if ($deposit = "yes"){print"Deposit";}else{print"Withdrawl";}?></td>
	<td width="14%" class="trans1"><?print$amount;?></td>
	<td width="14%" class="trans2"><?print$balance;?></td>
</tr>
<?
}
?>
</table>
<?
}
else {
?>
    <OL>
      <LH><font size="2">Which account would you like to view?</font></LH>
<?
include('include/connect.php');
$gett = mysql_query("select * from transactions") or die(mysql_error());
while($g=mysql_fetch_array($gett))
{
	$id=$g["id"];
	$name=$g["name"];
?>
      <LI><a href=index.php?account=<?print$id;?> class="link"><?print$name;?></a>
<?
}
?>
    </OL>
<?
}