PROPERTIES FOR SALE
If you wish to sell your property with us, we will help to
sell your property at no cost, to you the seller. If you want
to advertise your property you wish to sell with us for free,
please contact us on info@bulgarianaccommodation.com.
ADVERTISING ONLY PACKAGE
1) Advertising on our
website, www.bulgarianaccommodation.com. We have an ongoing
advertising and marketing campaign.
2) You
will have online updating of availability and property information
via the Bulgarian Accommodation website. Payments and enquiries
will be made direct to you, the owner.
3) Access
to online transfers, excursions and ski packages via the Bulgarian
Accommodation website, with discounts for all property owners.
Advertising Only Package Prices:
First 3 Months - FREE
Per Property Per Week (regardless of size) - £4
If you want information and prices for our Full Management
and Advertising Packages, Management only packages and Furnishing
packages, please have a look in the Property
Management Page on our website.
If you are interested in any of the above packages please
contact
#!/usr/bin/perl
#
use CGI;
$query = new CGI;
#STEP A================================
#A1. The following lines get and process data passed
#through the URL, do not modify
$stringpassed=$ENV{'QUERY_STRING'};
#A2. Replace all plusses with spaces for data passed via URL
$stringpassed=~s/\+/ /g;
#STEP B================================
#You MUST modify each of the variables in this this section
#B1. REQUIRED: The location of the data file on your server. This must
#be the PATH to your data file, not the URL of your data file! There
#is extensive treatment of this in the Help Pages, under Data File
#Errors: http://flattext.com/help/
$data="datafiles/links.txt";
#B2. REQUIRED: The URL of this script file in your cgi-bin directory.
#You can provide the full URL, beginning with http:// (or, you can
#simply use the filename, i.e. "database.cgi")
$thisurl="links.cgi";
#B3. OPTIONAL: You can format the opening and closing HTML
#of your results page in a separate file that can be written in
#regular HTML and saved on your server. If your script can't
#find this file and open it, the default result screen is displayed
#instead. For ease of configuration, place it in the same directory
#as your data file. Note: this file must have three plusses +++
#where you want your search results inserted. See help file
#under Template Problems: http://flattext.com/help/
#Note, you are providing a full or relative server PATH here. A
#URL will not work.
$openinghtml="../linkstmp.html";
#B4. REQUIRED TO ADD, DELETE, OR MODIFY. See
#important information in the help files about adding additional
#Security features to your script.
#Change password to any combination of letters (A-Z, a-z) and
#numbers 0-1. USE ONLY LETTERS AND NUMBERS
$adminpassword="5har0n";
#B5. URL to send users to after posting, editing, or getting errors.
#This is usually the main page for this section of your site
$forwardingURL="../members/main/link.html";
#STEP C================================
#C1. Maximum number of matching records to display per page
$maximumpage=250;
#C2. Maximum total number of records to display per search,
#for stylistic reasons, should be multiple of above number
$maximum=250;
#C3. Minimum number of characters user must search for
$minimumcharacters=0;
#STEP D================================
#You should not need to modify this section at all
#D1. Check to see if opening html file is on server
if (-e "$openinghtml"){
#D2. If so, open it and write opening and closing text to different strings
#to be used throughout the script
$problem="Can't open template file. Make sure you are referencing the file and not just a directory.";
open(OPENING, "$openinghtml") || &security;
@wholefile=;
close(OPENING);
$fulltemplate=join("\n",@wholefile);
($templatestart,$templateend)=split(/\+\+\+/,$fulltemplate);}
else{
#D3. If template file not found, use this for now
$templatestart="$templatetitle";
$templateend="";}
$delimiter="\t";
#D4. Get words entered by user
$words=$query->param('words');
#D5. Checks to see if anything attached to URL
if (length($stringpassed)>1){
($words,$sf1)=split(/&&/,$stringpassed);}
#D6. Get Password Entered by User
$checkpassword=$query->param('checkpassword');
#D7. Figure out what action user wants to take.
$actiontotake=$query->param('actiontotake');
$linenumberpass=$query->param('linenumberpass');
#D8. If user wants to delete record, and has already
#verified password, then go to the makechange subroutine
if ($actiontotake eq "Delete Record"){
$recordaction="Deleted";
&makechange;
exit;}
#D9. If user wants to edit record, and has already
#verified password, then go to the makechange subroutine
if ($actiontotake eq "Edit Record"){
$recordaction="Edited";
&makechange;
exit;}
#D10. If user wants to edit record, to go subroutine to verify
if ($actiontotake eq "Edit"){
&edit;
exit;}
#D11. If user wants to delete record, to go subroutine to verify
if ($actiontotake eq "Delete"){
&delete;
exit;}
#D12. If user wants to add record, go to add subroutine
if ($actiontotake eq "Add"){
&addrecord;
exit;}
#STEP E================================
#E2. Remove quotation marks from words entered by user
$words=~s/\"//g;
#E3. Remove word AND from search words since all
#searches are and searches
$words=~s/ and / /g;
$words=~s/ AND / /g;
#E5. Get field user wants to search
if (!$sf1){
$sf1=$query->param('sf1');}
#E6. Get number of records already displayed
$startitem=$query->param('startitem');
#E7. Figure the last record to display on this page
$enditem=$startitem+$maximumpage;
#STEP F================================
#Do not modify this section
#F3. Lowercase search words to make matches easier
$words2=$words;
#F3a. Support for European characters. Uncomment and replace with your
#character set in brackets for all non-English Characters. See help files.
#$words=~tr/[ÈÉÊËéêëè]/e/;
#$words=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/;
#$words=~tr/[çÇ]/c/;
#$words=~tr/[ìíîïÍÎÏÌ]/i/;
#$words=~tr/[ÒÓÔÕÖòóôõöô]/o/;
#$words=~tr/[ÙÚÛÜùúûü]/u/;
$words=lc($words);
#F4. Split words entered by user into seven variables
($one1, $two2, $three3, $four4, $five5, $six6, $seven7)=split(/ /, $words);
#STEP G================================
#Do not modify this section
#G1. Open datafile and write contents to an array, if can't open report the problem at the security subroutine
$problem="You do not have a file to search on the server. Please ADD test records before trying to search your test data file.";
open (FILE, "$data") || &security;
@all=;
close (FILE);
#G2. The line below is required, do not modify
#print "Content-type: text/html\n\n";
#G3. Display HTML Header
print "$templatestart\n";
#STEP H================================
#H1. Read each line of the data file, compare with search words
foreach $line (@all){
$line=~s/\n//g;
$loopsaround++;
$checkleng=length($line);
if ($checkleng<2){next};
$linetemp1=lc($line);
#H1a. Support for European characters. Uncomment and replace with your
#character set in brackets for all non-English Characters. See help files.
#$linetemp1=~tr/[ÈÉÊËéêëè]/e/;
#$linetemp1=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/;
#$linetemp1=~tr/[çÇ]/c/;
#$linetemp1=~tr/[ìíîïÍÎÏÌ]/i/;
#$linetemp1=~tr/[ÒÓÔÕÖòóôõöô]/o/;
#$linetemp1=~tr/[ÙÚÛÜùúûü]/u/;
($Title,$Link,$Description,$skipthisfield)=split (/$delimiter/,$linetemp1);
#H2. This section specifies the fields to sort results by
#See help databases for patches to allow various kinds of sorts
$line="$delimiter$loopsaround$delimiter$line";
#H3. This line removes stray leading spaces before sorting your results
$line=~s/^ +//;
#H4. If the variable sf1 is deleted from search page, then
#search all of the fields in the database
if ($sf1 eq ""){
$wholestring=" $Title $Link $Description";
if ($wholestring =~/\b$one1/ && $wholestring =~/\b$two2/ && $wholestring =~/\b$three3/ && $wholestring =~/\b$four4/ && $wholestring =~/\b$five5/ && $wholestring=~/\b$six6/ && $wholestring =~/\b$seven7/){
push (@keepers,$line);}}
#H7. If the variable sf1 is named Title, then do this search
if ($sf1 eq "Title" && $Title =~/\b$one1/ && $Title =~/\b$two2/ && $Title =~/\b$three3/ && $Title =~/\b$four4/ && $Title =~/\b$five5/ && $Title =~/\b$six6/ && $Title =~/\b$seven7/){
push (@keepers,$line);}
#H7. If the variable sf1 is named Link, then do this search
if ($sf1 eq "Link" && $Link =~/\b$one1/ && $Link =~/\b$two2/ && $Link =~/\b$three3/ && $Link =~/\b$four4/ && $Link =~/\b$five5/ && $Link =~/\b$six6/ && $Link =~/\b$seven7/){
push (@keepers,$line);}
#H7. If the variable sf1 is named Description, then do this search
if ($sf1 eq "Description" && $Description =~/\b$one1/ && $Description =~/\b$two2/ && $Description =~/\b$three3/ && $Description =~/\b$four4/ && $Description =~/\b$five5/ && $Description =~/\b$six6/ && $Description =~/\b$seven7/){
push (@keepers,$line);}
#H8. If the variable sf1 is named All Below, then do this
if ($sf1 eq "All Fields"){
$wholestring= "$Description $Link $Title ";
if ($wholestring =~/\b$one1/ && $wholestring =~/\b$two2/ && $wholestring =~/\b$three3/ && $wholestring =~/\b$four4/ && $wholestring =~/\b$five5/ && $wholestring=~/\b$six6/ && $wholestring =~/\b$seven7/){
push (@keepers,$line);}}
}
#STEP J================================
#J1. Sort matches stored in array. Currently turned off.
#@keepers=sort(@keepers);
#J2. Get and display number of matches found
$length1=@keepers;
#J3. If the number of matches is less than enditem, adjust
if ($length1<$enditem){
$enditem=$length1;
$displaystat="Y";}
#J4. The first field about to display
$disstart=$startitem+1;
#STEP K================================
#K1. Do some HTML formatting before showing results
#K2. Open table for results
print "
\n";
#K4. Keep track of results processed on this page
foreach $line (@keepers){
#K5. Delete stray hard returns
$line=~s/\n//g;
#K6. Keep track of records displayed
$countline1++;
#K7. Decide whether or not this record goes on this page
if ($countline1>$startitem && $countline1<=$enditem){
#K8. Open each line of sorted array for displaying
($sortfield,$loopsaround,$Title,$Link,$Description,$skipthisfield)=split (/$delimiter/,$line);
print "
\n";
#K15. Formatting for field Link. If you add any HTML, make sure you
#put a backslash in front of all quote marks inside print statements
if (!$Link){
$Link=" ";
print "
\n";}
#K15. Formatting for field Title. If you add any HTML, make sure you
#put a backslash in front of all quote marks inside print statements
if (!$Title){
$Title=" ";
print "
$Title \n";}
else{
print "
$Title \n";}
#K15. Formatting for field Description. If you add any HTML, make sure you
#put a backslash in front of all quote marks inside print statements
if (!$Description){
$Description=" ";
print "$Description
\n";}
else{
print "$Description\n";}
print "
\n";
#K18. Check password before showing edit and delete snippets
if ($adminpassword eq $checkpassword){
print "
\n";}
#STEP L================================
#L1. If total displayed equals maximum you set, then exit
if ($countline1 == $maximum && $maximum){
$problem2="Your search was terminated at $maximum records, please be more specific in your search";
last;}
#L2. If script just got to last match then exit program
if ($length1 == $countline1){
last;}
#L3. If script is at the end of a page then show NEXT button
if ($countline1 == $enditem && $displaystat ne "Y" && $maximum>$countline1){
$stopit="Y";
last;
}
}}
print "
\n";
#L4. Display NEXT MATCHES button
if ($stopit eq "Y"){
print "\n";
}
#L6. Show problems
print "
$problem2\n";
#L8. If opening.htm was found, show its closing html codes
print "$templateend\n";
exit;
#STEP M================================
sub security{
#M1. This is the subroutine that reports all problems
#print "Content-type: text/html\n\n";
print "$templatestart\n";
print "
Data Error
\n";
print "Please correct the following error:
$problem
\n";
print "$templateend\n";
exit;
}
#STEP N================================
sub edit{
#N1. Open data file and read it
$problem="Can't open data file to read from it at edit subroutine";
open (FILE,"$data") || &security;
@all=;
close (FILE);
#N2. Read each line of the data file
foreach $line (@all){
$line=~s/\n//g;
($copyTitle,$copyLink,$copyDescription,$skipthisfield)=split (/$delimiter/,$line);
$keepcount++;
#N3. Find the line user wants to modify
if ($keepcount==$linenumberpass){
$linetokeep=$line;
$linetokeep=~s/markedtoedit//g;
last;
}
}
#N4. Check password sent via hidden field
if ($adminpassword ne $checkpassword){
$problem="Your password does not match the master password and appears to have been changed since logging onto this record.";
&security;}
#N6. Split matching line into its respective variables
($Title,$Link,$Description,$skipthisfield)=split (/$delimiter/,$linetokeep);
#Required Header, do not delete
#print "Content-type: text/html\n\n";
#N8. If can't find opening html, display default header
print "$templatestart\n";
print "
Edit this Record
\n";
print "
\n";
print "$templateend\n";
exit;
}
#STEP O================================
sub delete{
#O1. Open data file and read it
$problem="Can't open data file to read from it at delete subroutine";
open (FILE,"$data") || &security;
@all=;
close (FILE);
#O2. Read each line of the file
foreach $line (@all){
$line=~s/\n//g;
($copyTitle,$copyLink,$copyDescription,$skipthisfield)=split (/$delimiter/,$line);
$keepcount++;
#O3. Find line to delete
if ($keepcount==$linenumberpass){
$linetokeep=$line;
$linetokeep=~s/markedtoedit//g;
last;
}
}
($Title,$Link,$Description,$skipthisfield)=split (/$delimiter/,$linetokeep);
#O4. Check password sent via hidden field
if ($adminpassword ne $checkpassword){
$problem="Your password does not match the master password.";
&security;}
#O6. Requred Header, do not delete
#print "Content-type: text/html\n\n";
print "$templatestart\n";
print "
Delete this Record?
\n";
($Title,$Link,$Description,$skipthisfield)=split (/$delimiter/,$linetokeep);
#O7. Show validation HTML
print "
\n";
#If opening.htm was not found, show default closing html codes
print "$templateend\n";
exit;
}
#STEP P================================
sub makechange{
#P1. For each variable, translate it, remove any delimiters that
#user may have accidentally included, replace hard returns with
#HTML line breaks, and delete all carriage returns
#Go to get variable subroutine and make sure add preferences apply
if ($recordaction eq "Edited"){
&getvariables;}
#P2. This step either replaces or empties the existing line
if ($recordaction eq "Deleted"){
$replacementline="";}
else{
$replacementline="$Title$delimiter$Link$delimiter$Description";}
$problem="Can't open data file to read from it";
open (FILE,"$data") || &security;
@all=;
close (FILE);
$linenumberpass--;
$all[$linenumberpass]=$replacementline;
$problem="Can't open temporary file. You need to chmod 777 the directory your data file is in. See the help files under Permissions for Class B Scripts.";
#P6. Write the entire changed file to a temporary file
open (FILE2,">$data.tmp") || &security;
foreach $line (@all){
$line=~s/\n//g;
print FILE2 "$line\n";}
close(FILE2);
#P7. Rename the temp file to your master data file
$problem="Can't rename file after making change";
rename("$data.tmp", "$data") || &security;
#print "Content-type: text/html\n\n";
#P8. If can't find opening html, display default header
print "$templatestart\n";
print "Your record has been $recordaction. Please click here to continue.\n";
close (FILE);
#If opening.htm was not found, show default closing html codes
print "$templateend\n";
exit;
}
#STEP Q================================
#This subroutine adds records to your database
sub addrecord{
#Q1. Check password
if ($adminpassword ne $checkpassword && $adminpassword){
$problem="The password you entered does not match your administration password. Please press BACK on your browser to fix this problem.";
&security;}
&getvariables;
$replacementline="$Title$delimiter$Link$delimiter$Description";
#Q3. Write the new record to the bottom of the data file
$problem="Can't write to the data file. Please verify its location and change its permissions to 777.";
open (FILE2,">>$data") || &security;
print FILE2 "$replacementline\n";
close(FILE2);
#print "Content-type: text/html\n\n";
#Q4. If can't find opening html, display default header
print "$templatestart\n";
print "Your record has been added. Please click here to continue.\n";
#If opening.htm was not found, show default closing html codes
print "$templateend\n";
exit;
}
#STEP R================================
sub getvariables{
#R1. This step checks your variables before adding/editing them
$Title=$query->param('Title');
$Link=$query->param('Link');
$Description=$query->param('Description');
#R3. Replace hard returns with , cut carriage returns
$Title=~s/\n/ /g;
$Title=~s/\r//g;
if ($Title eq "Select"){
$Title="";}
#R3. Replace hard returns with , cut carriage returns
$Link=~s/\n/ /g;
$Link=~s/\r//g;
if ($Link eq "Select"){
$Link="";}
#R3. Replace hard returns with , cut carriage returns
$Description=~s/\n/ /g;
$Description=~s/\r//g;
if ($Description eq "Select"){
$Description="";}
}
#This is the last line of the script