Download setup_db.php from vergen-dev/deepsite-project-de4im: direct link, hf CLI and curl.
- Browser
- Download file 13.6 kB
-
https://huggingface.co/spaces/vergen-dev/deepsite-project-de4im/resolve/main/setup_db.php
- Command line
-
hf download hf://spaces/vergen-dev/deepsite-project-de4im/setup_db.php
-
curl -L -o setup_db.php https://huggingface.co/spaces/vergen-dev/deepsite-project-de4im/resolve/main/setup_db.php
13.6 kB
| require 'db_connect.php'; | |
| try { | |
| // 1. Config Table | |
| $db->exec("CREATE TABLE IF NOT EXISTS config ( | |
| id INTEGER PRIMARY KEY AUTOINCREMENT, | |
| key_name TEXT UNIQUE, | |
| value_text TEXT | |
| )"); | |
| $configs = [ | |
| 'brand' => 'OFT MGMT', | |
| 'hero_h1' => 'Creatività, performance e contenuti che portano <span class="accent">risultati reali</span>.', | |
| 'hero_sub' => 'Agenzia creativa: marketing, social, foto e video — risultati concreti', | |
| 'tagline' => 'Agenzia creativa: marketing, social, foto e video — risultati concreti', | |
| 'email' => 'info@oftagency.com', | |
| 'phone' => '+39 333 123 4567', | |
| 'whatsapp_url' => 'https://wa.me/393331234567', | |
| 'instagram_url' => 'https://instagram.com/oft_mgmt', | |
| 'instagram_label' => '@oft_mgmt', | |
| 'tiktok_url' => 'https://tiktok.com/@oft_mgmt', | |
| 'booking_url' => '#contact', | |
| 'address' => 'Via G. Origlia, 36 — Nocera Inferiore (SA)', | |
| 'agency_image_1' => 'team.jpg', | |
| 'agency_image_2' => 'agenzia.jpg', | |
| 'video_embed_url' => 'https://www.youtube.com/embed/dQw4w9WgXcQ?autoplay=1&rel=0', | |
| // About Section Text | |
| 'about_title' => 'Chi <span class="accent">siamo</span>', | |
| 'about_intro' => 'OFT MGMT nasce nel 2025 dall’energia di tre ragazzi che credono nel potere delle idee e aiutano i brand a farsi notare davvero.', | |
| 'about_text_1' => 'OFT MGMT è nata all’inizio del 2025 da tre ragazzi con un’idea chiara: trasformare la passione per creatività e marketing in risultati concreti. Negli anni abbiamo aiutato attività locali a crescere sui social con contenuti e campagne che fanno la differenza.', | |
| 'about_text_2' => 'Da passione condivisa a progetto reale: un’agenzia creativa pensata per dare voce ai brand e portarli a un livello superiore.', | |
| // Contact Section Text | |
| 'contact_title' => 'Contatti', | |
| 'contact_intro' => 'Siamo rapidi a rispondere. Instagram, email o telefono: scegli tu.', | |
| 'admin_password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi' // password: password (default) | |
| ]; | |
| $stmt = $db->prepare("INSERT OR IGNORE INTO config (key_name, value_text) VALUES (:k, :v)"); | |
| foreach ($configs as $k => $v) { | |
| $stmt->execute([':k' => $k, ':v' => $v]); | |
| } | |
| // 2. Stats (Metrics) | |
| $db->exec("CREATE TABLE IF NOT EXISTS stats ( | |
| id INTEGER PRIMARY KEY AUTOINCREMENT, | |
| label TEXT, | |
| value TEXT, | |
| unit TEXT, | |
| sort_order INTEGER DEFAULT 0 | |
| )"); | |
| // Check if empty | |
| $count = $db->query("SELECT COUNT(*) FROM stats")->fetchColumn(); | |
| if ($count == 0) { | |
| $stats = [ | |
| ['Progetti', '120', '+', 1], | |
| ['Brand seguiti', '35', '+', 2], | |
| ['Clienti soddisfatti', '98', '%', 3] | |
| ]; | |
| $stmt = $db->prepare("INSERT INTO stats (label, value, unit, sort_order) VALUES (?, ?, ?, ?)"); | |
| foreach ($stats as $s) { | |
| $stmt->execute($s); | |
| } | |
| } | |
| // 3. Services | |
| $db->exec("CREATE TABLE IF NOT EXISTS services ( | |
| id INTEGER PRIMARY KEY AUTOINCREMENT, | |
| icon TEXT, | |
| title TEXT, | |
| description TEXT, | |
| sort_order INTEGER DEFAULT 0 | |
| )"); | |
| $count = $db->query("SELECT COUNT(*) FROM services")->fetchColumn(); | |
| if ($count == 0) { | |
| $services = [ | |
| ['🎯', 'Social Media Management', 'Piano editoriale data‑driven, copy, publishing e community.', 1], | |
| ['📸', 'Produzione Foto', 'Still life, lifestyle, ritratti, cataloghi e ADV.', 2], | |
| ['🎬', 'Produzione Video', 'Short‑form, brand stories e spot orientati alla conversione.', 3], | |
| ['📈', 'Campagne Pubblicitarie', 'Meta/TikTok Ads, test A/B, scaling e report.', 4], | |
| ['🛒', 'Web & Ecommerce', 'Siti veloci e focalizzati su conversioni e brand identity.', 5], | |
| ['⚡', 'Strategy & Advisory', 'Posizionamento, tone of voice, content system, crescita.', 6] | |
| ]; | |
| $stmt = $db->prepare("INSERT INTO services (icon, title, description, sort_order) VALUES (?, ?, ?, ?)"); | |
| foreach ($services as $s) { | |
| $stmt->execute($s); | |
| } | |
| } | |
| // 4. Founders | |
| $db->exec("CREATE TABLE IF NOT EXISTS founders ( | |
| id INTEGER PRIMARY KEY AUTOINCREMENT, | |
| name TEXT, | |
| role TEXT, | |
| image_path TEXT, | |
| sort_order INTEGER DEFAULT 0 | |
| )"); | |
| $count = $db->query("SELECT COUNT(*) FROM founders")->fetchColumn(); | |
| if ($count == 0) { | |
| $founders = [ | |
| ['Michele Bisogno', 'Founder & CEO', 'michele.jpg', 1], | |
| ['Francesco Novi', 'Founder & CEO', 'francesco.jpg', 2], | |
| ['Eliodoro D’ Acunzo', 'Founder & CEO', 'elio.jpg', 3] | |
| ]; | |
| $stmt = $db->prepare("INSERT INTO founders (name, role, image_path, sort_order) VALUES (?, ?, ?, ?)"); | |
| foreach ($founders as $f) { | |
| $stmt->execute($f); | |
| } | |
| } | |
| // 5. Case Studies | |
| $db->exec("CREATE TABLE IF NOT EXISTS cases ( | |
| id INTEGER PRIMARY KEY AUTOINCREMENT, | |
| title TEXT, | |
| stats_text TEXT, | |
| role_text TEXT, | |
| tags TEXT, | |
| image_path TEXT, | |
| sort_order INTEGER DEFAULT 0 | |
| )"); | |
| $count = $db->query("SELECT COUNT(*) FROM cases")->fetchColumn(); | |
| if ($count == 0) { | |
| $cases = [ | |
| [ | |
| 'Cava Brew Fest 01', | |
| 'Festival della birra a Cava de’ Tirreni: 80.000 presenze, 3M visualizzazioni, 6.000 nuovi follower e 350k account raggiunti.', | |
| 'Ruolo: strategia digitale, contenuti virali e promozione online → evento diventato fenomeno social.', | |
| '#Event,#ShortForm,#IG Growth', | |
| 'cava.png', | |
| 1 | |
| ], | |
| [ | |
| 'IGEM — Nautica & Luxury Experience 02', | |
| 'Partendo da zero: 1,5M visualizzazioni organiche, 6.000 follower totali e 15 tour venduti in un mese.', | |
| 'Ruolo: gestione social, contenuti accattivanti e campagne mirate per far crescere rapidamente la brand awareness.', | |
| '#Luxury,#Tour,#Performance', | |
| 'nautica.PNG', | |
| 2 | |
| ] | |
| ]; | |
| $stmt = $db->prepare("INSERT INTO cases (title, stats_text, role_text, tags, image_path, sort_order) VALUES (?, ?, ?, ?, ?, ?)"); | |
| foreach ($cases as $c) { | |
| $stmt->execute($c); | |
| } | |
| } | |
| // 6. Pricing | |
| $db->exec("CREATE TABLE IF NOT EXISTS pricing ( | |
| id INTEGER PRIMARY KEY AUTOINCREMENT, | |
| name TEXT, | |
| price TEXT, | |
| features TEXT, -- JSON or separator separated | |
| is_recommended BOOLEAN DEFAULT 0, | |
| sort_order INTEGER DEFAULT 0 | |
| )"); | |
| $count = $db->query("SELECT COUNT(*) FROM pricing")->fetchColumn(); | |
| if ($count == 0) { | |
| $pricing = [ | |
| [ | |
| 'Growth pack', | |
| '600', | |
| "12 contenuti verticali|Story set base, grafiche base|Format vincenti + gestione pubblicazioni|Ottimizzazione contenuti e strategie|Gestione Ads (+100€ / mese budget ads)", | |
| 0, | |
| 1 | |
| ], | |
| [ | |
| 'Premium pack', | |
| '1000', | |
| "12 contenuti verticali|Story set avanzato + grafiche premium|Copywriting professionale|Shooting extra con fotografo|Format avanzati + trend scouting|Gestione Ads (+200€ / mese budget ads)|Reportistica avanzata e consulenza", | |
| 1, | |
| 2 | |
| ] | |
| ]; | |
| $stmt = $db->prepare("INSERT INTO pricing (name, price, features, is_recommended, sort_order) VALUES (?, ?, ?, ?, ?)"); | |
| foreach ($pricing as $p) { | |
| $stmt->execute($p); | |
| } | |
| } | |
| // 7. FAQ | |
| $db->exec("CREATE TABLE IF NOT EXISTS faq ( | |
| id INTEGER PRIMARY KEY AUTOINCREMENT, | |
| question TEXT, | |
| answer TEXT, | |
| sort_order INTEGER DEFAULT 0 | |
| )"); | |
| $count = $db->query("SELECT COUNT(*) FROM faq")->fetchColumn(); | |
| if ($count == 0) { | |
| $faqs = [ | |
| ['Quanto tempo per vedere i risultati?', 'Primi segnali in 2–4 settimane (reach/engagement); 1–3 mesi per KPI di business.', 1], | |
| ['Quali piattaforme gestite?', 'Instagram, TikTok, Facebook, YouTube (Shorts) e campagne Meta/TikTok Ads.', 2], | |
| ['Create anche i contenuti?', 'Sì: strategia, shooting foto/video, editing, copy e calendari di pubblicazione.', 3], | |
| ['Come si inizia?', 'Prenota una call: obiettivi, roadmap e preventivo in 48 ore.', 4], | |
| ['Esperienza?', 'Food, retail, hospitality, servizi, DTC e PMI locali.', 5], | |
| ['Dopo posso gestire da solo?', 'Sì, formiamo il tuo team e lasciamo linee guida operative.', 6] | |
| ]; | |
| $stmt = $db->prepare("INSERT INTO faq (question, answer, sort_order) VALUES (?, ?, ?)"); | |
| foreach ($faqs as $f) { | |
| $stmt->execute($f); | |
| } | |
| } | |
| // 8. Solutions (Problem/Solution) | |
| $db->exec("CREATE TABLE IF NOT EXISTS solutions ( | |
| id INTEGER PRIMARY KEY AUTOINCREMENT, | |
| title TEXT, | |
| description TEXT, | |
| sort_order INTEGER DEFAULT 0 | |
| )"); | |
| if ($db->query("SELECT COUNT(*) FROM solutions")->fetchColumn() == 0) { | |
| $sols = [ | |
| ['I limiti attuali ❌', 'Ampio seguito (100k+ follower, milioni di views) ma bassa conversione: contenuti generici e identità poco distintiva.', 1], | |
| ['La nostra soluzione ✅', 'Strategia con contenuti dinamici e autentici (video), format coinvolgenti, pubblicazione costante e storytelling che valorizza qualità ed esperienza.', 2], | |
| ['Focus operativo', 'Ideazione format, shooting, editing e scheduling. Community, analisi e, quando serve, distribuzione paid per scalare.', 3] | |
| ]; | |
| $stmt = $db->prepare("INSERT INTO solutions (title, description, sort_order) VALUES (?, ?, ?)"); | |
| foreach($sols as $s) $stmt->execute($s); | |
| } | |
| // 9. Goals | |
| $db->exec("CREATE TABLE IF NOT EXISTS goals ( | |
| id INTEGER PRIMARY KEY AUTOINCREMENT, | |
| title TEXT, | |
| description TEXT, | |
| sort_order INTEGER DEFAULT 0 | |
| )"); | |
| if ($db->query("SELECT COUNT(*) FROM goals")->fetchColumn() == 0) { | |
| $goals = [ | |
| ['#1 Awareness & Reputazione', 'Diventare destinazione di qualità ad Angri, valorizzando autenticità e cura in ogni dettaglio.', 1], | |
| ['#2 Identità forte', 'Stile distintivo che racconta persone e prodotti, con format interattivi e community.', 2], | |
| ['#3 Esperienza & Qualità', 'Dall’ambiente al servizio fino alle materie prime: un racconto che fidelizza.', 3] | |
| ]; | |
| $stmt = $db->prepare("INSERT INTO goals (title, description, sort_order) VALUES (?, ?, ?)"); | |
| foreach($goals as $g) $stmt->execute($g); | |
| } | |
| // 10. Roadmap | |
| $db->exec("CREATE TABLE IF NOT EXISTS roadmap ( | |
| id INTEGER PRIMARY KEY AUTOINCREMENT, | |
| phase TEXT, -- bold part | |
| detail TEXT, -- muted part | |
| sort_order INTEGER DEFAULT 0 | |
| )"); | |
| if ($db->query("SELECT COUNT(*) FROM roadmap")->fetchColumn() == 0) { | |
| $roads = [ | |
| ['1° mese — Setup e Analisi', 'Audit, posizionamento, definizione KPI e content system.', 1], | |
| ['1°–2° mese — Lancio comunicazione', 'Format, shooting, pubblicazione e prime iterazioni.', 2], | |
| ['3° mese — Crescita awareness', 'Ottimizzazioni e distribuzione per accelerare reach.', 3], | |
| ['4° mese — Focus esperienza', 'Storytelling su qualità e servizio.', 4], | |
| ['5°–6° mese — Consolidamento identità', 'Consistenza visiva e voce del brand.', 5], | |
| ['6° mese — Valutazione & Scaling', 'Dati, learnings, piani di crescita.', 6] | |
| ]; | |
| $stmt = $db->prepare("INSERT INTO roadmap (phase, detail, sort_order) VALUES (?, ?, ?)"); | |
| foreach($roads as $r) $stmt->execute($r); | |
| } | |
| // 11. Bottom Stats | |
| $db->exec("CREATE TABLE IF NOT EXISTS bottom_stats ( | |
| id INTEGER PRIMARY KEY AUTOINCREMENT, | |
| value TEXT, | |
| label TEXT, | |
| sort_order INTEGER DEFAULT 0 | |
| )"); | |
| if ($db->query("SELECT COUNT(*) FROM bottom_stats")->fetchColumn() == 0) { | |
| $bstats = [ | |
| ['+5.000.000', 'Visualizzazioni in organico', 1], | |
| ['+550.000', 'Account raggiunti', 2], | |
| ['+8.000', 'Nuovi follower', 3] | |
| ]; | |
| $stmt = $db->prepare("INSERT INTO bottom_stats (value, label, sort_order) VALUES (?, ?, ?)"); | |
| foreach($bstats as $b) $stmt->execute($b); | |
| } | |
| // 12. About Gallery (Dynamic Photos) | |
| $db->exec("CREATE TABLE IF NOT EXISTS about_gallery ( | |
| id INTEGER PRIMARY KEY AUTOINCREMENT, | |
| image_path TEXT, | |
| sort_order INTEGER DEFAULT 0 | |
| )"); | |
| if ($db->query("SELECT COUNT(*) FROM about_gallery")->fetchColumn() == 0) { | |
| $gallery = [ | |
| ['team.jpg', 1], | |
| ['agenzia.jpg', 2] | |
| ]; | |
| $stmt = $db->prepare("INSERT INTO about_gallery (image_path, sort_order) VALUES (?, ?)"); | |
| foreach($gallery as $g) $stmt->execute($g); | |
| } | |
| echo "Database setup completed successfully!"; | |
| } catch (PDOException $e) { | |
| die("Setup failed: " . $e->getMessage()); | |
| } | |