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

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: One Timeout, Two Orders: Make AI Actions Safe to Retry
One Timeout, Two Orders: Make AI Actions Safe to Retry
2026-07-25

A timed-out AI action may already have succeeded. Stable keys, durable ledgers, queues and stored results prevent a routine retry from duplicating real work.

Illustrated infographic summarizing: Your AI Visibility Dashboard Needs a Methodology, Not More Charts
Your AI Visibility Dashboard Needs a Methodology, Not More Charts
2026-07-24

A practical framework for measuring AI-search visibility with fixed prompts, repeated tests, separate metrics, retained evidence, and honest reporting.

Illustrated infographic summarizing: AI Admin APIs Are Here—But Your Directory Is Still the Source of Truth
AI Admin APIs Are Here—But Your Directory Is Still the Source of Truth
2026-07-23

New AI admin APIs can automate access and spend controls, but reliable governance still starts with authoritative directory data and clear ownership.

Illustrated infographic summarizing: OpenAI Presence Arrived—But Is Your Workflow Ready for an Agent?
OpenAI Presence Arrived—But Is Your Workflow Ready for an Agent?
2026-07-22

Before an AI agent can take on real work, its workflow needs clear scope, permissions, handoffs, evaluation cases, and production monitoring.

Illustrated infographic summarizing: Chatbot Transcripts Quietly Became a Retention and Redaction Problem
Chatbot Transcripts Quietly Became a Retention and Redaction Problem
2026-07-21

Chatbot transcripts spread across providers, logs and support tools. Here is how to map each copy, redact sensitive data and test deletion properly.

Illustrated infographic summarizing: Cloudflare Service Keys Stop in September: Find Every Caller
Cloudflare Service Keys Stop in September: Find Every Caller
2026-07-20

Cloudflare Service Keys stop working on September 30, 2026. Here is how to find every caller, move to scoped API tokens and avoid a late outage.

Illustrated infographic summarizing: Your AI Workflow Needs an Acceptance Test Before It Meets Customers
Your AI Workflow Needs an Acceptance Test Before It Meets Customers
2026-07-19

A practical way to test AI workflows using realistic scenarios, tool checks, human rubrics, regression suites, and clear release gates.

Three cover candidates for The Goats Were Load-Bearing fanned on a dark background: an ember-lit door, three slow knocks, and a founders' ledger
The Goats Were Load-Bearing: a fantasy where the bill always comes due
2026-07-19

A teaser for the upcoming darkly comic fantasy novel The Goats Were Load-Bearing — a village, a door that must stay poor, and the worst possible time to sell the herd. Readers pick the cover.

Vegan Power game: the yellow player catches falling fruit while a chicken and a cow look on
Vegan Power: The Little Game About Eating Fruit, Not Friends
2026-07-19

Vegan Power is a free browser game where you catch fruit, dodge the animals, protect seven hearts, and chase a better high score.

KotobaMon title screen: the Japanese logo コトバモン over a low-poly 3D island with monsters, cherry-blossom trees and a trainer.
KotobaMon: Shipping a 3D Browser Game With No Build Step and Self-Hosted Voice
2026-07-19

A look at fantasy.grn.dk, a browser-based 3D game that teaches Japanese with no build step, procedural art and self-hosted AI voice, and what its constraints show about shipping interactive products fast and cheap.

More articles
RSS feed

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