Well, I wrapped that code in this forum's [code]...[/code]
tags to theoretically aid readability. If it really has that many levels of indenting, it might be time to refactor things. 😉
Here's a reformatted version to fit within the page here:
if ($something_to_balance_braces) {
if ($pstat == 'ac') { #stat of 'ac' means its on account
#set up Payment options
#Accumulate Sale info into Arrays
$item = array();
$qty = array();
$option = array();
$optprice = array();
$desc = array();
$price = array();
$tprice = array();
$payopt = 'y';
$x = '1';
}
echo "<h4 class=ct>Sale of: " . $saledate . "<br>Payment Status: \n";
if ($pstat == 'ac') {
echo "<font color=red>On Account:</font>";
}
if ($pstat == 'pp') echo "PayPal";
if ($pstat == 'cc') echo "Credit Card";
if ($pstat == 'cs') echo "Cash";
if ($pstat == 'ck') echo "Check";
echo "<br>\n";
echo "Shipping Status: </b>";
if ($sstat == 's') echo "Shipped";
if ($sstat == 'p') echo "Pending";
if ($sstat == 'h') echo "On Hold";
echo "</h4>\n";
if ($_GET['pic'] == '2') echo "<table class=cart>"; #list page set up cart display
} #end set up new purchase
if ($_GET['pic'] == '1') { #Tumbnail page Detail
#array items for non paid invoices
if (substr($rowo->invid, 1) == 'BUCKS') {
$bucks = $rowo->tprice;
} else {
$item[$x] = substr($rowo->invid, 1);
$qty[$x] = $rowo->qty;
$desc[$x] = cross_field('inventy', 'item', 'descrip', '1', $rowo->invid);
$price[$x] = $rowo->price;
$tprice[$x] = $rowo->tprice;
if ($rowo->opt != '') {
$opts = explode('|', $rowo->opt);
if ($opts[0] == '-') {
$opt = "-";
} else {
$opt = cross_field('options', 'id', 'title', '1', $opts[0]);
}
if ($opts[1] == '-') {
$opt .= "-";
} else {
$opt .= "<br>" . cross_field('options', 'id', 'title', '1', $opts[1]);
}
}
$option[$x] = $opt;
}
} // final brace to balance things out