Skip to main content
GrN.dk

Main navigation

  • Articles
  • Cases
  • Contact
  • Your Digital Project Manager
  • About Greg Nowak
  • Services
  • Portfolio
  • Container
    • Excel Freelancer
    • Kubuntu - tips and tricks
    • Linux Apache MySQL and PHP
    • News
    • Image Gallery
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

 

Illustrated infographic summarizing: AI Agents Need a Spending Brake, Not Just a Billing Dashboard
AI Agents Need a Spending Brake, Not Just a Billing Dashboard
2026-08-08

AI agent costs can climb inside a single workflow. Runtime budgets, loop detection, outcome metrics, and safe handoffs keep that spending under control.

Illustrated infographic summarizing: Drupal 12 Slipped to December. Drupal 10 Still Runs Out of Road
Drupal 12 Slipped to December. Drupal 10 Still Runs Out of Road
2026-08-07

Drupal 12 arrives as Drupal 10 support ends in December 2026. Moving to Drupal 11.3+ first keeps two mandatory upgrades manageable.

Illustrated infographic summarizing: EU OpenAI Residency Is a Migration Project, Not a Dashboard Toggle
EU OpenAI Residency Is a Migration Project, Not a Dashboard Toggle
2026-08-05

An EU-resident OpenAI API setup needs a new project, regional routing, dependency and state migration, compatibility testing, and clear governance evidence.

Illustrated infographic summarizing: AI Images Need a Chain of Custody, Not Just a Disclosure Label
AI Images Need a Chain of Custody, Not Just a Disclosure Label
2026-08-04

AI image labels are only the endpoint. Learn how to test C2PA credentials through editing, CMS, CDN and agency handoffs while preserving evidence.

Illustrated infographic summarizing: MCP Just Went Stateless: Audit the Integrations Behind Your AI Tools
MCP Just Went Stateless: Audit the Integrations Behind Your AI Tools
2026-08-03

The 28 July 2026 MCP release removes protocol sessions and changes discovery, tasks, caching, OAuth and tracing. A practical guide to auditing the move.

Illustrated infographic summarizing: SEO Trends for 2026: What Actually Changed Since 2024
SEO Trends for 2026: What Actually Changed Since 2024
2026-08-03

A practical guide to what changed in SEO between 2024 and 2026, from AI and multimodal search to Core Web Vitals, privacy and local visibility.

Illustrated infographic summarizing: INP and Green SEO Share a Backlog: Cut the Work Every Visit Repeats
INP and Green SEO Share a Backlog: Cut the Work Every Visit Repeats
2026-08-03

INP and sustainable web work often expose the same waste. Use field data, profiling, caching and performance budgets to build one practical backlog.

Illustrated infographic summarizing: AI crawler policy now has verbs: separate search, RAG, and training
AI crawler policy now has verbs: separate search, RAG, and training
2026-08-02

AI crawler rules now need separate decisions for search, RAG, and training, backed by practical testing across robots.txt, CDNs, WAFs, and CMS controls.

Illustrated infographic summarizing: WordPress Supports Old PHP; Your Production Server Shouldn’t
WordPress Supports Old PHP; Your Production Server Shouldn’t
2026-08-01

WordPress still runs on legacy PHP, but compatibility is not a security policy. Build and test your upgrade path before PHP 8.2 support ends.

Illustrated infographic summarizing: The AI-built tool your team relies on needs an owner
The AI-built tool your team relies on needs an owner
2026-07-31

AI-built internal tools can become business-critical before anyone owns them. Here is how to secure, review, monitor, and retire them without blocking useful work.

More articles
RSS feed

Footer

  • All articles
  • Contact

GrN.dk web platforms, web optimization, data analysis, data handling and logistics.