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 */
body {
line-height: 1.2;
line-height: 1.1em;
font-family: sans-serif;
font-size: 1.5em
font-size: 1.0em;
background: "#ffffff";
}
p {
padding: 0em;
margin: 0em;
}
.container {
display: flex;
flex-direction: row;
@ -87,7 +92,6 @@ body {
.budget-subtotal {
font-family: monospace;
font-size: 1.2em;
display: table-row;
}
.subtotal-name {
@ -95,15 +99,17 @@ body {
font-size: 1.1em;
padding-top: 0.5em;
padding-bottom: 0.1em;
display: table-cell;
display: inline-block;
width: 60%;
}
.subtotal-amount {
font-family: sans-serif;
font-size: 1.1em;
font-weight: bold;
padding-left: 20px;
display: table-cell;
text-align: right;
display: inline-block;
width: 35%;
}
@ -112,22 +118,26 @@ body {
.budget-item {
font-family: monospace;
font-size: 0.9em;
display: table-row;
padding-top: 0em;
padding-bottom: 0em;
}
.item-name {
font-family: serif;
font-size: 0.9em;
padding-top: 0.1em;
padding-bottom: 0.1em;
display: table-cell;
padding-top: 0em;
padding-bottom: 0em;
display: inline-block;
width: 60%;
}
.item-amount {
font-family: sans-serif;
font-size: 0.9em;
font-weight: bold;
padding-left: 20px;
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=~ s/http\:\/\///g; # don't remove http://
$new_item = $q->param("new_item");
$new_item =~ s/\'/\'\'/g;
$new_item =~ s/\x92/’/g;
$new_labour = $q->param("new_labour");
$new_labour =~ s/\'/\'\'/g;
$new_labour =~ s/\x92/’/g;
$new_resource = $q->param("new_resource");
$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");
$new_item = sanitise($q->param("new_item"));
$new_labour = sanitise($q->param("new_labour"));
$new_resource = sanitise($q->param("new_resource"));
$new_status = sanitise($q->param("new_status"));
$new_lstatus = sanitise($q->param("new_lstatus"));
$new_rstatus = sanitise($q->param("new_rstatus"));
$type = sanitise($q->param("type"));
for ( $i=0; $i<=50; $i+=1) {
$new_status{$i} = $q->param("new_status$i");
$type{$i} = $q->param("type$i");
$new_item{$i} = $q->param("new_item$i");
$new_item{$i} =~ s/\'/\'\'/g;
$new_item{$i} =~ s/\x92/&rsquo;/g;
$new_resource{$i} = $q->param("new_resource$i");
$new_resource{$i} =~ s/\'/\'\'/g;
$new_resource{$i} =~ s/\x92/&rsquo;/g;
$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_status{$i} = sanitise($q->param("new_status$i"));
$type{$i} = sanitise($q->param("type$i"));
$new_item{$i} = sanitise($q->param("new_item$i"));
$new_resource{$i} = sanitise($q->param("new_resource$i"));
$new_labour{$i} = sanitise($q->param("new_labour$i"));
$new_status{$i} = sanitise($q->param("new_status$i"));
$new_lstatus{$i} = sanitise($q->param("new_lstatus$i"));
$new_rstatus{$i} = sanitise($q->param("new_rstatus$i"));
$new_firstname{$i} = $q->param("new_firstname$i");
$new_firstname{$i} =~ s/\'/\'\'/g;
$new_firstname{$i} =~ s/\x92/&rsquo;/g;
$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;
$new_firstname{$i} = sanitise($q->param("new_firstname$i"));
$new_lastname{$i} = sanitise($q->param("new_lastname$i"));
$new_codename{$i} = sanitise($q->param("new_codename$i"));
$cost{$i}=~ s/\€/@euro/g;
$cost{$i} = $q->param("cost$i");
@ -183,10 +165,11 @@ given ($action) {
}
exit;
# saniti[sz]e sql inputs as needed
# saniti[sz]e parameters and sql inputs as needed
sub sanitise {
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;
}
@ -810,8 +793,10 @@ sub compile_budget {
$sthb->execute;
my $recordb = $sthb->fetchrow_hashref;
# page header
&print_header;
# budget header
print <<END;
<div class="header">
<div class="headline-1">
@ -837,8 +822,8 @@ END
</div>
END
# CGI parameter forms
$sthr->execute;
while (my $recordr = $sthr->fetchrow_hashref) {
print<<END;
<FORM ACTION="$script_name"METHOD="GET">
@ -873,13 +858,16 @@ END
END
}
# budget columns
print <<END;
<div id="budget" class="container">
<div id="left" class="column">
<div class="title">FINANCIAL</div>
<div class="subtitle">OUTGOINGS: / money requested or supplied</div>
END
print_title("FINANCIAL");
print_subtitle("OUTGOINGS: / money requested or supplied");
print_subtitle("Labour / paid");
while (my $recordef = $sthef->fetchrow_hashref) {
@ -913,7 +901,7 @@ END
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) {
print_item("", sprintf("&euro;%.2f", $recordf->{amount}));
@ -947,9 +935,10 @@ END
print <<END;
</div>
<div id="right" class="column">
<div class="title">NONFINANCIAL</div>
END
print_title("NONFINANCIAL");
print_subtitle("Human and nonhuman budget contributions: / labour and resources, deployed &amp;/or offfered, latent, awaiting activation");
print_subtitle("Labour / deployed");
@ -984,25 +973,19 @@ END
$sthor->execute;
while (my $record = $sthor->fetchrow_hashref) {
$record->{item} =~ s/^([a-z])/\U$1/; ## capitalise first letter
my $first=$record->{firstname} ;
my $last=$record->{lastname} ;
$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]");
$initials = get_initials($record);
print_item("$record->{item} [$initials]");
}
print(qq(</div></div>));
$dbh->disconnect;
print(qq(</div></div>));
&print_footer;
}
# capitalise the initials of a name from a record
sub get_initials {
$record = shift;
my $first=$record->{firstname} ;
@ -1014,6 +997,7 @@ sub get_initials {
return "$first_init$last_init"
}
############################################################################
# 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
sub print_subtitle {
my $string = shift;
print <<END;
<div class="subtitle">$string</p></div>
<div class="subtitle">$string</div>
END
}
## print a budget subtotal
## print a budget subtotal line with a description and optional amount
sub print_subtotal {
my $string = shift;
@ -1939,7 +1932,7 @@ sub print_subtotal {
END
}
## print standard budget item
## print standard budget item with a description and optional amount
sub print_item {
my $string = shift;
@ -1974,7 +1967,7 @@ END
}
## print the standard footer
## print a standard footer
sub print_footer {
print <<END;