#!/usr/bin/perl
# Copyright 2001-2009 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.
my %lex = ('Group Email' => 'Group Email',
'Grade' => 'Grade',
'Homeroom' => 'Homeroom',
'Main' => 'Main',
'Blank=All' => 'Blank=All',
'Select' => 'Select',
'Values' => 'Values',
'Group' => 'Group',
'Parent 1' => 'Parent 1',
'Parent 2' => 'Parent 2',
'Separate with Spaces' => 'Separate with Spaces',
'Subject' => 'Subject',
'Message' => 'Message',
'Continue' => 'Continue',
'Student' => 'Student',
'Checked' => 'Checked',
'Email Sent' => 'Email Sent',
'Error' => 'Error',
'Email' => 'Email',
'Attach File' => 'Attach File',
'Cannot open file' => 'Cannot open file',
'Maximum File Upload size exceeded!' => 'Maximum File Upload size exceeded!',
);
my $self = 'emailgroup.pl';
# Configured Values
my $maxbufcount = 1000; # 1000K limit
my $mailserver = 'richtech.ca'; # localhost
my $noreplyName = 'OpenAdmin Messaging System';
my $noreplyEmail = 'no-reply@yoursite.net';
use CGI;
use DBI;
use Mail::Sender;
# calc current date
my @tim = localtime(time);
my $year = @tim[5] + 1900;
my $month = @tim[4] + 1;
my $day = @tim[3];
my $currdate = "$year-$month-$day";
eval require "../etc/admin.conf";
if ( $@ ) {
print $lex{Error}. " :$@
\n";
die $lex{Error}. " :$@
\n";
}
my $q = new CGI;
print $q->header( -charset, $charset );
my %arr = $q->Vars;
my $checked = $arr{checked};
delete $arr{checked};
my $dsn = "DBI:$dbtype:dbname=$dbase";
my $dbh = DBI->connect($dsn,$user,$password);
$dbh->{mysql_enable_utf8} = 1;
# Show page Header
print "$doctype\n