#!/usr/local/bin/perl
# DUNEs   Windows Dialup User Network Errors



require "Dunes.pm";
Dunes->import();
my $Dunes = Dunes->new($db, $admin, \%conf);

#**********************************************************
# dunes_list
#**********************************************************
sub dunes_list {
 my ($attr)=@_;

print $html->form_main({ CONTENT => "ID: " . $html->form_input('ID', "$FORM{ID}"),
                   HIDDEN  => { index => "$index"
                                     },
                   SUBMIT  => { show   => "$_SHOW"
	                      	           } 
	                 });

$LIST_PARAMS{ID}=$FORM{ID} if ($FORM{ID});
my $list = $Dunes->list( { %LIST_PARAMS } );

if ($Dunes->{errno}) {
  $html->message('err', $_ERROR, "[$Dv->{errno}] $err_strs{$Dv->{errno}}");	
  return 0;
 }

if ($Dunes->{TOTAL} == 1) {
  my $table = $html->table({ width      => '400',
                            caption     => "Error: $list->[0]->[0]",
                            title_plain => [ "($list->[0]->[0]) $list->[0]->[3] " ],
                            border      => 1,
                            rows        => [[ $list->[0]->[2] ],
                                     [ $list->[0]->[4] ],
                                     [ $list->[0]->[2] ]
                                    ]
                           });
  print $table->show();	
}

my $table = $html->table( { width        => '100%',
                            caption      => "Dunes",
                            border       => 1,
                            title_plain  => ["$_NUMBER", 'win_err_handle', "$_TEXT"],
                            cols_align   => ['left', 'left'],
                            qs           => $pages_qs,
                            pages        => $Dunes->{TOTAL},
                            ID           => 'DUNES_LIST'
                           });

foreach my $line (@$list) {
  $table->addrow(
    $html->button("$line->[0]",  "index=$index&ID=$line->[0]"),
    "$line->[3]", 
    "$line->[2]", 
   );

}
print $table->show();

$table = $html->table( { width      => '100%',
                         cols_align => ['right', 'right'],
                         rows       => [ [ "$_TOTAL:", $html->b($Dunes->{TOTAL}) ] ]
                        } );
print $table->show();

}

1

