summaryrefslogtreecommitdiff
path: root/httemplate/search/report_svc_hardware.html
blob: 4a763b0b4054264b65dc57952ccba38eaf71359c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<% include('/elements/header.html', $title ) %>

<FORM ACTION="svc_hardware.cgi" METHOD="GET">

  <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
    <TR>
      <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Search options</FONT></TH>
    </TR>

    <TR><TD>
    <% include('/elements/selectlayers.html',
                  'field'           => 'classnum',
                  'label'           => '',
                  'options'         => \@classnums,
                  'labels'          => \%class_labels,
                  'layer_callback'  => \&layer_callback,
                  'html_between'    => '</TD><TD>',
              ) %>
    </TD></TR>

    <% include('/elements/tr-input-text.html',
                  'field' => 'serial',
                  'label' => 'Serial #',
              ) %>
    <% include('/elements/tr-input-text.html',
                  'field' => 'hw_addr',
                  'label' => 'Hardware address',
              ) %>
    <% include('/elements/tr-input-text.html',
                  'field' => 'ip_addr',
                  'label' => 'IP address',
              ) %>
    <% include('/elements/tr-select-table.html',
                  'field'     => 'statusnum',
                  'label'     => 'Service status',
                  'table'     => 'hardware_status',
                  'name_col'  => 'label',
                  'empty_label' => 'any',
              ) %>
 
  </TABLE>

<BR>
<INPUT TYPE="submit" VALUE="Search">

</FORM>

<% include('/elements/footer.html') %>
<%init>

die "access denied"
  unless $FS::CurrentUser::CurrentUser->access_right('List packages'); #?

my $title = 'Hardware Service Report';

my @classes = qsearch('hardware_class', {});
my @classnums = ('', map { $_->classnum } @classes);
my %class_labels = ('' => 'Select hardware class',
                     map { $_->classnum => $_->classname } @classes);

sub layer_callback {
  my $classnum = shift or return '';
  include('/elements/select-hardware_type.html',
              'field'       => 'classnum'.$classnum.'typenum',
              'classnum'    => $classnum,
              'empty_label' => 'any',
          );
}
  
</%init>