Add methods to retrieve and analyze product sales data, send department statistics to Slack, and implement scheduled messaging logic

This commit is contained in:
Jeppe Bundgaard
2026-01-21 13:42:19 +01:00
parent f5d430c0c7
commit 9b41f80ea5
6 changed files with 399 additions and 2 deletions
+11
View File
@@ -22,6 +22,17 @@ class db
$this->database = $config['database'];
}
public static function getPDO(): \PDO
{
global $config;
$dsn = "mysql:host={$config['db']['host']};dbname={$config['db']['database']};charset=utf8mb4";
return new \PDO($dsn, $config['db']['user'], $config['db']['password'], [
\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION,
\PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC,
\PDO::ATTR_EMULATE_PREPARES => false,
]);
}
public function connect(): void
{
global $response;