function index()
{
    global $site_path, $db, $prefix, $site_host, $config, $lang;
    include "header.php";
    $id = intval($_GET["id"]);
    $tpl = new Template();
    $tpl->modTemplate("package");
    $result = $db->query("SELECT * FROM travel_package WHERE package_id={$id} AND package_active=1");
    $row = $db->fetch_array($result);
    $content = explode("<break>", "{$row['package_desc']}");
    $num_record = count($content);
    if (isset($_GET['page'])) {
        $page = intval($_GET['page']);
    } else {
        $page = 1;
    }
    $currentpage = $page;
    $perpage = 1;
    $start = ($page - 1) * $perpage;
    $pages = ceil($num_record / $perpage);
    $starting_no = $start + 1;
    if ($num_record - $start < $perpage) {
        $end_count = $num_record;
    } elseif ($num_record - $start >= $perpage) {
        $end_count = $start + $perpage;
    }
    if ($pages > 1) {
        $page_link = makepagelink("index.php?m=package&file=packagedetails&id={$id}", $page, $pages);
    } else {
        $page_link = "";
    }
    $arrayelement = (int) $page;
    $arrayelement--;
    if (is_admin()) {
        $link = "<a href=index.php?file=admin&op=editpackage&id={$row['package_id']}>Edit</a>";
    } else {
        $link = "";
    }
    $contentx = nl2br($content[$arrayelement]);
    $q = $_SERVER["QUERY_STRING"];
    $url = "{$config['site_url']}/index.php?{$q}";
    $tpl->assign("phone", $config[site_phone]);
    $tpl->assign("lang", $lang);
    $tpl->assign("id", $id);
    $tpl->assign("link", $url);
    $tpl->assign("pagelink", $page_link);
    $tpl->assign("start", $starting_no);
    $tpl->assign("end", $end_count);
    $tpl->assign("found", $num_record);
    $tpl->assign("currentpage", $currentpage);
    $tpl->assign("package", $row);
    $tpl->assign("content", $contentx);
    $tpl->display("package_details.tpl");
    include "footer.php";
}
Example #2
0
function index()
{
    include "header.php";
    global $db, $lang, $prefix;
    $tpl = new Template();
    $tpl->modTemplate("package");
    $continent = intval($_GET["continent"]);
    if (!empty($continent)) {
        $cond = " AND package_continent={$continent}";
    }
    $result = $db->query("SELECT *  FROM " . $prefix . "_package  WHERE  package_active=1 {$cond}");
    $num_record = $db->row_count($result);
    if ($num_record < 1) {
        $tpl->display("no_package.tpl");
        include "footer.php";
        exit;
    }
    if (isset($_GET['page'])) {
        $page = intval($_GET['page']);
    } else {
        $page = 1;
    }
    $currentpage = $page;
    $perpage = 20;
    $start = ($page - 1) * $perpage;
    $pages = ceil($num_record / $perpage);
    $starting_no = $start + 1;
    if ($num_record - $start < $perpage) {
        $end_count = $num_record;
    } elseif ($num_record - $start >= $perpage) {
        $end_count = $start + $perpage;
    }
    if ($pages > 1) {
        $page_link = makepagelink("index.php?m=package", $page, $pages);
    } else {
        $page_link = "";
    }
    $result2 = $db->query("SELECT * FROM " . $prefix . "_package  WHERE package_active=1 {$cond} ORDER BY package_id DESC limit {$start},{$perpage}");
    $tpl->assign("pagelink", $page_link);
    $tpl->assign("start", $starting_no);
    $tpl->assign("end", $end_count);
    $tpl->assign("found", $num_record);
    $tpl->assign("currentpage", $currentpage);
    while ($row = $db->fetch_array($result2)) {
        $package[] = $row;
    }
    $tpl->assign("lang", $lang);
    $tpl->assign("package", $package);
    $tpl->display("package.tpl");
    include "footer.php";
}
Example #3
0
function index()
{
    global $db, $lang, $prefix;
    include "header.php";
    $result = $db->query("SELECT *\tFROM  " . $prefix . "_fares WHERE  fare_special=1 AND fare_active=1 ORDER BY fare_id");
    $tpl = new Template();
    $tpl->modTemplate("special");
    $num_record = $db->row_count($result);
    if (isset($_GET['page'])) {
        $page = intval($_GET['page']);
    } else {
        $page = 1;
    }
    $currentpage = $page;
    $perpage = 20;
    $start = ($page - 1) * $perpage;
    $pages = ceil($num_record / $perpage);
    $starting_no = $start + 1;
    if ($num_record - $start < $perpage) {
        $end_count = $num_record;
    } elseif ($num_record - $start >= $perpage) {
        $end_count = $start + $perpage;
    }
    if ($pages > 1) {
        $page_link = makepagelink("index.php?m=special", $page, $pages);
    } else {
        $page_link = "";
    }
    // Fix the problem
    $result = $db->query("SELECT *\tFROM  " . $prefix . "_fares WHERE  fare_special=1 AND fare_active=1  ORDER BY fare_id DESC\n\n\tLIMIT {$start},{$perpage}");
    $found = $db->row_count($result);
    $tpl->assign("found", $found);
    $tpl->assign("lang", $lang);
    $tpl->assign("pagelink", $page_link);
    $tpl->assign("start", $starting_no);
    $tpl->assign("end", $end_count);
    $tpl->assign("found", $found);
    $tpl->assign("currentpage", $currentpage);
    while ($row = $db->fetch_array($result)) {
        $special[] = $row;
        $tpl->assign("date", "" . todate($row[fare_purchaseby]) . "");
        $q = $db->query("SELECT * from travel_airline WHERE airline_id={$row['fare_airline']}");
        $airline = $db->fetch_array($q);
        $tpl->assign("airline", $airline);
        $tpl->assign("special", $special);
    }
    $tpl->display("specialindex.tpl");
    include "footer.php";
}
Example #4
0
function index()
{
    global $db, $site_path;
    include "header.php";
    $tpl = new Template();
    $tpl->modTemplate("currency");
    $handle = fopen("{$site_path}/currency.xml", "r");
    $data = "";
    while (!feof($handle)) {
        $buffer = fgets($handle, 4096);
        $data .= "{$buffer}";
    }
    fclose($handle);
    for ($i = 0; $i < 10; $i++) {
        $items = explode("</item>", $data);
        $indexx = $i;
        $country = ereg_replace(".*<country>", "", $items[$i]);
        $country = ereg_replace("</country>.*", "", $country);
        $currency = ereg_replace(".*<currency>", "", $items[$i]);
        $currency = ereg_replace("</currency>.*", "", $currency);
        $lastupdate = ereg_replace(".*<lastupdate>", "", $items[$i]);
        $lastupdate = ereg_replace("</lastupdate>.*", "", $lastupdate);
        $rate = ereg_replace(".*<rate>", "", $items[$i]);
        $rate = ereg_replace("</rate>.*", "", $rate);
        $currency_array[$indexx]["country"] = $country;
        $currency_array[$indexx]["currency"] = $currency;
        $currency_array[$indexx]["rate"] = $rate;
        $option[] = "{$rate}";
    }
    $option = implode(",", $option);
    $tpl->assign("option", $option);
    $tpl->assign("lastupdate", $lastupdate);
    $tpl->assign("currency", $currency_array);
    $tpl->display("currency.tpl");
    include "footer.php";
}
Example #5
0
<?php

