Code: Select all
while ($i < $num)
{
$Last=mysql_result($result,$i,"Last");
$First=mysql_result($result,$i,"First");
print('<tr><td width="30"><input name="Last[$i]" size="30" value=');
print("$Last");
print('></td>
<td width="30"><input name="First[$i]" size="30" value=');
print("$First");
print('></td>
<td><input name="RegHours[$i]" value="" size="5"></td>
<td><input name="OTHours[$i]" value="" size="5"></td>
<td><input name="DTHours[$i]" value="" size="5"></td>
<td><input name="HolHours[$i]" value="" size="5"></td>
<td><input name="VacHours[$i]" value="" size="5"></td>
<td><input name="SLHours[$i]" value="" size="5"></td></tr>');
$i++;}
print("<tr><td><INPUT TYPE=submit NAME=submit VALUE='Calculate'></form></td></tr></table>");
?>The bigger problem is putting the post variables into regular variables, go ahead and laugh as long as you can point me in the right direction:
Code: Select all
<?
$PayThroughDate=$_POST['PayThroughDate'];
print("$PayThroughDate");
for($i = 0; $i < 10; $i++){
$Last[i]=$_POST['Last[$i]'];
$First[i]=$_POST['First[$i]'];
$RegHours[i]=$_POST['RegHours[$i]'];
$OTHours[i]=$_POST['OTHours[$i]'];
$DTHours[i]=$_POST['DTHours[$i]'];
$HolHours[i]=$_POST['HolHours[$i]'];
$VacHours[i]=$_POST['VacHours[$i]'];
$SLHours[i]=$_POST['SLHours[$i]'];
print("$Last, $First, $RegHours, $OTHours, $DTHours, $HolHours, $VacHours, $SLHours ");
};
?>What I'm trying to do is list all of the employee names from the database, put in all their hours at the same time before submitting them instead of having to submit them record by record.