#!/usr/bin/perl ################################################################ ######################################################## sub valid_cookie{ $flag=0; my $session_file=$companyrepository."/session.txt"; #file where sessions are stored unless(open(INTT, "$session_file")){print "Session not found $session_file. $cookie";} while (){ #find existing cookie if($_=~/^$cookie\;/){#if cookie exist $flag=1; last; } } close INTT; return $flag; } ############################################################################ sub writeData { unless(open (OUT,">>".$companyrepository."/PO.txt")){ open (OUT, ">".$companyrepository."/PO.txt"); } print OUT "$write_data\n"; close (OUT); } ############################################################################ sub readData { if (-e $datafile) { open (IN,"<".$datafile); while () { push @values, $_; } close (IN); } } ############################################################################ use CGI; $query = new CGI; $repository="/home/warp/userdata/"; #$flag2=0; #init flag for existing users ####check for valid cookie#### $cookie=""; @temp=""; $cookie=$ENV{'HTTP_COOKIE'}; #identify cookie @temp_cookie=split(';',$cookie); $cookie=$temp_cookie[0]; ($sess_id,$company,$site,$user)=split('%2C', $cookie); $companyrepository=$repository.$company."/".$site; valid_cookie(); # If cookie not valid, then redirect to login page if ($flag==0){print $query->redirect('http://services.genband.com/cgi-bin/dbq/na/DBQ_welcome.cgi'); }#redirect to another location $answer=$query->param("answer"); print "Content-type: text/html\n\n"; foreach $paramname ($query->param) { $formcomplete=1; #$paramcount++; $paramvalue=$query->param($paramname); $$paramname=$paramvalue; # preserve ratearea names if($paramname =~ /^sub/){ # read in subject chomp $$paramname; $write_data="$${paramname}:::"; }elsif($paramname =~ /^com/){ # read in PO chomp $$paramname; $com=$$paramname; $write_data=$write_data."$$paramname"; }elsif (($paramname eq "answer") && ($answer eq "finish")) { $finished=1; } } # create company specific variables $datafile=$companyrepository."/PO.txt"; $master_file=$companyrepository."/master_grpnum.txt"; ################################ # start html $header_file = "header5.html"; open(FILE,"$header_file"); while() { print $_; } close FILE; print <<'ENDHTML'; Project Overview ENDHTML $datafile="$companyrepository/PO.txt"; if ($finished){ writeData; print ""; print "The Project Overview has been saved. Choose your region to continueNote: Any location other than North America is considered International"; print "North American Database Questionnaire International Database Questionnaire"; }else{ print ""; if (-e $datafile){ } print ""; $cnt=1; foreach $v (@values){ @com=split(/:::/, $v); print "$cnt. $com[0]$com[1]"; $cnt++; } $paramname='txt1'; print "Application (check all that apply)"; $paramname='app'; print " Class 4 - trunk to trunk tandem calls only "; print " Class 5 - station to staion, station to trunk, trunk to staion only "; $paramname='type'; print "Type of Install Greenfield - new switch, no existing customer base per say Cap and Grow - subtend and existing sysytem and provide growth Capacity Migration - replace an existing system "; print " "; print "Network Diagram:"; print "Present the node to be provisioned and show all connections to external nodes. Other SP's, STP's, VMS, Servers or Remote Hosts."; print " "; print "Call Flow Models: "; print "Povide high level and detailed information."; ########################################################################################################### # initial presentation of the page if ((!$formcomplete) && ($error eq "")) { print ""; print ""; print ""; # errors found when processing }elsif((!$formcomplete) && ($error ne "")){ print ""; print ""; print ""; print "cancel$error"; print ""; # form has been completed without errors }elsif ($formcomplete) { print ""; print ""; print ""; } print ""; } print <<'ENDHTML'; ENDHTML $footer_file = "footer1.html"; open(FILE,"$footer_file"); while() { print $_; } close FILE;
Project Overview
"; print "The Project Overview has been saved. Choose your region to continueNote: Any location other than North America is considered International
North American Database Questionnaire International Database Questionnaire
Application (check all that apply)
Class 4 - trunk to trunk tandem calls only
Class 5 - station to staion, station to trunk, trunk to staion only
Type of Install Greenfield - new switch, no existing customer base per say Cap and Grow - subtend and existing sysytem and provide growth Capacity Migration - replace an existing system
Network Diagram:
Present the node to be provisioned and show all connections to external nodes. Other SP's, STP's, VMS, Servers or Remote Hosts.
Call Flow Models:
Povide high level and detailed information.
"; print ""; print "
"; print ""; print ""; print "cancel
$error