#!/usr/bin/perl
# Copyright 2001-2019 Leslie Richardson
# This file is part of Open Admin for Schools.
# Open Admin for Schools is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
%lex = ('Edit' => 'Edit',
'Main' => 'Main',
'Error' => 'Error',
'School Events' => 'School Events',
'Select Month' => 'Select Month',
'Save' => 'Save',
'Community Events' => 'Community Events',
'Staff Updates' => 'Staff Updates',
'Record Updated' => 'Record Updated',
'Upcoming Events' => 'Upcoming Events',
'Data Updates' => 'Data Updates',
'Resource Spending' => 'Resource Spending',
'Facility Updates' => 'Facility Updates',
'Other Updates' => 'Other Updates',
'Update' => 'Update',
'Other Records' => 'Other Records',
'Land Based Learning' => 'Land Based Learning',
);
my $self = 'event_add.pl';
use CGI;
use DBI;
eval require "../../etc/admin.conf.root";
if ( $@ ) {
print $lex{Error}. ": $@ \n";
die $lex{Error}. ": $@\n";
}
my $q = new CGI;
print $q->header(-charset, $charset );
my %arr = $q->Vars;
my $dbtype = 'mysql';
my $dsn = "DBI:$dbtype:dbname=$dbase";
my $dbh = DBI->connect($dsn,$user,$password);
$dbh->{mysql_enable_utf8} = 1;
# Load Configuration Variables;
my $sth = $dbh->prepare("select id, datavalue from conf_system where filename = 'admin'");
$sth->execute;
if ( $DBI::errstr ) { print $DBI::errstr; die $DBI::errstr; }
while ( my ($id, $datavalue) = $sth->fetchrow ) {
eval $datavalue;
if ( $@ ) {
print "$lex{Error}: $@ \n";
die "$lex{Error}: $@\n";
}
}
# Print Page Header
my $title = "$lex{Edit} $lex{'School Events'}";
print qq{$doctype\n