You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

98 lines
2.9 KiB

#!/usr/bin/perl
#
# $Id: grpadmin.pl,v 1.6 2006/08/21 20:13:44 psims Exp $
#
# Source File: grpadmin.pl
# Get config
require 'sitecfg.pl';
require 'testlib.pl';
require 'grplib.pl';
&app_initialize;
print "Content-Type: text/html\n\n";
if (&get_session($FORM{'tid'})) {
&LanguageSupportInit();
&log_entry($SESSION{'clid'}, $SESSION{'uid'}, "3", "AD/GM $FORM{'dbop'} $FORM{'grpid'}");
&get_client_profile($SESSION{'clid'});
$isregistrar = &get_a_key("cnd.$SESSION{'clid'}", $SESSION{'uid'}, "registrar");
if ($FORM{'idx'} eq '0') {
# Blank page
#print STDERR "im printing selectpg now\n";
if ($isregistrar eq 'Y') {
&show_template("maintcnd");
} else {
&show_template("selectpg");
}
} elsif ($FORM{'idx'} eq '1') {
&show_template("maintgrp");
} elsif ($FORM{'idx'} eq '2') {
&show_template("grpowners");
} elsif ($FORM{'idx'} eq '3') {
if ($SESSION{'uac'} eq 'cnd') {
$FORM{'grpowner'} = $SESSION{'uid'};
}
&get_candidate_profile($SESSION{'clid'}, $FORM{'grpowner'});
@gbooks = &get_gradebooks_list($SESSION{'clid'}, $FORM{'grpowner'});
$idxgrpid = $GROUPFLDS{'grpid'};
$idxgrpnme = $GROUPFLDS{'grpnme'};
$optline = "";
foreach $gbook (@gbooks) {
chop ($gbook);
@gbdata = split(/&/, $gbook);
$optline = join('', $optline, "<OPTION VALUE=\"$gbdata[$idxgrpid]\">$gbdata[$idxgrpnme]\n");
}
$CANDIDATE{'gradebooks'} = $optline;
&show_template("gradebooks");
} else {
&get_candidate_profile($SESSION{'clid'}, $FORM{'grpowner'});
&get_group_record($SESSION{'clid'}, $FORM{'grpowner'}, $FORM{'grpid'});
if ($SESSION{'uac'} eq 'admin' || $SESSION{'uac'} eq 'madmin') {
$FORM{'pageid'} = "Group";
$FORM{'PAGEID'} = "GROUP";
if ($FORM{'dbop'} eq 'gnew') {
$FORM{'new'} = "Y";
$GROUP{'validfrom'} = &format_date_time("mm-dd-yyyy", 0, 0);
$GROUP{'validto'} = &format_date_time("mm-dd-yyyy", 0, 5184000);
&show_template("grpdefa");
} elsif ($FORM{'dbop'} eq 'gupd') {
$FORM{'new'} = "N";
&show_template("grpdefa");
} elsif ($FORM{'dbop'} eq 'gdel') {
print "<HTML>
<HEAD>
<SCRIPT language=\"JavaScript\">
<!--
function wdw_onLoad() {
parent.gbindex.document.location.reload();
}
// -->
</SCRIPT>
</HEAD>
<BODY onLoad=\"wdw_onLoad()\">\n";
&delete_group($SESSION{'clid'}, $FORM{'grpowner'}, $FORM{'grpid'});
# print STDERR "showing selectpg\n";
&show_template("selectpg");
} else {
&show_illegal_access_warning;
}
} else {
$GROUP{'roster'} = &get_group_roster($SESSION{'clid'}, $GROUP{'grplist'});
$GROUP{'tests'} = &get_group_tests($SESSION{'clid'}, $GROUP{'grpowner'}, 1);
# &get_gradebook($SESSION{'clid'}, $GROUP{'grpowner'}, $GROUP{'grpid'});
$FORM{'pageid'} = "Gradebook";
$FORM{'PAGEID'} = "GRADEBOOK";
if ($FORM{'dbop'} eq 'gupd') {
$FORM{'new'} = "N";
&show_template("grpdefc");
} elsif ($FORM{'dbop'} eq 'gdel') {
&show_template("grpdefc");
} else {
&show_illegal_access_warning;
}
}
}
}