AT START
????? $user = input(user) ???? an input box to pass parameter
?????? $ cCode = input(Password)
I can get following code to work but no data in report. I took out get cCode and entered my own but no table info
Code: Select all
>html
<meta http-equiv="Content-Type" content="text/html; charset=utf-8;" />
<head>
<style>
table {
width:70%;
}
table, td, th {
border: 1px solid black;
border-collapse: collapse;
}
h1 {
color: #00A;
}
</style>
</head>
<body>
<?PHP
//include('./settings.php');
//if ( $_GET["cCode"] == false )
//{ I TOOK THIS AREA OUT
// print "You dind't send client code!";
// exit;
//}
$cRequestedClient = '10001'; //$_GET["cCode"];
print "<h1>Sale of client: ".$cRequestedClient."</h1><br>";
print '<table>';
print "<th>No</th><th>Item</th><th>Description</th><th>Price</th><th>Saleprice</th>";
$SalesFile = './CLLIST3.TXT';
$lines = file($SalesFile);
$no=1;
$total1=0;
$total2=0;
foreach ($lines as $line) {
$aline=explode(',',$line);
$cCodeClientSale = trim($aline[0]);
if($cCodeClientSale==$cRequestedClient )
{
print "<tr>";
print "<td>".$no."</td>";
print "<td>".$aline[1]."</td>";
print "<td>".$aline[2]."</td>";
print "<td>".$aline[3]."</td>";
print "<td>".$aline[4]."</td></tr>";
$total1+=$aline[3];
$total2+=$aline[4];
$no++;
}
}
print "<tr>";
print "<td></td>";
print "<td></td>";
print "<td>TOTAL</td>";
print "<td>".$total1."</td>";
print "<td>".$total2."</td></tr>";
print "</table>";
?>
</body>
</html>
Franco