%my $debug=0; # toggle debug %my ($svcnum, $p_prev_date, $p_curr_date, $p_prev_reading, $p_curr_reading, % $p_tdsp, $p_meter_mult, $p_total_usage, $p_measured_demand, % $p_billed_demand, $p_svcnum, $p_entry_date, $p_meter_number, % $p_first, $p_last, $p_balance, $p_last_billed); %my ($pkgnum, $svcpart, $svc_external ); %my @field_descriptions = ( 'prev date', 'curr date', 'prev reading', % 'curr reading', 'tdsp', 'meter mult', % 'total usage', 'measured demand', 'billed demand', % 'svcnum', 'entry date', 'meter number' ); %my @field_name = qw / prev_date curr_date prev_read curr_read tdsp % meter_multiplier total_usage measured_demand % billed_demand svcnum _date meter_number /; %my $date_exception = '(prev_date|curr_date|_date)'; % %if ( $cgi->param('error') ) { % ### handle error call % $svcnum = $cgi->param('svcnum'); %} %else { % % my($query) = $cgi->keywords; %# $query =~ /^(\d+)$/ or die "unparsable svcnum"; % #$svcnum=$1; % % $p_prev_date = $cgi->param('p_prev_date'); % $p_curr_date = $cgi->param('p_curr_date'); % $p_prev_reading = $cgi->param('p_prev_reading'); % $p_curr_reading = $cgi->param('p_curr_reading'); % $p_tdsp = $cgi->param('p_tdsp'); % $p_meter_mult = $cgi->param('p_meter_mult'); % $p_total_usage = $cgi->param('p_total_usage'); % $p_measured_demand = $cgi->param('p_measured_demand'); % $p_billed_demand = $cgi->param('p_billed_demand'); % $p_svcnum = $svcnum = $cgi->param('p_svcnum'); % $p_first = $cgi->param('p_first'); % $p_last = $cgi->param('p_last'); % $p_balance = $cgi->param('p_balance'); % $p_last_billed = $cgi->param('p_last_billed'); % #$svcnum = $cgi->param('p_meter_number'); %} % %# this is sample data for print in case no previous record of usage_elec %my @sample_data = ( '20070201', '20070228', '10000', '100100', '76.50', % '5', '500', '179', '220', "$svcnum", 'NA', '030234972LM'); % %### this is where i start %### %### let gather all the info from usage_elec for the particular 'svcnum' %### %my $p1 = popurl(1); % %print qq!Error: !, $cgi->param('error'), % "" % if $cgi->param('error'); % %print qq!