Skip to main content
Home
GrN.dk

Main navigation

  • Articles
  • Cases
  • Services
  • Your Digital Project Manager
  • About Greg Nowak
  • Image Gallery
  • Contact
User account menu
  • Log in

Join my community / free newsletter — sign up here

Breadcrumb

  1. Home
  2. Cases

Pay-to-book table reservations for a coworking space

Client
Danish coworking space — client brief, built as a working demo
Sector
Coworking and shared offices
Period
July 2026

tableflow.grn.dk ↗

The TableFlow booking page: the hour grid for Bord 4 on 19 August 2026, with three hours struck through as taken, 10:00-12:00 selected in green, and the price updated live to 40 kr.

At a glance

A Danish coworking space wanted members to book a table by the hour and pay for it — because at 20 kr. per hour per table, a booking that has not been paid for is not a booking. tableflow.grn.dk is that system, built from the client's brief and running live: an hour grid that shows what is actually free, a fifteen-minute payment hold that releases itself, and an admin screen for the people who run the place. Plain PHP and MariaDB — no framework, no dependencies, 853 lines in seven files.

853 lines in 7 files — no framework, no dependencies
20 kr. per hour per table, priced live while you pick the hours
15-minute payment hold that releases itself — no cron job

The challenge

The brief was short and unusually clear: PHP and a MySQL database; pick a date, a table and a from/to time; whole hours only and only inside opening hours; register name, e-mail and phone; 20 kr. per hour per table — and the table is not reserved until it has been paid for. Responsive, works well on a phone. Functional.

That one clause about payment is what turns a booking form into a small concurrency problem. The slot has to be held while the visitor pays, but not held forever if they wander off. Two people clicking the same hour in the same second must not both come away thinking they own it. And an expired, unpaid hold has to free itself — nobody at a coworking space is going to remember to sweep the table.

The solution

TableFlow is a deliberately small PHP 8.3 application on MariaDB, talking to the database through PDO with prepared statements. No framework, no Composer, no build step: 853 lines across seven files — four pages, a shared library, one stylesheet and a config file that lives outside the web root.

Booking. Choosing a date and a table redraws an hour grid where every hour is either free or struck through as taken. Clicking a free hour sets the start, clicking a later one extends the range across contiguous free hours only, and the price recalculates as you go — then gets recalculated again on the server, because the browser is a convenience and never the authority. Opening hours are a config table (Mon-Fri 08-20, Sat 09-16, Sunday closed), closed days say so instead of offering slots, and hours that have already passed today cannot be booked.

The hold, without a cron job. "This slot is blocked" is defined once, as a single SQL condition: the reservation is paid, or it was created within the last fifteen minutes. The grid, the booking check and the payment step all reuse that one definition, so an unpaid hold simply stops blocking when it ages out. Nothing has to run on a schedule, and there is no cleanup job to fail quietly.

Not double-booking. The insert runs inside a transaction that first selects the overlapping reservations FOR UPDATE. Two simultaneous bookings of the same hour serialise against each other, and the one that loses is told the time was just taken rather than being handed a phantom reservation. The payment step repeats the check, in case the hold expired while the visitor was paying and somebody else took the slot in the meantime.

Payment and the receipt. The payment page is reached through a random 32-character token, so a reservation is only visible to whoever made it. The button itself is an honest simulation, labelled in the UI as the swap-in point for MobilePay or a card gateway; paying flips the reservation to Betalt, stamps the time and turns the page into a receipt.

Admin. A password-protected screen lists upcoming reservations (or all of them), and lets whoever runs the space mark a booking paid — for cash, say — mark it unpaid again, or delete it. Unpaid holds past the window are flagged Udløbet: the time is free again, but it can still be settled manually if nobody else has taken it.

Everywhere else. Every POST carries a CSRF token, the booking form has a honeypot for bots, and date, time range, name, e-mail and phone are all validated server-side. The interface is Danish, mobile-first, and follows the visitor's light or dark system setting.

Delivery included the hosting: its own virtual host running under a dedicated tableflow system user, its own git repository, a database user scoped to just this application, credentials in a file the web root cannot serve, a Let's Encrypt certificate and an HTTP-to-HTTPS redirect, behind Cloudflare.

The results

The system has been live at tableflow.grn.dk since 23 July 2026 and was verified end to end before hand-over: a booking through to payment, a rejected double booking, the admin actions, and the closed-day guard.

