#!/usr/bin/perl # Copyright 2001-2007 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 = ('Delete Subject Enrollment' => 'Delete Subject Enrollment', 'Main' => 'Main', 'Report Card' => 'Report Card', 'No Student Found' => 'No Student Found', 'Edit/Delete Subject Enrollments' => 'Edit/Delete Subject Enrollments', ); use CGI; use DBI; require "../../etc/admin.conf" or die "Cannot open admin.conf!"; my $q = new CGI; print $q->header; my %arr = $q->Vars; my $dsn = "DBI:$dbtype:dbname=$dbase"; my $dbh = DBI->connect($dsn,$user,$password); my $sth = $dbh->prepare("select * from eval where id = ?"); $sth->execute( $arr{id} ); my @arr = $sth->fetchrow; # Lookup Student Name $sth = $dbh->prepare("select lastname,firstname from studentall where studnum = ?"); $sth->execute( $arr[2] ); if ($DBI::errstr){ print $DBI::errstr; die $DBI::errstr; } my ($lastname,$firstname) = $sth->fetchrow; if (not $lastname) { $lastname = "". $lex{'No Student Found'}. ""; } print "$doctype\n". $lex{'Delete Subject Enrollment'}; print "\n"; print "$chartype\n\n"; print "[ ". $lex{Main}. " |\n"; print "". $lex{'Report Card'}. " |\n"; print "". $lex{'Edit/Delete Subject Enrollments'}. "\n"; print " ]\n"; print "

". $lex{'Delete Subject Enrollment'}. "

\n"; print "
$firstname $lastname
\n"; print "
Course Code: $arr[1]
Reporting Period: $arr[4]
Program: $arr[5]
Comment: $arr[6]
Mark: $arr[7]
$arr[8]
$arr[9]
$arr[10]

Are you sure you want to delete this record?

\n"; #--------------- sub deleteRecord { #--------------- }