DOWNLOADS WIDGET v1.0 — Fase 1
================================

MAPSTRUCTUUR
------------
widget/
  index.php        ← Voorkant (embed via iframe)
  download.php     ← Bestandsservering
  admin.php        ← Beheerscherm (komt in fase 2)
  config.php       ← Configuratie & wachtwoord
  functies.php     ← Gedeelde functies
  data.json        ← Alle data (geen database nodig)
  .htaccess        ← Beveiligingsregels
  uploads/         ← Gewone bestanden (publiek bereikbaar)
  import/          ← Grote bestanden hier neerzetten via FTP/CPanel
  assets/          ← CSS/JS hulpbestanden (toekomstig gebruik)

BUITEN public_html (automatisch aangemaakt door widget):
  beveiligd_downloads/  ← Beveiligde bestanden (niet via URL bereikbaar)

INSTALLATIE
-----------
1. Upload de volledige widget/ map naar uw server via CPanel File Manager of FTP.
   Aanbevolen locatie: /public_html/downloads/

2. Zorg dat de map schrijfbaar is (permissions 755 voor mappen, 644 voor bestanden).
   data.json moet schrijfbaar zijn: chmod 664 data.json

3. Open https://uwsite.nl/downloads/admin.php in uw browser.
   Standaard wachtwoord: admin
   WIJZIG DIT DIRECT na eerste login!

4. Embed de widget op uw HTML-pagina via iframe:
   <iframe src="https://uwsite.nl/downloads/index.php"
           width="100%" height="600"
           frameborder="0" scrolling="auto"
           style="border:none; width:100%">
   </iframe>

   TIP: Voor automatische hoogte pas de iframe aan met JavaScript:
   <iframe id="widget" src="..." onload="this.style.height=this.contentDocument.body.scrollHeight+'px'"></iframe>

VEREISTEN
---------
- PHP 8.1 of hoger
- PHP-extensie: json (standaard aan)
- PHP-extensie: fileinfo (voor MIME-detectie, standaard aan op CPanel)
- Apache met mod_rewrite en .htaccess ondersteuning

BEVEILIGDE MAP BUITEN PUBLIC_HTML
----------------------------------
Bij Alphosting en de meeste CPanel-hostings heeft u een map boven public_html.
De widget probeert deze automatisch aan te maken als:
  /home/uwgebruikersnaam/beveiligd_downloads/

Als dit niet lukt, maakt u de map handmatig aan via CPanel File Manager
en geeft u deze permissions 700.

FASE 1 BEVAT
------------
✅ Voorkant volledig werkend (index.php)
✅ Bestandsservering met downloadteller (download.php)
✅ JSON-opslag structuur (data.json)
✅ Configuratiebestand (config.php)
✅ Gedeelde functies (functies.php)
✅ Beveiligingsregels (.htaccess)

VOLGENDE FASE
-------------
Fase 2: Beheerscherm — inloggen, bestanden beheren, importeren
