#!/usr/bin/perl
sub said
{
#&said("comment here");
local($error_content) = @_ ;
print "content-type: text/html \n\n";
print "
Information => $error_content \n\n
";
exit;
}
#require "$ENV{'DOCUMENT_ROOT'}/vm_standard_library/cgi_lib.pl";
require "../cgi_lib.pl";
$mybaseurl = &MyBaseUrl();
$referer = $ENV{'HTTP_REFERER'};
&ReadParse(*in);
if ($in{searchPostal}||$in{searchStreet}) {
$in{range} = ($in{range})?$in{range}:5;
}
if ($in{SERVICES_ID} eq "undefined") {
$in{SERVICES_ID}==8;
}
if (!$in{SERVICES_ID}) {
$SERVICES_IDNOT = 1 ;
}
if (!$in{CRITERIA_ID}) {
$in{CRITERIA_ID} = 'all' ;
}
elsif($in{CRITERIA_ID} eq 'null') {
$in{CRITERIA_ID} = 'all' ;
}
#add by akhyar to escape sql variable
elsif($in{CRITERIA_ID} =~ /,/){
use DBI();
$dbh = DBI->connect("DBI:mysql:database=mcds_new","root");
my @temp_data = split(',', $in{CRITERIA_ID});
foreach my $val (@temp_data)
{
$arr_data .= $dbh->quote($val).",";
}
#my $count = $#temp_data + 1;
my $count = length($arr_data);
$in{CRITERIA_ID} = substr($arr_data, 0, ($count - 1));
}
if ($in{searchProgType} eq "Select Programme Type") {
$in{searchProgType}="";
}
if ($in{searchSvcSector} eq "Select Service Sector") {
$in{searchSvcSector}="";
}
&dispatch();
sub dispatch {
print<Ministry of Community Development, Youth and Sports
EOHTML
print<
EOHTML
###### DISPATCH HERE #######
if ($SERVICES_IDNOT==1) {
print "Please Define Service Name
";
} else {
if ( $in{index} || $in{zone} || $in{searchName} || $in{searchPostal} || $in{searchNo} || $in{searchStreet} || $in{streetname} || $in{CRITERIA_ID} || $in{CENTRE_ID} || $in{Centre_Id}) {
if ($in{index}) {
if ($in{index} == 7) {
&drawmap() ;
}
if ($in{index} == 22) {
¢recode() ;
}
if ($in{index} == 8) {
&nearby_amenity_finded() ;
}
}else{
if ($in{searchName}) {
&search_by_name() ;
} elsif ($in{searchPostal}) {
&postalcode_search();
} elsif ($in{searchNo} || $in{searchStreet}) {
&search_streetname() ;
} elsif ($in{streetname}) {
if (($in{SERVICES_ID}==8) || ($in{SERVICES_ID}==7)||($in{SERVICES_ID}==4)||($in{SERVICES_ID}==9)) {
&search_nearby_street_directory() ;
}else{
&search_nearby_street() ;
}
} elsif ($in{CENTRE_ID}) {
&getMapById() ;
} elsif ($in{zone} || $in{Centre_Id}) {
$in{zone} = uc($in{zone});
if ($in{SERVICES_ID}==2) {
$in{fsczone}=$in{zone};
&searchzonefsc() ;
} else {
&findnearregion() ;
}
##Return Back all variebles with no address input
}elsif(((!$in{searchStreet})||(!$in{searchPostal}))&&(($in{SERVICES_ID}==2)||($in{SERVICES_ID}==4))){
&search_for_services();
################Search by VWO without street and postal##########
}elsif((($in{SERVICES_ID}==7)&&(!$in{zone}))||(($in{SERVICES_ID}==7)&&(!$in{searchPostalcode}))||(($in{SERVICES_ID}==7)&&(!$in{searchNo}))){
&search_VWO();
###############################################################
}
}
}
}
###### DISPATCH HERE #######
print<