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: What Are Customers Asking? Let AI Find the Patterns in Support Tickets
What Are Customers Asking? Let AI Find the Patterns in Support Tickets
2026-09-04

AI-based ticket analysis can uncover recurring complaints, product defects and gaps in documentation—without the company needing yet another chatbot.

Illustrated infographic summarizing: OpenAI Has Machine Identity Now. Which Jobs Should Lose API Keys?
OpenAI Has Machine Identity Now. Which Jobs Should Lose API Keys?
2026-09-03

OpenAI’s X.509 workload identity can replace API keys for the right workloads. This practical framework helps teams decide where to start safely.

Illustrated infographic summarizing: WordPress 7.1 Exposes AI-Ready Actions. Who Gets to Run Them?
WordPress 7.1 Exposes AI-Ready Actions. Who Gets to Run Them?
2026-09-02

WordPress 7.1 helps AI agents discover and invoke site abilities. Here is how to keep exposure, authentication and permission firmly separate.

Illustrated infographic summarizing: From Sales Meeting to CRM: Automate Follow-Up Without Compromising Data Quality
From Sales Meeting to CRM: Automate Follow-Up Without Compromising Data Quality
2026-09-01

How to use AI for meeting notes and follow-up while fixed rules protect CRM data, customer matching and the sales pipeline from errors and premature changes.

Illustrated infographic summarizing: Your AI Gateway Can Name the User. Decide What That Log Is For
Your AI Gateway Can Name the User. Decide What That Log Is For
2026-08-31

Identity-aware AI Gateway logs can sharpen security and cost control, but only when attribution, access, retention, guardrails, and response are clearly defined.

Illustrated infographic summarizing: Zero Data Retention Is a Workflow Audit, Not a Checkbox
Zero Data Retention Is a Workflow Audit, Not a Checkbox
2026-08-30

Zero Data Retention covers the provider, not every copy in your stack. See how to audit endpoints, logs, storage, deletion and project-level controls.

Illustrated infographic summarizing: MCP 2026-07-28 Is an Auth Migration, Not a Version Bump
MCP 2026-07-28 Is an Auth Migration, Not a Version Bump
2026-08-29

MCP’s July 2026 release removes protocol sessions and tightens OAuth. Here’s a practical plan for migrating clients, servers and enterprise access safely.

Illustrated infographic summarizing: Turn a Technician’s Voice Note into a Work Order—Not Raw Audio
Turn a Technician’s Voice Note into a Work Order—Not Raw Audio
2026-08-28

Voice input can reduce the technician’s documentation burden when hours, materials and status are validated before the information is saved in the work order system.

Illustrated infographic summarizing: ChatGPT Disabled Personal Knowledge Sync. What Broke on Your Team?
ChatGPT Disabled Personal Knowledge Sync. What Broke on Your Team?
2026-08-27

ChatGPT retired personal sync connections for Enterprise and Edu. Here is how to find affected workflows, migrate access, and test permissions.

Illustrated infographic summarizing: Cloudflare’s September Bot Defaults Could Quietly Cut AI Visibility
Cloudflare’s September Bot Defaults Could Quietly Cut AI Visibility
2026-08-26

Cloudflare’s September bot defaults give publishers more control, but one training block could also cut search crawling and AI-driven discovery.

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