my @stat = (
['trunk_usage' ,'% Trunk Usage'],
['pre_ivr' ,'Pre-IVR Call Volume'],
['trunk_group' ,'Trunk Group Utilization'],
['average_speed','Average Speed of Answer'],
['outage_call' ,'Outage Call Volume'],
['ivr_call' ,'IVR Call Volume'],
['non_outage' ,'Non-Outage Call Volume'],
['post_ivr' ,'Post-IVR Call Volume'],);
my @row = (1,0,1,1,1,0,1,0);
#while (my @row = $sth->fetchrow_array) {
print qq!<table id="t01"><tr>!;
for my $i (0..$#stat){
my $chk = ($row[$i] == 1) ? 'checked' : '';
print qq!<td>
<input type="checkbox" name="$stat[$i][0]" value="1" $chk />
$stat[$i][1]
</td>!;
if (($i % 2) && ($i < $#stat)){
print q!</tr><tr>!;
}
}
print q!</tr></table>!;
#}
print q!</div></body></html>!;
You need to put the database stuff back to replace the test values in @row, and probably the <form> tags but around the table not each input.
poj |