if (!eregi("index.php", $_SERVER['PHP_SELF'])) {
    die("You can't access this file directly...");
}
require_once "mainfile.php";
$index = 2;
global $db, $prefix;
$tpl = new Template();
$tpl->modTemplate("news");
include "header.php";
$id = intval($_GET["id"]);
$result = $db->query("SELECT * FROM travel_news WHERE news_id={$id} ORDER BY news_id DESC");
$row = $db->fetch_array($result);
$tpl->assign('news', $row);
$tpl->display("readnews.tpl");
include "footer.php";
Example #6
0
<?php

if (!eregi("index.php", $_SERVER['PHP_SELF'])) {
    die("You can't access this file directly...");
}
require_once "mainfile.php";
$index = 1;
global $site_path, $db, $prefix, $site_host, $config;
$tpl = new Template();
$tpl->modTemplate("print");
$url = $_SERVER['HTTP_REFERER'];
$parsed_url = parse_url($url);
$server = $parsed_url['host'];
if (!$server == $site_host || empty($url)) {
    header("location:{$site_url}");
    exit;
}
$fd = fopen("{$url}", "r");
$contents = "";
$start = "<!--printstart-->";
// Start Grabbing Code
$stop = "<!--printend-->";
// Stop Grabbing Code
while ($line = fgets($fd, 8192)) {
    $contents .= $line;
}
fclose($fd);
// Isolates desired section.
if (eregi("{$start}(.*){$stop}", $contents, $printing)) {
    $substring = $printing[1];
    // while is added as there are multiple instances of the </table> string & eregi
Example #7
0
<?php

//File Name:validate.php
//Desc: Validate registration process by passing code
if (!eregi("index.php", $_SERVER['PHP_SELF'])) {
    die("You can't access this file directly...");
}
require_once "mainfile.php";
$index = 1;
include "header.php";
$tpl = new Template();
$tpl->modTemplate("member");
$time = time() - 86400;
$db->query("DELETE FROM  " . $prefix . "_user_temp where user_regdate<{$time}");
//Get validate code
$id = intval($_GET["id"]);
//Find details from by the id number
$result = $db->query("SELECT * from " . $prefix . "_user_temp WHERE user_code={$id}");
//Put details into array
$user = $db->fetch_array($result);
//Check how many records found
$found = $db->row_count($result);
$time = time();
// check if the user already exist in the user table
$qcheck_user = $db->query("SELECT user_id FROM " . $prefix . "_user WHERE user_email='{$user['user_email']}'");
$user_exist = $db->row_count($qcheck_user);
//If no record found by the id number  or user already exist then stop him there.
if ($found < 1) {
    $tpl->display("no_temp_user_found.tpl");
    include "footer.php";
    exit;
Example #8
0
<?php

if (!eregi("index.php", $_SERVER["PHP_SELF"])) {
    die("You can't access this page directly.");
}
$index = 2;
require_once "mainfile.php";
include "header.php";
$tpl = new Template();
$tpl->assign("lang", $lang);
$tpl->modTemplate("tac");
$tpl->display("tacindex.tpl");
include "footer.php";
Example #9
0
if(eregi("home.php",$_SERVER["PHP_SELF"])){
header("location:index.php");
die();
}

$index=2;

$page_title="Contact us";


require_once("mainfile.php");
global $config;

include("header.php");
$tpl= new Template();
$tpl->modTemplate("contact");
smartyValidate::connect($tpl, empty($_POST));
SmartyValidate::register_form('contact_us');
	 $tpl->assign("lang",$lang);
$tpl->assign("phone",$config[site_phone]);
if(empty($_POST)) {
	 $tpl->assign("lang",$lang);
	$tpl->display('contact.tpl');
}
else{
		   // validate after a POST
		   if(SmartyValidate::is_valid($_POST)) {
			   // no errors, done with SmartyValidate
			   	$uname=$_POST['uname'];
			   	$message=$_POST['message'];
			   	$subject=$_POST['subject'];
Example #10
0
<?php

if (!eregi("index.php", $_SERVER["PHP_SELF"])) {
    die("You can't access this page directly.");
}
$index = 2;
require_once "mainfile.php";
include "header.php";
$tpl = new Template();
$tpl->assign("lang", $lang);
$tpl->modTemplate("aboutus");
$tpl->display("aboutus.tpl");
include "footer.php";
Example #11
0
<?php

if (!eregi("index.php", $_SERVER["PHP_SELF"])) {
    die("You can't access this page directly.");
}
$index = 4;
require_once "mainfile.php";
$page_title = "Flight Information";
include "header.php";
$tpl = new Template();
$tpl->modTemplate("flightinformation");
$act = $_REQUEST["act"];
if (empty($act)) {
    $act = "a";
}
$act_opt = array("a" => "Arrivals", "d" => "Departures");
$tpl->assign("act_opt", $act_opt);
$tpl->assign("act", $act);
$result = $db->query("SELECT * FROM " . $prefix . "_flights WHERE flight_action='{$act}'");
$flight = $db->fetch_array($result);
$tpl->assign("lang", $lang);
$tpl->assign("flight", $flight);
$tpl->display("flightinformation.tpl");
include "footer.php";
?>

Example #12
0
<?php

if (!eregi("index.php", $_SERVER["PHP_SELF"])) {
    header("location:index.php");
    die;
}
require_once "mainfile.php";
global $prefix, $db;
include "header.php";
$tpl = new Template();
$tpl->modTemplate("newsletter");
$c = intval($_GET["c"]);
$past = time() - 86400;
$db->query("DELETE FROM " . $prefix . "_newsletter_user_temp WHERE user_date < {$past}");
$qcheck = $db->query("SELECT * FROM " . $prefix . "_newsletter_user_temp WHERE user_code='{$c}'");
$found = $db->row_count($qcheck);
$user = $db->fetch_array($qcheck);
if ($found > 0) {
    $db->query("DELETE FROM " . $prefix . "_newsletter_user WHERE user_email='{$user['user_email']}'");
    $tpl->display("unsubscribe_success.tpl");
} else {
    $tpl->display("invalid_code.tpl");
}
include "footer.php";