#!/srvtools/http/bin/perl
#  Falke Bruinsma (falke@innersource.com)
#  Inner Source Computer Services, Inc. (http://www.innersource.com)
#

require "../../cgiconf.pl";  # Contains the server variables

# URL for Student Center home directory
$home = "$ENV{'INFOMALL_URL'}";

#Directories that are writable by the server
$rw = "$ENV{'INFOMALL_DOCROOT_RW'}";
$tmp = "$ENV{'INFOMALL_TEMP'}";

$rw = "$rw/studentcenter";

$student_file = "$rw/homepages/students.db";
$submit_file = "$rw/homepages/submitted.db";
$temp_file = "$tmp/tmp\$\$";
$user = 'falke\@tulip.innersource.com';

$ErrorMessage = "<B>Error saving your submission<BR>Please notify the system administrator of this message.</B>";
$notify = 1;

$LASTNAME = 0;
$FIRSTNAME = 1;
$URL = 2;
$TITLE = 3;
$EMAIL = 4;
$DOB = 5;
$SEX = 6;
$STATE = 7;
$INFO = 8;

$E_LASTNAME = "*lastname*";
$E_FIRSTNAME = "*firstname*";
$E_URL = "*url*";
$E_TITLE = "*title*";
$E_EMAIL = "*email*";
$E_DOB = "*dob*";
$E_SEX = "*sex*";
$E_STATE = "*state*";
$E_INFO = "*info*";
sub PrintRecord {
  $lines = @_;
      if ($lines[$LASTNAME] ne $E_LASTNAME) { printf("$lines[$LASTNAME], "); }
      if ($lines[$FIRSTNAME] ne $E_FIRSTNAME) { printf("$lines[$FIRSTNAME] - "); }
      if ($lines[$URL] ne $E_URL) {
        printf("<A HREF=\"$lines[$URL]\">$lines[$TITLE]</A> - ");
      }
      if ($lines[$EMAIL] ne $E_EMAIL) {
        printf("<A HREF=\"mailto:$lines[$EMAIL]\">$lines[$EMAIL]</A> - ");
      }
      if ($lines[$DOB] ne $E_DOB) {
        printf("$lines[$DOB] - ");
      }
      if ($lines[$SEX] ne $E_SEX) {
        printf("$lines[$SEX] - ");
      }
      if ($lines[$STATE] ne $E_STATE) {
        printf("$lines[$STATE] - ");
      }
      print "<BR><I>";
      for ($i = $INFO; $i < @lines; $i++) {
        if ($lines[$i] ne $E_INFO) { print "$lines[$i]<BR>"; }
      }
      print "</I>";
}
