do they have to carry out their business idea?

This commit is contained in:
nik gaffney 2021-08-29 13:44:32 +02:00
parent cfa7d75621
commit 6dc67b4362
2 changed files with 72 additions and 69 deletions

View file

@ -1,12 +1,17 @@
/* Document Layout */ /* Document Layout */
body { body {
line-height: 1.2; line-height: 1.1em;
font-family: sans-serif; font-family: sans-serif;
font-size: 1.5em font-size: 1.0em;
background: "#ffffff"; background: "#ffffff";
} }
p {
padding: 0em;
margin: 0em;
}
.container { .container {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
@ -87,7 +92,6 @@ body {
.budget-subtotal { .budget-subtotal {
font-family: monospace; font-family: monospace;
font-size: 1.2em; font-size: 1.2em;
display: table-row;
} }
.subtotal-name { .subtotal-name {
@ -95,15 +99,17 @@ body {
font-size: 1.1em; font-size: 1.1em;
padding-top: 0.5em; padding-top: 0.5em;
padding-bottom: 0.1em; padding-bottom: 0.1em;
display: table-cell; display: inline-block;
width: 60%;
} }
.subtotal-amount { .subtotal-amount {
font-family: sans-serif; font-family: sans-serif;
font-size: 1.1em; font-size: 1.1em;
font-weight: bold; font-weight: bold;
padding-left: 20px; text-align: right;
display: table-cell; display: inline-block;
width: 35%;
} }
@ -112,22 +118,26 @@ body {
.budget-item { .budget-item {
font-family: monospace; font-family: monospace;
font-size: 0.9em; font-size: 0.9em;
display: table-row; padding-top: 0em;
padding-bottom: 0em;
} }
.item-name { .item-name {
font-family: serif; font-family: serif;
font-size: 0.9em; font-size: 0.9em;
padding-top: 0.1em; padding-top: 0em;
padding-bottom: 0.1em; padding-bottom: 0em;
display: table-cell; display: inline-block;
width: 60%;
} }
.item-amount { .item-amount {
font-family: sans-serif; font-family: sans-serif;
font-size: 0.9em; font-size: 0.9em;
font-weight: bold; font-weight: bold;
padding-left: 20px;
text-align: right; text-align: right;
display: table-cell; padding-top: 0em;
padding-bottom: 0em;
display: inline-block;
width: 35%;
} }

View file

@ -73,45 +73,27 @@ $new_amount = sprintf "%.2f",$new_amount; ## 2 decimal places
$new_url=$q->param("new_url"); $new_url=$q->param("new_url");
#$new_url=~ s/http\:\/\///g; # don't remove http:// #$new_url=~ s/http\:\/\///g; # don't remove http://
$new_item = $q->param("new_item"); $new_item = sanitise($q->param("new_item"));
$new_item =~ s/\'/\'\'/g; $new_labour = sanitise($q->param("new_labour"));
$new_item =~ s/\x92/’/g; $new_resource = sanitise($q->param("new_resource"));
$new_labour = $q->param("new_labour"); $new_status = sanitise($q->param("new_status"));
$new_labour =~ s/\'/\'\'/g; $new_lstatus = sanitise($q->param("new_lstatus"));
$new_labour =~ s/\x92/’/g; $new_rstatus = sanitise($q->param("new_rstatus"));
$new_resource = $q->param("new_resource"); $type = sanitise($q->param("type"));
$new_resource =~ s/\'/\'\'/g;
$new_resource =~ s/\x92/’/g;
$new_status = $q->param("new_status");
$new_lstatus = $q->param("new_lstatus");
$new_rstatus = $q->param("new_rstatus");
$type = $q->param("type");
for ( $i=0; $i<=50; $i+=1) { for ( $i=0; $i<=50; $i+=1) {
$new_status{$i} = $q->param("new_status$i"); $new_status{$i} = sanitise($q->param("new_status$i"));
$type{$i} = $q->param("type$i"); $type{$i} = sanitise($q->param("type$i"));
$new_item{$i} = $q->param("new_item$i"); $new_item{$i} = sanitise($q->param("new_item$i"));
$new_item{$i} =~ s/\'/\'\'/g; $new_resource{$i} = sanitise($q->param("new_resource$i"));
$new_item{$i} =~ s/\x92/&rsquo;/g; $new_labour{$i} = sanitise($q->param("new_labour$i"));
$new_resource{$i} = $q->param("new_resource$i"); $new_status{$i} = sanitise($q->param("new_status$i"));
$new_resource{$i} =~ s/\'/\'\'/g; $new_lstatus{$i} = sanitise($q->param("new_lstatus$i"));
$new_resource{$i} =~ s/\x92/&rsquo;/g; $new_rstatus{$i} = sanitise($q->param("new_rstatus$i"));
$new_labour{$i} = $q->param("new_labour$i");
$new_labour{$i} =~ s/\'/\'\'/g;
$new_labour{$i} =~ s/\x92/&rsquo;/g;
$new_status{$i} = $q->param("new_status$i");
$new_lstatus{$i} = $q->param("new_lstatus$i");
$new_rstatus{$i} = $q->param("new_rstatus$i");
$new_firstname{$i} = $q->param("new_firstname$i"); $new_firstname{$i} = sanitise($q->param("new_firstname$i"));
$new_firstname{$i} =~ s/\'/\'\'/g; $new_lastname{$i} = sanitise($q->param("new_lastname$i"));
$new_firstname{$i} =~ s/\x92/&rsquo;/g; $new_codename{$i} = sanitise($q->param("new_codename$i"));
$new_lastname{$i} = $q->param("new_lastname$i");
$new_lastname{$i} =~ s/\'/\'\'/g;
$new_lastname{$i} =~ s/\x92/&rsquo;/g;
$new_codename{$i} = $q->param("new_codename$i");
$new_codename{$i} =~ s/\'/\'\'/g;
$new_codename{$i} =~ s/\x92/&rsquo;/g;
$cost{$i}=~ s/\€/@euro/g; $cost{$i}=~ s/\€/@euro/g;
$cost{$i} = $q->param("cost$i"); $cost{$i} = $q->param("cost$i");
@ -183,10 +165,11 @@ given ($action) {
} }
exit; exit;
# saniti[sz]e sql inputs as needed # saniti[sz]e parameters and sql inputs as needed
sub sanitise { sub sanitise {
my $string = shift; my $string = shift;
$string =~ s/\'/\'\'/g; $string =~ s/\'/\'\'/g; # convert ' to ''
$string =~ s/\x92/&rsquo;/g; # convert "RIGHT SINGLE QUOTATION MARK" to html
return $string; return $string;
} }
@ -810,8 +793,10 @@ sub compile_budget {
$sthb->execute; $sthb->execute;
my $recordb = $sthb->fetchrow_hashref; my $recordb = $sthb->fetchrow_hashref;
# page header
&print_header; &print_header;
# budget header
print <<END; print <<END;
<div class="header"> <div class="header">
<div class="headline-1"> <div class="headline-1">
@ -837,8 +822,8 @@ END
</div> </div>
END END
# CGI parameter forms
$sthr->execute; $sthr->execute;
while (my $recordr = $sthr->fetchrow_hashref) { while (my $recordr = $sthr->fetchrow_hashref) {
print<<END; print<<END;
<FORM ACTION="$script_name"METHOD="GET"> <FORM ACTION="$script_name"METHOD="GET">
@ -873,13 +858,16 @@ END
END END
} }
# budget columns
print <<END; print <<END;
<div id="budget" class="container"> <div id="budget" class="container">
<div id="left" class="column"> <div id="left" class="column">
<div class="title">FINANCIAL</div>
<div class="subtitle">OUTGOINGS: / money requested or supplied</div>
END END
print_title("FINANCIAL");
print_subtitle("OUTGOINGS: / money requested or supplied");
print_subtitle("Labour / paid"); print_subtitle("Labour / paid");
while (my $recordef = $sthef->fetchrow_hashref) { while (my $recordef = $sthef->fetchrow_hashref) {
@ -913,7 +901,7 @@ END
print_item("$recordex->{item}", ">$recordex->{currency}$display_cost"); print_item("$recordex->{item}", ">$recordex->{currency}$display_cost");
} }
print_subtotal("INCOME: / donations, contributions, sums, funds"); print_subtitle("INCOME: / donations, contributions, sums, funds");
while (my $recordf = $sthf->fetchrow_hashref) { while (my $recordf = $sthf->fetchrow_hashref) {
print_item("", sprintf("&euro;%.2f", $recordf->{amount})); print_item("", sprintf("&euro;%.2f", $recordf->{amount}));
@ -947,9 +935,10 @@ END
print <<END; print <<END;
</div> </div>
<div id="right" class="column"> <div id="right" class="column">
<div class="title">NONFINANCIAL</div>
END END
print_title("NONFINANCIAL");
print_subtitle("Human and nonhuman budget contributions: / labour and resources, deployed &amp;/or offfered, latent, awaiting activation"); print_subtitle("Human and nonhuman budget contributions: / labour and resources, deployed &amp;/or offfered, latent, awaiting activation");
print_subtitle("Labour / deployed"); print_subtitle("Labour / deployed");
@ -984,25 +973,19 @@ END
$sthor->execute; $sthor->execute;
while (my $record = $sthor->fetchrow_hashref) { while (my $record = $sthor->fetchrow_hashref) {
$record->{item} =~ s/^([a-z])/\U$1/; ## capitalise first letter $record->{item} =~ s/^([a-z])/\U$1/; ## capitalise first letter
my $first=$record->{firstname} ; $initials = get_initials($record);
my $last=$record->{lastname} ; print_item("$record->{item} [$initials]");
$first_init = substr($first, 0, 1);
$last_init = substr($last, 0, 1);
$first_init =~ s/^([a-z])/\U$1/; ## capitalise first letter
$last_init =~ s/^([a-z])/\U$1/; ## capitalise first letter
print_item("$record->{item} [$first_init$last_init]");
} }
print(qq(</div></div>));
$dbh->disconnect; $dbh->disconnect;
print(qq(</div></div>));
&print_footer; &print_footer;
} }
# capitalise the initials of a name from a record # capitalise the initials of a name from a record
sub get_initials { sub get_initials {
$record = shift; $record = shift;
my $first=$record->{firstname} ; my $first=$record->{firstname} ;
@ -1014,6 +997,7 @@ sub get_initials {
return "$first_init$last_init" return "$first_init$last_init"
} }
############################################################################ ############################################################################
# prepare expenditure # prepare expenditure
@ -1916,16 +1900,25 @@ sub select_start_date {
############################################################################## ##############################################################################
## print a title
sub print_title {
my $string = shift;
print <<END;
<div class="title">$string</div>
END
}
## print a subtitle ## print a subtitle
sub print_subtitle { sub print_subtitle {
my $string = shift; my $string = shift;
print <<END; print <<END;
<div class="subtitle">$string</p></div> <div class="subtitle">$string</div>
END END
} }
## print a budget subtotal ## print a budget subtotal line with a description and optional amount
sub print_subtotal { sub print_subtotal {
my $string = shift; my $string = shift;
@ -1939,7 +1932,7 @@ sub print_subtotal {
END END
} }
## print standard budget item ## print standard budget item with a description and optional amount
sub print_item { sub print_item {
my $string = shift; my $string = shift;
@ -1974,7 +1967,7 @@ END
} }
## print the standard footer ## print a standard footer
sub print_footer { sub print_footer {
print <<END; print <<END;