diff --git a/INSTALLATION.md b/INSTALLATION.md index b0c0eaa..e6363b0 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -73,7 +73,7 @@ mysql -u talpa_user -p talpa_planning -e "SHOW TABLES;" Je zou moeten zien: - block_templates -- commercials +- infomercials - daily_blocks - transmissions @@ -202,7 +202,7 @@ http://talpa-planning.local/ ``` **8.2 Controleer of je het dashboard ziet met:** -- Navigatie menu (Dashboard, Kalender, Blokken, Commercials) +- Navigatie menu (Dashboard, Kalender, Blokken, Infomercials) - Statistieken cards - Snelle acties @@ -220,9 +220,9 @@ http://talpa-planning.local/ - Net5 Ochtendblok (07:30-11:30) - Net5 Middagblok (13:20-13:50) -**9.2 Test Commercial Registratie:** -- Ga naar **Commercials** -- Probeer een test commercial aan te maken: +**9.2 Test Infomercial Registratie:** +- Ga naar **Infomercials** +- Probeer een test infomercial aan te maken: - Titel: "Test Product" - Duur: 00:30:00 - Series Code: TEST01 @@ -231,7 +231,7 @@ http://talpa-planning.local/ **9.3 Test Kalender:** - Ga naar **Kalender** - Controleer of de kalender laadt -- Probeer een commercial te slepen (als je er een hebt aangemaakt) +- Probeer een infomercial te slepen (als je er een hebt aangemaakt) ## Troubleshooting @@ -355,7 +355,7 @@ Bij problemen: - [ ] Webserver geconfigureerd - [ ] Dashboard bereikbaar in browser - [ ] Blok templates zichtbaar -- [ ] Test commercial aangemaakt +- [ ] Test infomercial aangemaakt - [ ] Kalender laadt correct Als alle items zijn afgevinkt, is de installatie succesvol! 🎉 diff --git a/README.md b/README.md index 0a1e3ba..7839ecc 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,10 @@ Een geavanceerd TV-planning systeem voor het beheren en plannen van homeshopping - **Kleurgecodeerde uitzendingen** voor overzichtelijkheid - **Conflict detectie** bij overlappende uitzendingen -### 📺 Commercial Management -- Registratie van commercials via Talpa API +### 📺 Infomercial Management +- Registratie van infomercials via Talpa API - Automatische media asset aanmaak -- Kleurcode toewijzing per commercial +- Kleurcode toewijzing per infomercial - Series code voor groepering - Upload status tracking @@ -102,7 +102,7 @@ chmod 644 api/*.php ├── index.php # Dashboard ├── calendar.php # Kalender planning view ├── blocks.php # Blok template management -├── commercials.php # Commercial management +├── infomercials.php # Infomercial management ├── helpers.php # Helper functies ├── TalpaAPI.php # API wrapper ├── /api # API endpoints @@ -142,9 +142,9 @@ chmod 644 api/*.php - Net5 Ochtend: Ma-Vr, 07:30-11:30 - Net5 Middag: Ma-Vr, 13:20-13:50 -### 2. Commercials Registreren +### 2. Infomercials Registreren -1. Ga naar **Commercials** in het menu +1. Ga naar **Infomercials** in het menu 2. Vul het formulier in: - Product naam - Duur (HH:MM:SS formaat) @@ -165,7 +165,7 @@ chmod 644 api/*.php - Wijzig de starttijd - Kies of je alle uitzendingen wilt herberekenen 4. **Plan uitzendingen:** - - Sleep een commercial uit de sidebar + - Sleep een infomercial uit de sidebar - Drop deze op het gewenste tijdslot - Het systeem berekent automatisch de volgende starttijd 5. **Bewerk uitzendingen:** @@ -184,12 +184,12 @@ chmod 644 api/*.php ## 🎨 Kleurcode Systeem -Het systeem wijst automatisch unieke kleuren toe aan commercials voor visuele identificatie: +Het systeem wijst automatisch unieke kleuren toe aan infomercials voor visuele identificatie: - Kleuren worden automatisch gegenereerd met voldoende contrast -- Elke commercial krijgt een unieke kleur +- Elke infomercial krijgt een unieke kleur - Series codes kunnen dezelfde kleur delen -- Kleuren zijn handmatig aanpasbaar in Commercial Management +- Kleuren zijn handmatig aanpasbaar in Infomercial Management ## 🔧 Geavanceerde Functies @@ -230,12 +230,12 @@ Wanneer je een blok starttijd aanpast: ### Drag-and-drop werkt niet -**Probleem:** Commercials zijn niet sleepbaar +**Probleem:** Infomercials zijn niet sleepbaar **Oplossing:** 1. Controleer of FullCalendar correct is geladen 2. Check browser console voor errors -3. Zorg dat commercials status "uploaded" hebben +3. Zorg dat infomercials status "uploaded" hebben ### API Sync Errors @@ -260,7 +260,7 @@ Wanneer je een blok starttijd aanpast: ``` 2. Controleer of alle kolommen bestaan: ```sql - SHOW COLUMNS FROM commercials LIKE 'color_code'; + SHOW COLUMNS FROM infomercials LIKE 'color_code'; ``` ## 📊 Database Schema @@ -279,7 +279,7 @@ Wanneer je een blok starttijd aanpast: ### Uitgebreide Kolommen -**commercials** +**infomercials** - `color_code` (VARCHAR(7)): Hex kleurcode - `series_code` (VARCHAR(20)): Series identifier @@ -319,7 +319,7 @@ Voor vragen of problemen: ### Versie 1.0.0 (2026-01-13) - ✅ Kalender planning met drag-and-drop - ✅ Blok template management -- ✅ Commercial management met kleurcodes +- ✅ Infomercial management met kleurcodes - ✅ Automatische tijdberekening - ✅ Talpa API integratie - ✅ Conflict detectie @@ -328,7 +328,7 @@ Voor vragen of problemen: ## 🎯 Roadmap Toekomstige features: -- [ ] Bulk import van commercials +- [ ] Bulk import van infomercials - [ ] Excel export van planning - [ ] Email notificaties bij sync errors - [ ] Gebruikersbeheer en rechten diff --git a/api/assign_color.php b/api/assign_color.php index fceda43..918ea18 100644 --- a/api/assign_color.php +++ b/api/assign_color.php @@ -1,7 +1,7 @@ false, - 'error' => 'Missing commercial_id' + 'error' => 'Missing infomercial_id' ], 400); } - // Check if commercial exists - $stmt = $db->prepare("SELECT id, color_code FROM commercials WHERE id = ?"); - $stmt->execute([$input['commercial_id']]); - $commercial = $stmt->fetch(); + // Check if infomercial exists + $stmt = $db->prepare("SELECT id, color_code FROM infomercials WHERE id = ?"); + $stmt->execute([$input['infomercial_id']]); + $infomercial = $stmt->fetch(); - if (!$commercial) { + if (!$infomercial) { jsonResponse([ 'success' => false, - 'error' => 'Commercial not found' + 'error' => 'Infomercial not found' ], 404); } @@ -60,33 +60,33 @@ try { } } else { // Auto-generate distinct color - $stmt = $db->query("SELECT color_code FROM commercials WHERE color_code IS NOT NULL"); + $stmt = $db->query("SELECT color_code FROM infomercials WHERE color_code IS NOT NULL"); $existingColors = $stmt->fetchAll(PDO::FETCH_COLUMN); $colorCode = generateDistinctColor($existingColors); } - // Update commercial + // Update infomercial $stmt = $db->prepare(" - UPDATE commercials + UPDATE infomercials SET color_code = ?, series_code = ? WHERE id = ? "); $stmt->execute([ $colorCode, $input['series_code'] ?? null, - $input['commercial_id'] + $input['infomercial_id'] ]); - // Get updated commercial - $stmt = $db->prepare("SELECT * FROM commercials WHERE id = ?"); - $stmt->execute([$input['commercial_id']]); + // Get updated infomercial + $stmt = $db->prepare("SELECT * FROM infomercials WHERE id = ?"); + $stmt->execute([$input['infomercial_id']]); $updated = $stmt->fetch(); jsonResponse([ 'success' => true, 'message' => 'Color assigned successfully', - 'commercial' => $updated + 'infomercial' => $updated ]); } catch (Exception $e) { diff --git a/api/create_transmission.php b/api/create_transmission.php index fbfef88..de436bb 100644 --- a/api/create_transmission.php +++ b/api/create_transmission.php @@ -25,7 +25,7 @@ try { } // Validate required fields - $required = ['commercial_id', 'channel', 'start_date', 'start_time']; + $required = ['infomercial_id', 'channel', 'start_date', 'start_time']; foreach ($required as $field) { if (empty($input[$field])) { jsonResponse([ @@ -50,15 +50,15 @@ try { ], 400); } - // Get commercial details (duration) - $stmt = $db->prepare("SELECT duration, title FROM commercials WHERE id = ?"); - $stmt->execute([$input['commercial_id']]); - $commercial = $stmt->fetch(); + // Get infomercial details (duration) + $stmt = $db->prepare("SELECT duration, title FROM infomercials WHERE id = ?"); + $stmt->execute([$input['infomercial_id']]); + $infomercial = $stmt->fetch(); - if (!$commercial) { + if (!$infomercial) { jsonResponse([ 'success' => false, - 'error' => 'Commercial not found' + 'error' => 'Infomercial not found' ], 404); } @@ -66,7 +66,7 @@ try { $template = $input['template'] ?? 'HOME030'; // Calculate end time - $endTime = addTimeToTime($input['start_time'], $commercial['duration']); + $endTime = addTimeToTime($input['start_time'], $infomercial['duration']); // Validate that transmission falls within a block (inline to avoid curl issues) ensureDailyBlocks($db, $input['start_date'], $input['start_date']); @@ -126,7 +126,7 @@ try { $stmt = $db->prepare(" SELECT t.id, t.start_time, t.duration, c.title FROM transmissions t - JOIN commercials c ON t.commercial_id = c.id + JOIN infomercials c ON t.infomercial_id = c.id WHERE t.start_date = ? AND t.channel = ? AND t.id != ? @@ -152,17 +152,17 @@ try { // Insert transmission $stmt = $db->prepare(" INSERT INTO transmissions - (commercial_id, channel, template, start_date, start_time, duration, api_status) + (infomercial_id, channel, template, start_date, start_time, duration, api_status) VALUES (?, ?, ?, ?, ?, ?, 'pending') "); $stmt->execute([ - $input['commercial_id'], + $input['infomercial_id'], $input['channel'], $template, $input['start_date'], $input['start_time'], - $commercial['duration'] + $infomercial['duration'] ]); $transmissionId = $db->lastInsertId(); @@ -175,7 +175,7 @@ try { c.color_code, c.series_code FROM transmissions t - JOIN commercials c ON t.commercial_id = c.id + JOIN infomercials c ON t.infomercial_id = c.id WHERE t.id = ? "); $stmt->execute([$transmissionId]); diff --git a/api/get_transmissions.php b/api/get_transmissions.php index 5ebb747..e2867ca 100644 --- a/api/get_transmissions.php +++ b/api/get_transmissions.php @@ -29,7 +29,7 @@ try { $sql = " SELECT t.id, - t.commercial_id, + t.infomercial_id, t.channel, t.template, t.start_date, @@ -40,7 +40,7 @@ try { c.color_code, c.series_code FROM transmissions t - JOIN commercials c ON t.commercial_id = c.id + JOIN infomercials c ON t.infomercial_id = c.id WHERE t.start_date BETWEEN ? AND ? "; @@ -79,7 +79,7 @@ try { 'borderColor' => $tx['color_code'] ?? '#cccccc', 'textColor' => '#ffffff', 'extendedProps' => [ - 'commercial_id' => $tx['commercial_id'], + 'infomercial_id' => $tx['infomercial_id'], 'template' => $tx['template'], 'duration' => $tx['duration'], 'api_status' => $tx['api_status'], diff --git a/api/insert_transmission_at_position.php b/api/insert_transmission_at_position.php index bd5ed9c..e18faea 100644 --- a/api/insert_transmission_at_position.php +++ b/api/insert_transmission_at_position.php @@ -25,7 +25,7 @@ try { } // Validate required fields - $required = ['commercial_id', 'channel', 'date', 'block_id', 'position']; + $required = ['infomercial_id', 'channel', 'date', 'block_id', 'position']; foreach ($required as $field) { if (!isset($input[$field])) { jsonResponse([ @@ -35,15 +35,15 @@ try { } } - // Get commercial duration - $stmt = $db->prepare("SELECT duration FROM commercials WHERE id = ?"); - $stmt->execute([$input['commercial_id']]); + // Get infomercial duration + $stmt = $db->prepare("SELECT duration FROM infomercials WHERE id = ?"); + $stmt->execute([$input['infomercial_id']]); $duration = $stmt->fetchColumn(); if (!$duration) { jsonResponse([ 'success' => false, - 'error' => 'Commercial not found' + 'error' => 'Infomercial not found' ], 404); } @@ -58,7 +58,7 @@ try { $stmt = $db->prepare(" SELECT t.id, t.start_time, c.duration FROM transmissions t - JOIN commercials c ON t.commercial_id = c.id + JOIN infomercials c ON t.infomercial_id = c.id WHERE t.start_date = ? AND t.channel = ? AND t.start_time >= ? AND t.start_time < ? ORDER BY t.start_time ASC @@ -71,7 +71,7 @@ try { // Create temporary transmission entry $newTransmission = [ - 'commercial_id' => $input['commercial_id'], + 'infomercial_id' => $input['infomercial_id'], 'duration' => $duration ]; @@ -86,11 +86,11 @@ try { // Insert new transmission $stmt = $db->prepare(" INSERT INTO transmissions - (commercial_id, channel, template, start_date, start_time, duration, api_status) + (infomercial_id, channel, template, start_date, start_time, duration, api_status) VALUES (?, ?, 'HOME030', ?, ?, ?, 'pending') "); $stmt->execute([ - $input['commercial_id'], + $input['infomercial_id'], $input['channel'], $input['date'], $currentTime, diff --git a/api/sync_block.php b/api/sync_block.php index 8437b46..3426485 100644 --- a/api/sync_block.php +++ b/api/sync_block.php @@ -47,7 +47,7 @@ try { $stmt = $db->prepare(" SELECT t.*, c.content_id, c.title as commercial_title FROM transmissions t - JOIN commercials c ON t.commercial_id = c.id + JOIN infomercials c ON t.infomercial_id = c.id WHERE t.start_date = ? AND t.channel = ? AND t.api_status != 'synced' diff --git a/api/update_block_time.php b/api/update_block_time.php index 0cdad56..437e515 100644 --- a/api/update_block_time.php +++ b/api/update_block_time.php @@ -107,7 +107,7 @@ try { $stmt = $db->prepare(" SELECT t.id, t.start_time, c.duration FROM transmissions t - JOIN commercials c ON t.commercial_id = c.id + JOIN infomercials c ON t.infomercial_id = c.id WHERE t.start_date = ? AND t.channel = ? ORDER BY t.start_time ASC "); diff --git a/api/update_transmission.php b/api/update_transmission.php index 5c62428..8c1b34b 100644 --- a/api/update_transmission.php +++ b/api/update_transmission.php @@ -36,7 +36,7 @@ try { $stmt = $db->prepare(" SELECT t.*, c.duration FROM transmissions t - JOIN commercials c ON t.commercial_id = c.id + JOIN infomercials c ON t.infomercial_id = c.id WHERE t.id = ? "); $stmt->execute([$input['id']]); @@ -136,7 +136,7 @@ try { $stmt = $db->prepare(" SELECT t.id, t.start_time, t.duration, c.title FROM transmissions t - JOIN commercials c ON t.commercial_id = c.id + JOIN infomercials c ON t.infomercial_id = c.id WHERE t.start_date = ? AND t.channel = ? AND t.id != ? @@ -175,7 +175,7 @@ try { c.color_code, c.series_code FROM transmissions t - JOIN commercials c ON t.commercial_id = c.id + JOIN infomercials c ON t.infomercial_id = c.id WHERE t.id = ? "); $stmt->execute([$input['id']]); diff --git a/assets/css/custom.css b/assets/css/custom.css index 28cefbf..87aa5f9 100644 --- a/assets/css/custom.css +++ b/assets/css/custom.css @@ -238,8 +238,8 @@ body { border-right: 3px solid rgba(0,0,0,0.2); } -/* Commercial Sidebar */ -.commercial-sidebar { +/* Infomercial Sidebar */ +.infomercial-sidebar { max-height: 600px; overflow-y: auto; background: #f8f9fa; @@ -247,7 +247,7 @@ body { padding: 15px; } -.commercial-item { +.infomercial-item { background: white; border-radius: 6px; padding: 12px; @@ -258,27 +258,27 @@ body { box-shadow: 0 1px 3px rgba(0,0,0,0.1); } -.commercial-item:hover { +.infomercial-item:hover { transform: translateX(5px); box-shadow: 0 2px 8px rgba(0,0,0,0.15); } -.commercial-item.dragging { +.infomercial-item.dragging { opacity: 0.5; } -.commercial-title { +.infomercial-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; } -.commercial-duration { +.infomercial-duration { font-size: 0.85rem; color: #6c757d; } -.commercial-series { +.infomercial-series { font-size: 0.8rem; font-weight: 500; opacity: 0.8; @@ -336,7 +336,7 @@ body { /* Responsive */ @media (max-width: 768px) { - .commercial-sidebar { + .infomercial-sidebar { max-height: 300px; margin-bottom: 20px; } @@ -347,21 +347,21 @@ body { } /* Scrollbar Styling */ -.commercial-sidebar::-webkit-scrollbar { +.infomercial-sidebar::-webkit-scrollbar { width: 8px; } -.commercial-sidebar::-webkit-scrollbar-track { +.infomercial-sidebar::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; } -.commercial-sidebar::-webkit-scrollbar-thumb { +.infomercial-sidebar::-webkit-scrollbar-thumb { background: #888; border-radius: 4px; } -.commercial-sidebar::-webkit-scrollbar-thumb:hover { +.infomercial-sidebar::-webkit-scrollbar-thumb:hover { background: #555; } @@ -475,7 +475,7 @@ body { @media print { .navbar, .btn, - .commercial-sidebar { + .infomercial-sidebar { display: none !important; } diff --git a/assets/js/calendar-init.js b/assets/js/calendar-init.js index 07abb7b..ed57468 100644 --- a/assets/js/calendar-init.js +++ b/assets/js/calendar-init.js @@ -174,7 +174,7 @@ document.addEventListener('DOMContentLoaded', function() { // Event resize (change duration) eventResize: function(info) { - showAlert('warning', 'Duur aanpassen is niet toegestaan. Gebruik de commercial instellingen.'); + showAlert('warning', 'Duur aanpassen is niet toegestaan. Gebruik de infomercial instellingen.'); info.revert(); }, @@ -185,7 +185,7 @@ document.addEventListener('DOMContentLoaded', function() { // Event receive (when external event is dropped) eventReceive: function(info) { const event = info.event; - const commercialId = event.extendedProps.commercial_id || info.draggedEl.dataset.commercialId; + const commercialId = event.extendedProps.infomercial_id || info.draggedEl.dataset.commercialId; const resourceId = event.getResources()[0]?.id || 'SBS9'; // Remove the temporary event @@ -214,7 +214,7 @@ document.addEventListener('DOMContentLoaded', function() { 'Content-Type': 'application/json' }, body: JSON.stringify({ - commercial_id: commercialId, + infomercial_id: commercialId, channel: resourceId, start_date: dropDate, start_time: startTime @@ -309,10 +309,10 @@ document.addEventListener('DOMContentLoaded', function() { }); /** - * Initialize draggable commercials from sidebar + * Initialize draggable infomercials from sidebar */ function initDraggableCommercials() { - const commercialItems = document.querySelectorAll('.commercial-item'); + const commercialItems = document.querySelectorAll('.infomercial-item'); commercialItems.forEach(item => { new FullCalendar.Draggable(item, { @@ -323,7 +323,7 @@ function initDraggableCommercials() { backgroundColor: eventEl.dataset.color, borderColor: eventEl.dataset.color, extendedProps: { - commercial_id: eventEl.dataset.commercialId, + infomercial_id: eventEl.dataset.commercialId, series_code: eventEl.dataset.seriesCode } }; @@ -469,10 +469,10 @@ function showAlert(type, message) { } /** - * Filter commercials in sidebar + * Filter infomercials in sidebar */ function filterCommercials(searchTerm) { - const items = document.querySelectorAll('.commercial-item'); + const items = document.querySelectorAll('.infomercial-item'); const term = searchTerm.toLowerCase(); items.forEach(item => { diff --git a/blocks.php b/blocks.php index fe4728c..252c3e4 100644 --- a/blocks.php +++ b/blocks.php @@ -114,7 +114,7 @@ $dayNames = [ Excel Planner Kalender Blokken - Commercials + Infomercials diff --git a/calendar.php b/calendar.php index bab7b68..8a7f8e3 100644 --- a/calendar.php +++ b/calendar.php @@ -17,30 +17,30 @@ $dotenv->load(); $db = getDbConnection(); -// Get all commercials with colors for sidebar -$commercials = $db->query(" +// Get all infomercials with colors for sidebar +$infomercials = $db->query(" SELECT id, title, duration, color_code, series_code, upload_status - FROM commercials + FROM infomercials WHERE upload_status = 'uploaded' ORDER BY title ASC ")->fetchAll(); -// Auto-assign colors to commercials without colors -foreach ($commercials as $commercial) { - if (empty($commercial['color_code'])) { - $stmt = $db->query("SELECT color_code FROM commercials WHERE color_code IS NOT NULL"); +// Auto-assign colors to infomercials without colors +foreach ($infomercials as $infomercial) { + if (empty($infomercial['color_code'])) { + $stmt = $db->query("SELECT color_code FROM infomercials WHERE color_code IS NOT NULL"); $existingColors = $stmt->fetchAll(PDO::FETCH_COLUMN); $newColor = generateDistinctColor($existingColors); - $stmt = $db->prepare("UPDATE commercials SET color_code = ? WHERE id = ?"); - $stmt->execute([$newColor, $commercial['id']]); + $stmt = $db->prepare("UPDATE infomercials SET color_code = ? WHERE id = ?"); + $stmt->execute([$newColor, $infomercial['id']]); } } -// Refresh commercials after color assignment -$commercials = $db->query(" +// Refresh infomercials after color assignment +$infomercials = $db->query(" SELECT id, title, duration, color_code, series_code, upload_status - FROM commercials + FROM infomercials WHERE upload_status = 'uploaded' ORDER BY title ASC ")->fetchAll(); @@ -74,7 +74,7 @@ $commercials = $db->query(" Excel Planner Kalender Blokken - Commercials + Infomercials @@ -128,12 +128,12 @@ $commercials = $db->query("