Example #1
0
 public static function show()
 {
     $Customers = new \CustomerInfo\Libs\Structures\Customers();
     // Show content
     $content = Helper::render(__DIR__ . "/../Views/Customers.php", ['customers' => $Customers->get()]);
     echo $content;
 }
Example #2
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;
}