]> Dogcows Code - chaz/p5-CGI-Ex/blob - samples/app/app1/lib/App1/DoBill.pm
CGI::Ex 2.24
[chaz/p5-CGI-Ex] / samples / app / app1 / lib / App1 / DoBill.pm
1 package App1::DoBill;
2
3 =head1 NAME
4
5 App1::DoBill - This step would process the billing
6
7 =cut
8
9 use strict;
10 use warnings;
11 use base qw(App1);
12 use CGI::Ex::Dump qw(debug);
13
14 sub run_step {
15 my $self = shift;
16
17 my $r = $self->cgix->apache_request;
18 local $| = 1 if ! $r;
19
20 $self->cgix->print_content_type;
21
22 print "<div id=fake_progress>\n";
23 print "At this point I would do something useful with the form data<br>\n";
24 print "I would probably add the customer and lineitems and bill the order<br>\n";
25 debug $self->form;
26 print "But for now I will just pretend I'm doing something for 10 seconds<br>\n";
27
28 my $max = 10;
29 for my $i (1 .. $max) {
30 $r->rflush if $r;
31 sleep 1;
32 print "Sleep $i/$max<br>\n";
33 }
34
35 print "</div>\n";
36 # this little progress effect would be better off with something like yui
37 print "<script>
38 var el = document.getElementById('fake_progress');
39 if (el) el.style.display='none';
40 document.scrollTop = '0px';
41 </script>\n";
42
43 return 0;
44 }
45
46 1;
47
This page took 0.036579 seconds and 4 git commands to generate.