Example #1
0
function collectInfo($city = null, $browser = null)
{
    // Check dependencies
    if (!class_exists("\\CustomerInfo\\Libs\\Structures\\Customers")) {
        return false;
    }
    // Create customer
    $customer = (object) ['ip_address' => defineIp(), 'visit_date' => date("Y-m-d H:i:s"), 'city' => !empty($city) ? $city : defineCity(), 'browser' => !empty($browser) ? $browser : defineBrowser()];
    // Save customer
    $Customers = new \CustomerInfo\Libs\Structures\Customers();
    $result = $Customers->set($customer);
    return $result;
}
Example #2
0
<?php 
if (!is_user_logged_in() && get_option("closed_for_maintenance", false)) {
    die("Сайт закрыт на техническое обслуживание");
}
?>
<body>
	<header <?php 
echo $template_part !== 'main' ? "class='header--inner'" : "";
?>
>
		<div class="page__universal-wrapper">
			<div class="head-universal__col head-universal__col_first">
				<p>
					Ваш Город <br />
					<strong id="city"><?php 
echo defineCity();
?>
</strong>
				</p>
			</div>
			<div class="head-universal__col head-universal__col_second">
				<p>
					Сегодня <br />
					<strong id="date"><?php 
echo defineDate();
?>
</strong>
				</p>
			</div>
			<div class="head-universal__col head-universal__col_logo">
				<a href="<?php