first commit

This commit is contained in:
Konstantin
2026-05-30 09:27:58 +03:00
commit de0344d218
2371 changed files with 661486 additions and 0 deletions
@@ -0,0 +1,24 @@
<?php
class ModelExtensionDashboardOnline extends Model {
public function getTotalOnline($data = array()) {
$sql = "SELECT COUNT(*) AS total FROM `" . DB_PREFIX . "customer_online` co LEFT JOIN " . DB_PREFIX . "customer c ON (co.customer_id = c.customer_id)";
$implode = array();
if (!empty($data['filter_ip'])) {
$implode[] = "co.ip LIKE '" . $this->db->escape($data['filter_ip']) . "'";
}
if (!empty($data['filter_customer'])) {
$implode[] = "co.customer_id > 0 AND CONCAT(c.firstname, ' ', c.lastname) LIKE '" . $this->db->escape($data['filter_customer']) . "'";
}
if ($implode) {
$sql .= " WHERE " . implode(" AND ", $implode);
}
$query = $this->db->query($sql);
return $query->row['total'];
}
}