Log inRegister

Reservaties

31 October 2025 - 21:04 | Version 2 |

Via admin interface

  • kies links Reservaties
  • kies onderaan rechts bij 'Totaal aantal items': x / 500
  • selecteer de gewenste records (of alle via de checkbox in de kolomheader)
  • kies onderaa links bij 'Kies actie' de optie 'Export'

Commentaarveld met line breaks - line breaks vervangen door spaties

Vraag van IA van Theater Stam:
Een tweede probleempje is dat één record over meerdere lijnen verdeeld wordt als in het commentaarveld 'Enter' gebruikt wordt.

De oplossing bestond erin de "end of lines" die in een cel staan, te vervangen door een spatie:

pjCSV.component.php v1.0.1 - Theater Stam

...\core\framework\components\pjCSV.component.php:

line 119 toegevoegd (beginnend met $value =):
foreach ($item as $value)
{
$value = str_replace(array("\r\n", "\n", "\r"), ' ', $value);
$cells[] = $this->enclose . preg_replace('/'.$this->enclose.'/', $this->escape . $this->enclose, $value) . $this->enclose;
}

pjCSV.component.php v1.5.4 - Kwamarant

...\core\framework\components\pjCSV.component.php:

line 188 toegevoegd (beginnend met $value =):
foreach ($item as $value)
{
   if ($ii > 0)
   {
      $str .= $this->delimiter;
   }
   $value = str_replace(array("\r\n", "\n", "\r"), ' ', $value);
   $str .= $this->enclose . preg_replace('/'.$this->enclose.'/', $this->escape . $this->enclose, $value) . $this->enclose;
   $ii++;
}

Via phpMyAdmin - VIEW

Create

Bovenstaande (via admin interface) werkt goed zolang je niet meer dan 500 reservaties hebt.

Volgende SQL query:
SELECT
   unique_id as `Reservatie-ID`,
   created as Reservatietijdstip, 
   concat(from_unixtime(event_start_ts), ' - ', m.content) as Voorstelling,
   customer_name as Naam,
   customer_email as `E-mailadres`,
   customer_phone as `Telefoonnr.`,
   customer_people as Tickets,
   booking_total as Totaalbedrag, 
   case when booking_status = 'confirmed' then 'bevestigd' 
        when booking_status = 'cancelled' then 'geannuleerd' 
        else booking_status
   end as Status,
   coalesce(replace(customer_notes, '\n', ''), '') as Opmerkingen
FROM `eventbooking_bookings` b
, `eventbooking_events` e
, `eventbooking_multi_lang` m
where b.event_id = e.id
and e.id = m.foreign_id
and m.model = 'pjEvent'
and m.locale = 1
and m.field = 'location';
  • Voer de query uit en scroll helemaal naar beneden.
  • Kies onderaan de optie VIEW aanmaken.
  • In het venster dat verschijnt, vul enkel 'VIEW-naam' in: reservaties
  • klik onderaan rechts op Starten
  • de view wordt gecreëerd

Export

  • Ga nu in de interface van phpMyAdmin naar Views
  • en klik op reservaties.
  • Klik dan bovenaan op Exporteren.
  • Kies bij Indeling voor CSV for MS Excel
  • Klik op de knop Exporteren.
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback