#!/usr/bin/perl
require 'cgi-libs.pl';
&ReadParse;
# DB Manager 5.01 Database Setup File Creator
# Developed by Jeremy Schell, Global Marketing Concepts, Inc.
# Visit http://www.thoseinternetguys.com/createdb.html for HTML form
# E-mail jeremy@thatinternetguy.com for additional information
print "HTTP/1.0 200 OK\n\n";
$in{'db'} =~ s/ //g;
@lines = $in{'db'};
$in{'sortby'} =~ s/ //g;
$in{'email'} =~ s/ //g;
chop(@line);
$x=0;
$main="";
$sortby="UNKNOWN";
$email="UNKNOWN";
foreach $lines (@line) {
chop($lines);
$lines =~ s/ //g;
$lines =~ s/\n//g;
$main .= "\$db{\"$lines\"}=$x;
";
if ($lines eq "$in{'sortby'}") { $sortby=$x; }
if ($lines eq "$in{'email'}") { $email=$x; }
$x=$x+1;
}
$main .= "\$db{\"modification_time\"}=$x;
";
$x=$x+1;
if ($in{'admin'} eq "Yes") {
$main .= "\$db{\"who_modified\"}=$x;
";
$x=$x+1;
$main .= "\$db{\"group_modified\"}=$x;
";
$x=$x+1;
}
$main .= "\$db{\"db_id\"}=$x;
";
$main .= "
\$index_of_db_id_number=$x;
";
$x=$x-1;
if ($in{'admin'} eq "Yes") {
$main .= "\$index_of_group_who_modified=$x;
";
$x=$x-1;
$main .= "\$index_of_who_modified=$x;
";
$x=$x-1;
}
$main .= "\$index_of_modification_time=$x;
";
$x=$x-1;
$main .= "\$index_for_email=\"$email\";
\n";
$main .= "\$index_of_field_to_be_sorted_by=\"$sortby\";
\n";
print "$main";
$newline="\@db_user_definable_field_order = (\n";
foreach $lines (@line) {
$lines =~ s/ //g;
$lines =~ s/\n//g;
$newline .= "\"$lines\", ";
}
chop($newline);
chop($newline);
$newline .= ");";
print "
$newline";
exit;