<?php

date_default_timezone_set('Asia/Riyadh');

session_start();

define('VERSION', '2.6.1');

$t = time();
$ip = $_SERVER['REMOTE_ADDR'];
$agent = $_SERVER['HTTP_USER_AGENT'];
$device = preg_match("/mobile|mobi|android|iphone/i", $agent) == true ? 'mobile' : 'desktop';
$bot = preg_match('/bot|crawl|slurp|spider|mediapartners/i', $agent) ? 1 : 0;
$uri = $_SERVER['REQUEST_URI'];

$per = array(
    'users' => 1,
    'listings' => 1,
    'orders' => 1
);

$period = array(
    'hour' => strtotime('1 hour ago', $t),
    'day' => strtotime('24 hours ago', $t),
    'week' => strtotime('7 days ago', $t),
    'month' => strtotime('30 days ago', $t)
);

$date = array(
    'this_month' => strtotime('first day of this month', $t),
    'this_week' => strtotime('last sunday', $t),
    'this_day' => strtotime('today', $t)
);

define('ERROR_DATABASE', 'Database error. Please contact support');
define('LOG_IN', 'Please log in to your account to perform this action');

?>
