Location: PHPKode > projects > Battle Cart > order/admin/txn.php
<?
require "basic.inc.php";
require "header.inc.php";
?>

<?
$result = mysql_query("SELECT * FROM orders WHERE txn_id='$id'");
$pp = mysql_fetch_array($result) or die("Couldn't find transaction $id in database");
?>

<body>
<p><b>Status: 
  <?
  function num_to_dollar($num) {
	$num = "$num";
	$len = strlen($num);
	if ($num == round($num)) return "$num.00";
	else if ($num[$len-2] == ".") return "$num"."0";
	else return round($num,2);
}

// Payment Status Descriptions
$payment_status_options = array(
	"Denied" => "you manually denied this payment",
	"Canceled_Reversal" => "payment reversal cancelled; funds are in your account",
	"Failed" => "customer's bank account transfer failed",
	"Refunded" => "you refunded this payment"
);

$pending_reason_options = array(
	"address" => "no shipping address provided",
	"echeck" => "echeck has not yet cleared",
	"intl" => "intl payment your account isn't set to accept",
	"multi_currency" => "intl currency payment your account isn't set to accept",
	"unilateral" => "payment send to unregistered email address",
	"upgrade" => "credit card payment your account isn't set to accept",
	"verify" => "your account isn't verified",
	"other" => "unknown; contact paypal"
);

$reason_code_options = array(
	"buyer_complaint" => "buyer complaint resulted in reversal",
	"chargeback" => "chargeback was made",
	"guarantee" => "buyer used money back guarantee",
	"refund" => "unknown; contact paypal"
);

if ($pp['payment_status'] == "Completed") {
	?>
  <span style="color:green"> 
  <?
	echo $pp['payment_status']." (good to go)";
	?>
  </span> 
  <?
} else {
	?>
  <span style="color:red"> 
  <?
	if ($pp['payment_status'] == "Pending") {
		echo $pp['payment_status']." (".$pending_reason_options[$pp['pending_reason']].")";
	} else if ($pp['payment_status'] == "Completed") {
		echo $pp['payment_status']." (".$reason_code_options[$pp['reason_code']].")";
	} else {
		echo $pp['payment_status']." (".$payment_status_options[$pp['payment_status']].")";
	}
	?>
  </span> 
  <?
}
?>
  </b> <br>
  <b>Buyer: <? echo $pp['first_name'] ?> <? echo $pp['last_name'] ?> (<a href="mailto:<? echo $pp['payer_email'] ?>"><? echo $pp['payer_email'] ?></a>)<br>
  Payment: $<? echo $pp['settle_amount'] ? num_to_dollar($pp['settle_amount']) : num_to_dollar($pp['mc_gross']) ?> on <? echo date("M d, Y",strtotime($pp['payment_date'])) ?></b></p>
<p><b>Ship to (<? echo $pp['address_status'] ?> address):<br>
  </b><? echo $pp['address_name'] ? $pp['address_name'] : $pp['first_name']." ".$pp['last_name'] ?> 
  <br>
  <? echo $pp['address_street'] ?> <br>
  <? echo $pp['address_city'] ?>, <? echo $pp['address_state'] ?> <? echo $pp['address_zip'] ?><br>
  <? echo $pp['address_country'] ?> </p>
<p><b>Customer Comments:<br>
  </b><? echo $pp['memo'] ? $pp['memo'] : "none" ?></p>
<p><b>Items:</b><br>
  <?
$items = explode(" ",$pp['item_number']);
$items = array_slice($items,0,sizeof($items)-1);
foreach ($items as $item) {
	echo $item."<BR />";
}
?>
</p>
<p><a href="edit.php?txn_id=<? echo $pp['txn_id'] ?>">Edit transaction</a> | <a href="action.php?action=remove_txn&txn_id=<? echo $pp['txn_id'] ?>">Remove 
  Transaction </a></p>
</body>
</html>
Return current item: Battle Cart