1 #!/usr/bin/perl
 2 #
 3 # @(#)
 4 #
 5 use strict;
 6 use warnings;
 7 use HTML::FormFu;
 8 use YAML::Syck qw( Load );
 9 use CGI qw(:standard);
10 use HTML::Template;
11 
12 use vars qw ($cgi_query $template $form $formret $TimeFormat);
13 use vars qw ($RstrLdate $RstrLtime);
14 use vars qw ($PRINT_TIDY);
15 
16 my($query, $template, $formret);
17 my($template_out);
18 
19 $query = new CGI;
20 print $query->header();
21 
22 #
23 # open the HTML template
24 $form = HTML::FormFu->new;
25 $form->load_config_file('/opt/http/forms/simple.yml');
26 $form->action("/cgi-bin/simple_get.cgi");
27 $form->method("post");
28 $form->indicator("textvar");
29 $form->process( $cgi_query );
30 
31 $template = HTML::Template->new(filename => '/opt/http/templates/simple.shtml');
32 
33 # fill in some parameters in the template
34 if ( $form->submitted ) {
35     `/bin/echo "proc: submittted" >>/tmp/http.log`;
36 } else {
37     `/bin/echo "proc: Not-submittted" >>/tmp/http.log`;
38     #
39     # Show form to user via apache
40     $template->param( form => $form );
41     $template_out = $template->output;
42     print $template_out . "\n";
43 }