#!/usr/bin/perl use DBI; use CGI qw(:standard); # indicates that this program requires CGI module to run,to load it use CGI::Session ( '-ip_match' ); print "Content-type:text/html\n"; # prints the html header for the page based on login print "Pragma: no-cache", "\n\n"; my $cgi=CGI->new(); $sid = param("session_id"); $usr=param("uid"); $lgn=param("login"); if ($lgn == 1){ print $cgi->start_html( -title => "Main Menu", -bgcolor=> "#003399", ); print "

Company






"; print $cgi-> start_form({ ## starts a new form that would call addusr.pl -action => "alterDSDB.pl", -method => "POST", }); &hidden_fields(); print $cgi->hidden( -name => "type", -value => "PDF" ); print $cgi->submit({ -name => "alterDSDB", -value => "Alter PDF", }); print $cgi->end_form(); print "
"; print $cgi-> start_form({ ## starts a new form that would call addusr.pl -action => "alterDSDB.pl", -method => "POST", }); &hidden_fields(); print $cgi->hidden( -name => "type", -value => "ASCII" ); print $cgi->submit({ -name => "alterDSDBA", -value => "Alter ASCII", }); print $cgi->end_form(); print "
"; if ($usr eq "admin"){ #-------------------------------# print $cgi-> start_form({ ## starts a new form that would call addusr.pl -action => "alterDSDBUSR.pl", -method => "POST", }); &hidden_fields(); print $cgi->submit({ -name => "alterDSDBUSR", -value => " Manage Users ", }); print $cgi->end_form(); print "
"; } #-------------------------------# print $cgi-> start_form({ ## starts a new form that would call addusr.pl -action => "logout.pl", -method => "POST", }); &hidden_fields(); print $cgi->submit({ -name => "logoutDSDB", -value => " Logout ", }); print $cgi->end_form(); #-------------------------------# print "



Please wait .Don\'t use the browser\'s buttons to move back and forth.

"; print $cgi->end_html(); } else { print $cgi->start_html( -title => "Main Menu", -bgcolor=> "#003399", ); print "

Company






"; print "

You are not logged in.Session expired.
Log in again


"; $sid = undef; $uid = undef; $lgn = undef; &hidden_fields(); #-------------------------------# print $cgi-> start_form({ ## starts a new form that would call addusr.pl -action => "loginDb.pl", -method => "POST", }); &hidden_fields(); print $cgi->submit({ -name => "Login", -value => "Go to Login Page", }); print $cgi->end_form(); print "



Please wait .Don\'t use the browser\'s buttons to move back and forth.

"; print $cgi->end_html(); } sub hidden_fields(){ print $cgi->hidden( -name => "session_id", -value => $sid ); print $cgi->hidden( -name => "uid", -value => $authuser ); print $cgi->hidden( -name => "login", -value => 1 ); } sub hidden_fields(){ print $cgi->hidden( -name => "session_id", -value => $sid ); print $cgi->hidden( -name => "uid", -value => $authuser ); print $cgi->hidden( -name => "login", -value => 1 ); } #### #!/usr/bin/perl use DBI; use CGI qw(:standard); # indicates that this program requires CGI module to run,to load it use CGI::Session ( '-ip_match' ); print "Content-type:text/html\n"; # prints the html header for the page based on login print "Pragma:no-cache", "\n\n"; #$session = CGI::Session->load(); my $cgi=CGI->new(); #my $lgn=$session->param("user"); #print "user : $lgn\n"; $sid = param("session_id"); $usr=param("uid"); $lgn=param("login"); $type=param("type"); #print "Login :$lgn\t$usr\n"; if ($lgn == 1){ print $cgi->start_html( -title => "Main Menu", -bgcolor=> "#003399", #-cookie=> $cookie ); print "

Company




"; print "$type
"; print $cgi->start_form( -method =>"post", -action =>"doinsertdsdb.pl" ); print $cgi->hidden( -name => "type", -value => $type ); &hidden_fields(); print "
"; print $cgi->submit( -name => "Submit", -value =>"Insert" ); print $cgi->end_form(); print $cgi->start_form( -method =>"post", -action =>"dodeletedsdb.pl" ); print $cgi->hidden( -name => "type", -value => $type ); &hidden_fields(); print "
"; print $cgi->submit( -name => "Submit", -value =>"Delete" ); print $cgi->end_form(); print $cgi->start_form( -method =>"post", -action =>"doupdatedsdb.pl" ); print $cgi->hidden( -name => "type", -value => $type ); &hidden_fields(); print "
"; print $cgi->submit( -name => "Submit", -value =>"Update" ); print $cgi->end_form(); print $cgi->start_form( -method =>"post", -action =>"dsdb_menu.pl" ); print $cgi->hidden( -name => "type", -value => "" ); &hidden_fields(); print "
"; print $cgi->submit( -name => "Submit", -value =>"Back to Main Menu" ); print $cgi->end_form(); print "



Don\'t use the browser\'s buttons to move back and forth.

"; print $cgi->end_html(); } else{ print $cgi->start_html( -title => "Main Menu", -bgcolor=> "#003399", #-cookie=> $cookie ); print "

Company






"; print "

You are not logged in.Session expired.
Log in again


"; $sid = undef; $uid = undef; $lgn = undef; &hidden_fields(); #-------------------------------# print $cgi-> start_form({ ## starts a new form that would call addusr.pl -action => "loginDb.pl", -method => "POST", }); &hidden_fields(); print $cgi->submit({ -name => "Login", -value => "Go to Login Page", }); print $cgi->end_form(); print "



Please wait .Don\'t use the browser\'s buttons to move back and forth.

"; print $cgi->end_html(); } sub hidden_fields(){ print $cgi->hidden( -name => "session_id", -value => $sid ); print $cgi->hidden( -name => "uid", -value => $authuser ); print $cgi->hidden( -name => "login", -value => 1 ); }