#!/usr/bin/perl -T
use Mysql;
use CGI qw(:escapeHTML);
$| = 1;
use DBI;
print "Content-type: text/html\n\n";
print "before db";
&require_supporting_libraries (__FILE__, __LINE__,
"mercurytrip.setup.db");
print "after db";
&require_supporting_libraries (__FILE__, __LINE__,
"$sc_cgi_lib_path",
"$sc_html_setup_file_path",
"$sc_mail_lib_path");
# $conn = Pg::connectdb("dbname=mercurytrip user=postgres");
#$conn = Pg::connectdb("dbname=mercurytrip user=mercury password=coral123");
&read_and_parse_form_data;
$page = $form_data{'page'};
$page =~ /([\w\-\=\+\/]+)\.(\w+)/;
$page = "$1.$2";
$page = "" if ($page eq ".");
$page =~ s/^\/+//; # Get rid of any residual / prefix
$oldPATH = $ENV{"PATH"};
$ENV{"PATH"} = "/bin:/usr/bin:/usr/ucb";
$toDate = trim(`date '+%l:%M %p %Z, %a %b %e'`);
$ENV{"PATH"} = $oldPATH;
&error_check_form_data;
&security_test; # Sundeep, Test to see if someone else is not using your
# server to post their form.
if ($form_data{'getFaresQuote'} ne "")
{
&process_get_fares_quotes;
exit;
}
elsif ($form_data{'submit_feedback_button'} ne "")
{
&process_feedback_form;
exit;
}
elsif ($form_data{'invite'} ne "")
{
&require_supporting_libraries (__FILE__, __LINE__,
"$location_of_cgi_sol",
"$sc_html_setup_file_path");
&process_tell_friend;
exit;
}
else
{
&output_frontpage;
exit;
}
sub process_get_fares_quotes
{
@form_variables = split (/\|/, $form_data{'variable_order'});
@required_variables = split (/\|/, $form_data{'required_variables'});
local($req_var) = "";
foreach $variable (@required_variables)
{
if ($form_data{$variable} eq "") {
$req_var = $req_var . "$variable
";
}
} # End of foreach $variable (@required_variables)
if ($req_var ne "") {
$sc_error_msg = "Please fill in all the details to better assist you";
&output_frontpage;
} else {
local($emailid) = $form_data{'emailAddr'};
local($d2) = $form_data{'contactName'};
local($d3) = $form_data{'emailAddr'};
local($d4) = $form_data{'phoneNumber'};
local($d5) = $form_data{'de_month'};
local($d6) = $form_data{'de_day'};
local($d7) = $form_data{'re_month'};
local($d8) = $form_data{'re_day'};
local($d9) = $form_data{'fromCity'};
local($d10) = $form_data{'toCity'};
local($d11) = $form_data{'airlines'};
local($d12) = $form_data{'agent'};
local($d13) = $form_data{'pcode'};
local($d14) = $form_data{'otherDetails'};
local($dbh) = DBI->connect("dbi:mysql:mercurytrip","mercury","coral123") or die("Couldn't connect");
local($sth) = $dbh->prepare("insert into emaillist(emailid,dateofrequest,source,destination,smonth,sdate,emonth,edate,contactname,contactnumber,agentname,prefairline,faretobeat,notes) VALUES ('$emailid','$toDate','$d9','$d10','$d5','$d6','$d7','$d8','$d2','$d4','$d12','$d11','$d13','$d14')") or die("Couldn't prepare");
$sth->execute();
$sth->errstr();
$sth->finish;
local($isCanada) = $form_data{'isCanada'};
$sc_success_msg = " Thank you for your inquiry. We truly appreciate your business, a travel consultant will contact you shortly.";
$email_body = "This data was submitted on:";
$email_body .= $toDate;
$email_body .=" requestid: $requestid \n\n";
$email_body .="Dear Travel Consultant,\n\n";
$email_body .="Here is a request for travel tickets. Please let the client know the lowest possible fares for the dates of travel.\n\n";
$email_body .="Contact Name: $form_data{'contactName'}\n";
$email_body .="E-mail Address: $form_data{'emailAddr'}\n";
$email_body .="Contact Phone: $form_data{'phoneNumber'}\n";
$email_body .="Travel Dates: $form_data{'de_month'} $form_data{'de_day'} - $form_data{'re_month'} $form_data{'re_day'}\n";
$email_body .= "From City - To City: $form_data{'fromCity'} - $form_data{'toCity'}\n";
$email_body .= " Canada Origin: $isCanada\n";
$email_body .= "Preferred Airlines: $form_data{'airlines'}\n";
$email_body .= "Preferred agent: $form_data{'agent'}\n";
$email_body .= "Price to Beat: $form_data{'pcode'}\n";
$email_body .= "Special Request : $form_data{'otherDetails'}\n\n";
$email_body .= "Thank You.\n\n";
$email_body .= "Regards,\nYour Web Service";
# For every form variable, we should add the variable name and their
# values in the order specified by $form_data{'variable_order'}.
# foreach $variable (@form_variables)
# {
# $email_body .= "$variable = $form_data{$variable}\n";
# }
&output_frontpage;
# print "isCanada=$isCanada";
local($a_email) = $sc_travel_admin_email;
local($subject) = "Travel on $form_data{'de_month'} $form_data{'de_day'} from $form_data{'fromCity'} to $form_data{'toCity'} for $form_data{'contactName'}";
&send_mail("$sc_admin_email","efarequote\@mercurytrip.com","$subject", "$email_body");
&send_mail("$sc_admin_email","travel\@mercurytrip.com","$subject", "$email_body");
$a_email = $form_data{'emailAddr'};
$email_body = "This data was submitted on: ";
$email_body .= $toDate;
$email_body .="\n\n";
$email_body .="Dear Valued Customer,\n\n";
$email_body .="Here is a request we have received for your travel tickets. We appreciate your interest in our services. We are working on your request and one of our travel agents will reply back to you soon. \nIf you have already recived the quotes over the phone , below is the request along with the agent's name and our contact details. Please feel free to contact us if you have any further questions.\n\n";
$email_body .="Contact Name: $form_data{'contactName'}\n";
$email_body .="E-mail Address: $form_data{'emailAddr'}\n";
$email_body .="Contact Phone: $form_data{'phoneNumber'}\n";
$email_body .="Travel Dates: $form_data{'de_month'} $form_data{'de_day'} - $form_data{'re_month'} $form_data{'re_day'}\n";
$email_body .= "From City - To City: $form_data{'fromCity'} - $form_data{'toCity'}\n";
$email_body .= " Canada Origin: $isCanada\n";
$email_body .= "Preferred Airlines: $form_data{'airlines'}\n";
$email_body .= "Preferred agent: $form_data{'agent'}\n";
$email_body .= "Price to Beat: $form_data{'pcode'}\n";
$email_body .= "Special Request = $form_data{'otherDetails'}\n\n";
$email_body .= "*************\n";
$email_body .= "Book Online at http://www.mercurytrip.com/online/Search.htm \n";
$email_body .= "*************\n";
$email_body .= "Quick Getaway TOURS in India at http://www.mercurytrip.com/Tours.html \n";
$email_body .= "*************\n\n";
$email_body .= "WE WILL GET YOU THE BEST DEAL. \nWE STRIVE FOR BEST CUSTOMER SERVICE IN INTERNATIONAL TRAVEL PLANNING \n";
$email_body .= "http://www.mercurytrip.com \n";
$email_body .= "510 573 5053 OR 408 432 TRIP(8747) OR 510 573 5053 \n";
$email_body .= "Regards,\nMercuryTrip.com eService";
local($agent_email) = $form_data{'agent'};
&send_mail("eFareQuote\@mercurytrip.com","$a_email","MercuryTrip Your Request for Lowest Fare Quote", "$email_body");
if ($agent_email ne "") {
$agent_email .= "\@mercurytrip.com";
$subject = "PHONE REQUEST ";
$subject .= $form_data{'contactName'};
&send_mail("$sc_admin_email","$agent_email","$subject", "$email_body");}
}
}
sub output_frontpage
{
&display_page("Output Frontpage", __FILE__, __LINE__);
}
sub display_page
{
local ($routine, $file, $line) = @_;
# print "$page, $page_num ";
if ($page eq "")
{
$page = "home.html";
}
$subname = $sc_display_page{"$page"};
&display_mercury_begin_page($page);
# print "$subname";
&$subname;
&display_mercury_end_page;
}
sub display_mercury_begin_page
{
local($page) = @_;
print qq~
|
MercuryTrip
Speak to our consultants |
|
| ~; &display_halfprice_promotion; print qq~ |
|
| Boston-Kolkata-Boston for | USD 590 + taxes | Richmond-Chennai-Richmond for | USD 460 + taxes |
| New York-Delhi-New York for | USD 370 + taxes |
| Washington-Kolkata-Washington for | USD 530 + taxes |
| Detroit-Mumbai-Detroit for | USD 590 + taxes |
| Chicago -Bangalore-Chicago for |
USD 560 + taxes |
| Los Angeles-Bangalore-Los Angeles for |
USD 760 + taxes |
| Atlanta-Bangalore-Atlanta for |
USD 590 + taxes |
| Albany-Ahmedabad-Albany for |
USD 470 + taxes |
| Philadelphia-Chennai-Philadelphia for |
USD 599 + taxes |
| San Francisco-Delhi-San Francisco for |
USD 720 + taxes |
| Middle East |
USD 720 + taxes |
| Atlanta | Austin | Bay Area |
| Boston | Chicago | Dallas |
| Denver | Houston | Los Angeles |
| Miami | New York | Philielphia |
| Raleigh | SFO | Seattle |
| Washington |
| Delhi | Mumbai | Bangalore |
| Delhi | Chennai | Calcutta |
| ~; &display_halfprice_promotion; print qq~ |
JOBS AT MERCURY TRIP If you reside in the Bay area, come and join us Travel Agent Position : Exciting job opportunity with excellent Pay. Professional work environment. We will train you and help you get started. Office Manager Position : Manage the day to day to operations of the office. Exciting job opportunity with excellent Pay. Should have experience working in the travel industry for atleast 2 years. We will train you and help you get started. Volunteer for Website development: Working knowledge of cgi perl and databases . Email your resume to travel\@mercurytrip.com |
| ~; &display_halfprice_promotion; print qq~ |
$sc_page_header_font_begin Privacy Policy $sc_page_header_font_end $sc_medium_font_begin Mercury Trip respects privacy of our customers. We guarantee that individual personal information, such as but not limited to, email address, name, birth dates, personal interests or suggestions will not be sold or shared with anyone. Mercury Trip will not gather any personal information unless it is knowingly given by you. The given personal information will not be used in ways to which you have not consented. Mercury Trip will send you promotional travel and tours offers. In a case when you do not wish to receive promotional emails than simply send email to, webmaster\@mercurytrip.com and type 'unsubscribe' in subject line. $sc_medium_font_end |
|
| ~; &display_halfprice_promotion; print qq~ |
$sc_page_header_font_begin About MercuryTrip $sc_page_header_font_end $sc_medium_font_begin Mercury Trip was founded to meet the demands of rapidly increasing travel needs. Our goal is to provide courteous services with quick turnaround time, make your travel selections a pleasant experience and become your travel partner for ever. We have special consolidated rates to major destinations in Sout east Asia, India , China , Europe and all major destinations in the world. We have offices in The US, canada and India and can provide competitive rates for your journey starting from these countries Mercury Trip has relationships with most of the major airlines in the world and we are committed to provide you with the best fares available for your favorite destinations.
Mercury Trip is a preferred travel services vendor with many bay area business
For more information on our corporate program please contact us $sc_medium_font_end |
| ~; &display_halfprice_promotion; print qq~ |
$sc_page_header_font_begin Terms $sc_page_header_font_end $sc_medium_font_begin Mercury Trip reserves the rights to refuse service to any customer without prior notification. Verification of information may be required prior to the acceptance of any purchases. All the information provided on this Web site including but not limited to, text, graphics and links are provided on an 'AS IS' basis with no warranty. Travel bookings are done by Mercury Trip travel consultants are valid but are subject to names being correct. Please review your itineraries, either printed or e-mailed to you, check the names, spellings of each passenger, times and dates of travel, etc. Please verify flight times before departure. All the fares and related taxes are subject to change until ticketed. Although your tickets and seats are confirmed, schedule changes by the airline, weather patterns and other acts of God may change your travel times; therefore, it is highly recommended that you re-confirm with the airline directly 72 hours prior to the departure date. Although we do our best to accommodate any special requests, please re-confirm with the airline about special arrangements like special meals, wheelchair, etc.
The Best Fares are intended to be an indicator of the lowest fares
published by the airlines. Fares may not be available on all flights,
are subject to availability, and are subject to change without notice.
Other restrictions may apply. Remember, the lowest fares are usually sold
in limited quantities, so book quickly. Mercury Trip does not warrant or
guarantee that the fares shown are the lowest fares available. Mercury Trip reserves the rights to modify these Terms of Use. You may not want to use this Web site or services provided by travel consultants, if you do not agree with these Terms of Use. $sc_medium_font_end |
| ~; &display_halfprice_promotion; print qq~ |
|
| $sc_page_header_font_begin Link To Us $sc_page_header_font_end | |
| $sc_medium_font_begin Link to Mercury Trip, one of the largest provider of Travel related services to India, China, Europe and other destinations of the world. Use the following graphics logo and HTML snippet and include that in your web page. $sc_medium_font_end | |
| |
|
$sc_medium_font_begin
Use the following snippet to include in your web page. Replace the
appropriate '.gif' filename with the one you have selected.
$sc_medium_font_end
<a href="http://www.mercurytrip.com/">
<img src="http://www.mercurytrip.com/html/images/mercurytrip_ad.gif"
width="180" height="90" alt="Mercury Trip" border="0"></a>
|
| ~; &display_halfprice_promotion; print qq~ |
|
|
| Please provide the required values. The request cannot be processed without this information |
|
| ||||
~ } } sub display_notice { if ($sc_success_msg eq "" && $sc_error_msg eq "") { print qq~
|
~ } } sub display_halfprice_promotion { print qq~
| Useful Travel Info. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| IMPORTANT Travel Information |
|
We are consolidators for most major airlines including AIR INDIA EMIRATES AIRLINES JET AIRWAYS KOREAN AIRWAYS SINGAPORE AIRLINES KINGFISHER |
|
Mercury Trip - Travel Agency with best air fares. Mercury Trip is based in San Jose, the heart of Bay Area. The agency strives hard to get cheap tickets for our customers traveling to India China Middle East Europe Australia. Travel to India like a Maharaja and leave the flight arrangements with Mercury Trip. Corporate and business travel made easy with cheap tickets and 24X7 support. We can book hotels flights and short tours to any place in India with the best rates available. |
Cheapest Airline Tickets
Cheap Airline Tickets to India
Cheap Airline Tickets to Bombay
Discount Air travel to India
Airfares to India
Cheap Airline Tickets to Hyderabad
Travel to India
Cheap Airfares to Madras
Discount International Airfares
Cheap flights to India
Cheap Airline tickets to Dubai
Discount Travel
Home |
About Us |
Contact Us |
Privacy Policy |
Terms of Use |
WE ARE HIRING
Address : 1901 O'Toole Way, San Jose, CA 95131 Near San Jose Airport ph: 408 432 8747
Address : Mercury Air Trip Pvt. Ltd Plot No 917, Tulsi Tower, Shop No 1, Near DLF Phase 4, Gurgaon-122002, Haryana ph: 99-99-012-123
Copyright © 2005 Mercury TripTM. All rights reserved.
MercuryTrip logo is a trademark of Mercury TripTM
in the U.S. and other countries.
Mercury Trip is Registered with State of California as a Seller of Travel.
Mercury Trip is IATAN certified.
Mercury Trip is ARC accredited.
~;
}
sub require_supporting_libraries
{
print "require_supporting_libraries";
# The incoming file and line arguments are split into
# the local variables $file and $line while the file list
# is assigned to the local list array @require_files.
#
# $require_file which will just be a temporary holder
# variable for our foreach processing is also defined as a
# local variable.
local ($file, $line, @require_files) = @_;
local ($require_file);
print "require_supporting_libraries end1";
# Next, the script checks to see if every file in the
# @require_files list array exists (-e) and is readable by
# it (-r). If so, the script goes ahead and requires it.
local $i =0
print "Start $i";
foreach $require_file (@require_files)
{
print "$i test"; i++;
}
foreach $require_file (@require_files)
{
if (-e "$require_file" && -r "$require_file")
{
require "$require_file";
}
# If not, the scripts sends back an error message that
# will help the admin isolate the problem with the script.
else
{
print "I am sorry but I was unable to require $require_file at line
$line in $file. Would you please make sure that you have the
path correct and that the permissions are set so that I have
read access? Thank you.";
exit;
}
} # End of foreach $require_file (@require_files)
print "require_supporting_libraries end2";
} # End of sub require_supporting_libraries
sub read_and_parse_form_data
{
&ReadParse(*form_data);
}
sub error_check_form_data
{
foreach $file_extension (@acceptable_file_extensions_to_display)
{
if ($page =~ /$file_extension/ || $page eq "")
{
$valid_extension = "yes";
}
}
if ($valid_extension ne "yes")
{
print "$sc_page_load_security_warning";
&update_error_log("PAGE LOAD WARNING", __FILE__, __LINE__);
exit;
}
}
sub update_error_log
{
local ($type_of_error, $file_name, $line_number) = @_;
local ($log_entry, $email_body, $variable, @env_vars);
# The list of the HTTP environment variables are culled
# into the @env_vars list array and get_date is used to
# assign the current date to $date
@env_vars = keys(%ENV);
$date = &get_date;
# Now, if the admin has instructed the script to log
# errors by setting $sc_shall_i_log_errors in
# web_store.setup, the script will create an error log
# entry.
if ($sc_shall_i_log_errors eq "yes")
{
# First, the new log entry row is created as a pipe
# delimited list beginning with the error type, filename,
# line number and current date.
$log_entry = "$type_of_error\|FILE=$file_name\|LINE=$line_number\|";
$log_entry .= "DATE=$date\|";
# Then the error log file is opened securely by using the
# lock file routines in get_file_lock discussed later.
&get_file_lock("$sc_error_log_path.lockfile");
open (ERROR_LOG, ">>$sc_error_log_path") || &CgiDie ("The Error Log
could not be opened");
# Now, the script adds to the log entry row, the values
# associated with all of the HTTP environment variables
# and prints the whole row to the log file which it then
# closes and opens for use by other instances of this
# script by removing the lock file.
foreach $variable (@env_vars)
{
$log_entry .= "$ENV{$variable}\|";
}
print ERROR_LOG "$log_entry\n";
close (ERROR_LOG);
&release_file_lock("$sc_error_log_path.lockfile");
} # End of if ($sc_shall_i_log_errors eq "yes")
# Next, the script checks to see if the admin has
# instructed it to also send an email error notification
# to the admin by setting the $sc_shall_i_email_if_error
# in web_store.setup.
#
# If so, it prepares an email with the same info contained
# in the log file row and mails it to the admin using the
# send_mail routine in mail-lib.pl. Note that a common
# source of email errors lies in the admin not setting the
# correct path for sendmail in mail-lib.pl on line 42.
# Make sure that you set this variable there if you are
# not receiving your mail and you are using the sendmail
# version of the mail-lib package.
if ($sc_shall_i_email_if_error eq "yes")
{
$email_body = "$type_of_error\n\n";
$email_body .= "FILE = $file_name\n";
$email_body .= "LINE = $line_number\n";
$email_body .= "DATE=$date\|";
foreach $variable (@env_vars)
{
$email_body .= "$variable = $ENV{$variable}\n";
}
&send_mail("$sc_admin_email", "travel\@mercurytrip.com", "Web Store Error",
"$email_body");
} # End of if ($sc_shall_i_email_if_error eq "yes")
}
sub get_date
{
# The subroutine begins by defining some local working
# variables
local ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst,$date);
local (@days, @months);
@days = ('Sunday','Monday','Tuesday','Wednesday','Thursday',
'Friday','Saturday');
@months = ('January','February','March','April','May','June','July',
'August','September','October','November','December');
# Next, it uses the localtime command to get the current
# time, from the value returned by the time
# command, splitting it into variables.
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
# Then the script formats the variables and assign them to
# the final $date variable. Note that $sc_current_century
# is defined in web_store.setup. Since the 20th century
# is really 1900-1999, we'll need to subtract 1 from this
# value in order to format the year correctly.
if ($hour < 10)
{
$hour = "0$hour";
}
if ($min < 10)
{
$min = "0$min";
}
if ($sec < 10)
{ $sec = "0$sec";
}
$year = ($sc_current_century-1) . "$year";
$date = "$days[$wday], $months[$mon] $mday, $year at $hour\:$min\:$sec";
return $date;
}
sub get_file_lock
{
local ($lock_file) = @_;
local ($endtime);
$endtime = 20;
$endtime = time + $endtime;
# We set endtime to wait 20 seconds. If the lockfile has
# not been removed by then, there must be some other
# problem with the file system. Perhaps an instance of
# the script crashed and never could delete the lock file.
while (-e $lock_file && time < $endtime)
{
sleep(1);
}
open(LOCK_FILE, ">$lock_file") || &CgiDie ("I could not open the lock
file: $lock_file");
# Note: If flock is available on your system, feel free to
# use it. flock is an even safer method of locking your
# file because it locks it at the system level. The above
# routine is "pretty good" and it will server for most
# systems. But if you are lucky enough to have a server
# with flock routines built in, go ahead and uncomment
# the next line and comment the one above.
# flock(LOCK_FILE, 2); # 2 exclusively locks the file
}
sub release_file_lock
{
local ($lock_file) = @_;
# flock(LOCK_FILE, 8); # 8 unlocks the file
# As we mentioned in the discussion of get_file_lock,
# flock is a superior file locking system. If your system
# has it, go ahead and use it instead of the hand rolled
# version here. Uncomment the above line and comment the
# two that follow.
close(LOCK_FILE);
unlink($lock_file);
}
sub security_test {
# Next let's figure out where the form that is requesting our attention
# is located. We'll do this by accessing the environment variable
# $ENV{'HTTP_REFERER'} which is equal to the url of the form in question
# (ie: http://www.foobar.com/Feedback/feedback.html). We are going to take
# that value and split it up into separate variables for every occurance of
# "/". We do this in order to isolate www.foobar.com which we can compare
# to the value of $your_server_name. Thus $referring_server is the
# only varriable here we actually give a hoot about. If they are
# not the same, the script # is being accessed by a form on another server.
($http, $empty, $referring_server, @path) = split (/\//, $ENV{'REFERER'});
# Now if the $restricted_use has been set to yes, "and" the
# $referring_server is not the same as $your_server_name it means that we
# have had an illegal attempted access and we will deny the use of this
# script.
if ($restricted_use eq "yes")
{
if ($referring_server ne "$your_server_name")
{
# &html_header("Form Error - Wrong Server");
&display_mercury_begin_page;
print "I'm sorry, you are not allowed to use this form processing
script from a server other than $your_server_name
"; print "As far as I can tell, you are coming from: $referring_server"; print "
$restricted_use = restricted use
";
&display_mercury_end_page;
#print "