//my program generates this button ($tcl) more than one times and then when i click it all the ($tcl) buttons would //disappear. what ive been trying to do here is when i click one of the $tcl buttons, they would remain visible until i choose //another date. how do i do this?
<table height="100%" width="70%">
<tr><form name="date" method="post">
//this part gets the date
<td align="left">SELECT : <select name="date" id="date">
<?php
$query="select distinct date from arrastre order by date desc";
$result=mysql_query($query);
while($row=mysql_fetch_array($result)){
$date=$row['date'];
echo "<option value='".$date."'>$date</option>";
}
?>
</select>
//this the part that the $tcl buttons are created using $date from above as reference
<input name="godate" type="submit" value="go"></form> <br><br><br>
</tr>
<tr>
<td align="left">TCL:
<?php
if(isset($_POST['godate'])){
$date=$_POST['date'];
$query="select distinct tcl from arrastre where date='$date' order by tcl asc";
$result=mysql_query($query);
echo '<form method="POST"><input type="hidden" name="date" value="'. $date. '">';
while($row=mysql_fetch_array($result)){
$tcl=$row['tcl'];
?>
<input type="submit" name="tcl" value="<?php echo $tcl; ?>"> //this is the button generated more than one time depending on how many $tcl there on that date
<?php } }
?>
</form>
</tr>
//this part takes the $tcl and $date to display the values from the database
<?php
if((isset($_POST['tcl'])) && (isset($_POST['date']))){
$tcl=$_POST['tcl'];
$date=$_POST['date'];
$query = "select * from `arrastre` where `tcl` = '" . $tcl. "' and `date` = '" . $date . "' order by `tcl` asc";
$result = mysql_query($query) or die(mysql_error());
while($row=mysql_fetch_array($result)){
$orno=$row['orno'];
$billnmbr=$row['billnmbr'];
$payor=$row['payor'];
$arrastre=$row['arrastre'];
$wharfage=$row['wharfage'];
$total=$row['total'];
$date=$row['date'];
}
?>
<tr>///display part erased to shorten
</tr>
<?php }$_POST['tcl']=1;
}
?>
<tr>
<td colspan="3">
<td colspan="2">total collections:
<td align="right"><?php echo $totformat;?>
</tr>
</table>
//my only problem here is that when i click a $tcl button and after it displays the form, all of the $tcl buttons would //disappear but i want them to still be there until i choose another date, only then should it display another set of $tcl //buttons
//thank you for your time
