I guess Javascript, here is my function:
<script type="text/javascript">
function transdetail(){
var generator=window.open('','name','height=400,width=500');
generator.document.write('<html><head><title>Transaction <? echo $transactionid; ?></title>');
generator.document.write('<link rel="stylesheet" type="text/css" href="http://www.datamt.org/masterfiles/sinorca-screen.css" media="screen" title="Sinorca (screen)" />');
generator.document.write('<link rel="stylesheet alternative" type="text/css" href="http://www.datamt.org/masterfiles/sinorca-screen-alt.css" media="screen" title="Sinorca (alternative)" />');
generator.document.write('<link rel="stylesheet" type="text/css" href="http://www.datamt.org/masterfiles/sinorca-print.css" media="print" />');
generator.document.write('<style type="text/css">');
generator.document.write('body{');
generator.document.write('background: rgb(100,135,220);}');
generator.document.write('</style>');
generator.document.write('</head><body>');
generator.document.write('<div id=popup><center><table border=1>');
generator.document.write('<th colspan=2 class="subheader">Transaction Details for Transaction Number <? echo $transactionid; ?></th>');
generator.document.write('<tr><td><strong>Type</strong></td><td><? echo $type; ?></td></tr>');
generator.document.write('<tr><td><strong>Account Number</strong></td><td><? echo $acct; ?></td></tr>');
generator.document.write('<? if($check == ""){} else{ ?>');
generator.document.write('<tr><td><strong>Check Number</strong></td><td><? echo $check; ?></td></tr>');
generator.document.write('<? } ?>');
generator.document.write('</table></center></div>');
generator.document.write('</body></html>');
generator.document.close();
}
</script>
In my testing this works fine. I need a variable to be the name because this function needs to be used for each result from a query. For example, the user clicks a list to view all transactions, then clicks a link (the function above) to get the details of that transaction.
This would be included in a while loop off my mysql query.
Something like:
psuedo code:
<?
// Inside Query While Loop
$id = $row['TransactionID'];
$transdetail = "TransactionDetail" . $id . "()";
...
?>
<script type="text/javascript">
function <? echo $transdetail; ?>{
//function details from above
</script>
...
Click this link to view the details for the transaction
<?
//loop returns and gets next transaction from database
?>
Thanks,