Add initial files and database migration for ticket pricing system
- Created new directories and index files for controls, factory, and views. - Added .htaccess files for URL rewriting in layout and images directories. - Included a logo image in the layout/images directory. - Implemented load_prices.php to load ticket prices from the database into settings. - Developed admin panel settings page for enabling ticket sales. - Created tickets management page in the admin panel to display and edit ticket prices. - Added upgrade.php for database migrations, including creating the ticket_prices table and adding weekend price column.
This commit is contained in:
@@ -60,4 +60,30 @@ class Apanel {
|
||||
|
||||
return $basket;
|
||||
}
|
||||
|
||||
static public function getSetting($key, $default = null)
|
||||
{
|
||||
global $mdb;
|
||||
|
||||
try {
|
||||
$mdb->pdo->exec("CREATE TABLE IF NOT EXISTS site_settings (
|
||||
setting_key VARCHAR(100) PRIMARY KEY,
|
||||
setting_value TEXT
|
||||
)");
|
||||
} catch (\Exception $e) {}
|
||||
|
||||
$stmt = $mdb->pdo->prepare("SELECT setting_value FROM site_settings WHERE setting_key = :key LIMIT 1");
|
||||
$stmt->execute([':key' => $key]);
|
||||
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
|
||||
|
||||
return $row ? $row['setting_value'] : $default;
|
||||
}
|
||||
|
||||
static public function saveSetting($key, $value)
|
||||
{
|
||||
global $mdb;
|
||||
|
||||
$stmt = $mdb->pdo->prepare("REPLACE INTO site_settings (setting_key, setting_value) VALUES (:key, :val)");
|
||||
$stmt->execute([':key' => $key, ':val' => $value]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user