session_start();
if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start();
$timezone = "Asia/Calcutta";
if(function_exists('date_default_timezone_set')) date_default_timezone_set($timezone);
$dbhost='localhost';
$default_dbname='srsdealsdb';
$dbusern='srsdealsuser';
$dbuserp='qxTwtT1VXihF';
$map_key="";
define("SITEURL", "https://www.gooddaydeals.com.au/");
$site_title = "";
$encode =0;
error_reporting(0);
if(!isset($_COOKIE['SOURCE_COUNTRY_COOKIE'])||!isset($_COOKIE['TOUR_COUNTRY_COOKIE']))
{
//if(!$_GET['tab']){
// header("location:".SITEURL."indexmain?tab=1");
// exit;
//}
$global_source_country_id = 1;
$global_tour_country_id = 1;
setcookie('SOURCE_COUNTRY_COOKIE', $global_source_country_id, time() + (86400 * 30));
setcookie('TOUR_COUNTRY_COOKIE', $global_tour_country_id, time() + (86400 * 30));
}
else
{
//$_SESSION['SOURCE_COUNTRY_ID'] = $_COOKIE['SOURCE_COUNTRY_COOKIE'];
//$_SESSION['TOUR_COUNTRY_ID'] = $_COOKIE['TOUR_COUNTRY_COOKIE'];
$global_source_country_id = $_COOKIE['SOURCE_COUNTRY_COOKIE'];
$global_tour_country_id = $_COOKIE['TOUR_COUNTRY_COOKIE'];
}
?>
if($_GET)
extract($_GET);
if($_POST)
extract($_POST);
$MYSQL_ERRNO='';
$MYSQL_ERROR='';
$MYSQL_ERRNO='';$MYSQL_ERROR='';function db_connect(){global $dbhost,$dbusern,$dbuserp,$default_dbname;global $MYSQL_ERRNO,$MYSQL_ERROR;$con_id=mysql_connect($dbhost,$dbusern,$dbuserp);if(!$con_id){$MYSQL_ERRNO=0;$MYSQL_ERROR="Server busy";return 0;}else if(empty($dbname) && !mysql_select_db($default_dbname)){$MYSQL_ERRNO=mysql_errno();$MYSQL_ERROR=mysql_error();return 0;}else return $con_id;}function sql_error(){global $MYSQL_ERRNO,$MYSQL_ERROR;if(empty($MYSQL_ERROR)){$MYSQL_ERRNO=mysql_errno();$MYSQL_ERROR=mysql_error();}return "$MYSQL_ERRNO: $MYSQL_ERROR";}
$con_id = db_connect();
if(!$con_id) die(sql_error());
if(isset($anp))
parse_str(base64_decode(base64_decode($anp)));
function url_encode($url){
$en=0;
if($en)
return "anp=".base64_encode(base64_encode($url));
else
return $url;
}
function red_url($url){
$page = "home.php?".url_encode($url);
header('Location:'.$page);
exit;
}
function set_message($msg,$type)
{
$_SESSION['ERR_MSG'] = $msg;
$_SESSION['ERR_TYP'] = $type;
}
function del_message()
{
unset($_SESSION['ERR_MSG']);
unset($_SESSION['ERR_TYP']);
}
function show_message()
{
$msg = $_SESSION['ERR_MSG'];
$type = $_SESSION['ERR_TYP'];
if($type=='SUCC')
echo '
Well done! '.$msg.'
';
else if($type=='ERR')
echo 'Warning! '.$msg.'
';
}
function pg_link($url)
{
if($url)
$ret = "home.php?".url_encode($url);
else
$ret = "home.php";
return $ret;
}
function admin_auth()
{
if(!$_SESSION["ADMIN_AREA"] || $_SESSION["ADMIN_AREA"]!="Active")
header('Location:'.SITEURL.'login?msg=logout');
}
function pagedisplay($page,$argu2,$nur,$argu1,$seltab)
{
global $mode,$pg,$con_id;
//$argu2 = 'mode='.$mode.'&pg='.$pg.$argu2;
//$argu2 = '';
if(!$page)
$page=1;
$page=$page-1;
$seltab = strtolower($seltab);
$cut_qr = strstr($seltab, 'from');
$Selqr = mysql_query("SELECT count(*) as cnt ".$cut_qr);
$res3 = mysql_fetch_array($Selqr);
$no = $res3['cnt'];//total number of record
$qr = $seltab." limit ".$page.",".$nur;
$res22 = mysql_query($qr);
$nopages = ceil($no/$nur); // Number of records per page is 10
$str="";
$str.='";
$res[0] = $res22;
$res[1] = $str;
$res[2] = $no;
return $res;
}
function pagedisplay2($start,$argu2,$nur,$argu1,$seltab)
{
global $mode,$pg,$con_id;
//$argu2 = '';
if(!$start)
$start=0;
$seltab = strtolower($seltab);
$cut_qr = strstr($seltab, 'from');
$Selqr = mysql_query("SELECT count(*) as cnt ".$cut_qr);
$res3 = mysql_fetch_array($Selqr);
$no = $res3['cnt'];//total number of record
$qr = $seltab." limit ".$start.",".$nur;
$res22 = mysql_query($qr);
$nopages = ceil($no/$nur); // Number of records per page is 10
$str="";
$str.="";
$res[0] = $res22;
$res[1] = $str;
$res[2] = $no;
return $res;
}
function _prepare_url_text_for_cat($string)
{
// remove all characters that aren't a-z, 0-9, dash, underscore or space
$NOT_acceptable_characters_regex = '#[^-a-zA-Z0-9_ ]#';
$string = preg_replace($NOT_acceptable_characters_regex, '', $string);
// remove all leading and trailing spaces
$string = trim($string);
//make all letters small
$string = strtolower($string);
// change all dashes, underscores and spaces to dashes
$string = preg_replace('#[-_ ]+#', '-', $string);
// return the modified string
return $string;
}
function add_trim($string)
{
$string = strip_tags($string);
return trim(addslashes($string));
}
function strip($string)
{
return stripslashes($string);
}
function add_trim_upper($string)
{
return strtoupper(trim(addslashes($string)));
}
function ret_sql_date($date)
{
if($date){
$dt_ar= explode("-",$date);
if(!$dt_ar[2])
$dt_ar= explode("/",$date);
//$test3 = new DateTime($month.'/01/'.$year);
$test = new DateTime($dt_ar[1].'/'.$dt_ar[0].'/'.$dt_ar[2]);
return date_format($test, 'Y-m-d');
}
else
return '';
}
function pg_sql_date($date)
{
if($date){
$dt_ar= explode("-",$date);
$test = new DateTime($dt_ar[1].'/'.$dt_ar[2].'/'.$dt_ar[0]);
return date_format($test, 'd-m-Y');
}
else
return '';
}
function email_check($email)
{
$email = trim($email);
if($email==''){
return false;
}else if(!preg_match("/^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$/i", $email)){
return false;
}else {
return true;
}
}
function num_check($num)
{
$num = trim($num);
if(preg_match("/^[0-9]+$/",$num) && $num>0){
return true;
}
else{
return false;
}
}
function value_check($val)
{
$val = trim($val);
if($val==''){
return false;
}else{
return true;
}
}
function valuelength_check($val)
{
$val = trim($val);
if(strlen($val)<3 || strlen($val)>255){
return false;
}else{
return true;
}
}
function price_display($val){
return number_format($val, 2, ".", ",");
}
function date_grater_today($sel_date)
{
$ch_date = false;
if (preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/",$sel_date) && strtotime($sel_date) >= strtotime(date("Y-m-d")))
{
$ch_date = true;
}else{
$ch_date = false;
}
return $ch_date;
}
?>
Terms and Conditions - GoodDayDeals