Being 853 lines with no dependencies is the point rather than a boast. There is no framework to upgrade, no plugin tree to audit and no build that can break on a Tuesday — the code that runs is the code that was written, and a change to opening hours or the hourly rate is one line in a config file.

It is a demo, and it says so: the payment button simulates a transaction and the admin password is printed on its own login screen. Making it a production system for a specific coworking space is a scoped piece of work — a real payment gateway, proper admin accounts, the sample data cleared — not a rewrite.

“Man har først reserveret bordet, når man har betalt.” — the table is not reserved until it has been paid for.

The client brief that ordered this build
  • php
  • MariaDB
  • Custom Development
  • Responsive design
  • web development

Got a project that needs the same kind of hands-on delivery?

Your digital project manager

Review Greg on Google

Greg Nowak Google Reviews

 

Written recommendations from Trafik og Veje, Aarhus Municipality (2011) and AgroTech (2010) — read them on LinkedIn.

Illustrated infographic summarizing: WordPress 7.1 Forces the Editor Into an iframe—Test Your Custom Blocks
WordPress 7.1 Forces the Editor Into an iframe—Test Your Custom Blocks
2026-08-15

WordPress 7.1 removes the non-iframe editor fallback. Learn how to audit custom blocks, test real workflows and fix compatibility issues before launch.

Illustrated infographic summarizing: GitHub will stop sending jobs to stale self-hosted runners
GitHub will stop sending jobs to stale self-hosted runners
2026-08-14

GitHub starts enforcing runner versions on August 24, 2026. Audit and upgrade self-hosted runners before builds and deployments start stalling.

Illustrated infographic summarizing: Your AI Agent Has Shell Access. What Can It Reach?
Your AI Agent Has Shell Access. What Can It Reach?
2026-08-13

A practical guide to mapping what a shell-enabled AI agent can reach, then containing its access to files, credentials, networks, tools, and high-impact actions.

Illustrated infographic summarizing: Cloudflare Changed DoH JSON. What Else Is Parsing DNS as Text?
Cloudflare Changed DoH JSON. What Else Is Parsing DNS as Text?
2026-08-12

Cloudflare’s DoH JSON change exposes brittle DNS parsing. Find affected scripts, test both formats, and choose a safer integration contract.

Illustrated infographic summarizing: Your Website Can Answer Questions Now. Should It?
Your Website Can Answer Questions Now. Should It?
2026-08-11

NLWeb makes conversational website search practical to deploy. The real question is whether your content, users and team are ready to support it.

Illustrated infographic summarizing: AI Search Finally Has Reports. Now Connect Visibility to Revenue
AI Search Finally Has Reports. Now Connect Visibility to Revenue
2026-08-11

Google and Bing now expose first-party AI search data. The real task is connecting citations and impressions to analytics, CRM outcomes, and revenue.

Illustrated infographic summarizing: The Bot Passed Your CAPTCHA. What Did It Do Next?
The Bot Passed Your CAPTCHA. What Did It Do Next?
2026-08-11

Passing a challenge is only one signal. Session analysis, server-side validation and endpoint-specific controls help reduce bot abuse without blocking customers.

Illustrated infographic summarizing: WordPress 7.1 Moves Image Work Into the Browser—Test Every Media Hook
WordPress 7.1 Moves Image Work Into the Browser—Test Every Media Hook
2026-08-11

WordPress 7.1 shifts image processing into supported browsers. Here is what to test across hooks, CDNs, formats, security headers, and fallbacks.

Illustrated infographic summarizing: Prompt Caches Have Write Costs Now—Audit What Your Workflow Reuses
Prompt Caches Have Write Costs Now—Audit What Your Workflow Reuses
2026-08-10

GPT-5.6 makes cache writes billable. See how to spot wasted writes, stabilise prompt prefixes, place breakpoints and measure whether caching pays.

Illustrated infographic summarizing: The AI Crawler in Your Logs May Be Wearing a Borrowed Name
The AI Crawler in Your Logs May Be Wearing a Borrowed Name
2026-08-09

A User-Agent is a claim, not proof. See how to verify AI crawler traffic before it shapes reporting, robots.txt decisions, or WAF exceptions.

More articles
RSS feed

Footer

  • All articles
  • Contact

GrN.dk — AI automation, web platforms, web optimization, data handling and logistics.

© 2026 GrN.dk · LinkedIn · Contact · AI automation in Danish: nowa.dk

Behind GrN.dk: Individual Entrepreneur Codecrafter · Tax ID 305669096 · Bakhtrioni St. 22, 0194 Tbilisi, Georgia · official business register