# Project plan — printafoil (Printafoil Portal)

Evidence date: 2026-10-06.

Source repository: `git@bitbucket.org:overdrive/printafoil.git`.

This plan describes what the repository contains. It does not decide what the product should become.

## Product

Printafoil Portal is an internal operations system for a print-finishing business. Staff record clients, sales enquiries and order confirmations, purchase orders, dies and die lines, materials and inks, production and work-in-progress, finished stock, dispatch, samples, consumables, equipment, and quality, safety, HR, and FSC documents.

Provenance: **Implemented**. The application title is `Printafoil Portal` (`definitions.php`, `APP_TITLE`). Table captions in `admin/incFunctions.php` (`getTableList()`) name the work: dies, purchase orders, finishing, dispatch, stores, foiling, embossing, cutting and creasing, windowing, stripping, gluing, handwork, sorting, covering, staying, prepress, samples, and ISO / HSE / FSC / SEDEX records.

A second application is vendored under `b2b/`: WordPress 6.1.1 with WooCommerce 7.0.0. Its rewrite base is `/b2b/`. Provenance: **Implemented** (`b2b/wp-includes/version.php`, `b2b/wp-content/plugins/woocommerce/woocommerce.php`, `b2b/.htaccess`). Whether that shop is still the public B2B site is **Unknown / Requires Confirmation**.

The approval-mail template in `config.php` sends members to `https://printafoil.bluolive.co.za`. A path inside the SQL dump refers to `/home/bluolive/domains/printafoil.bluolive.co.za`. Provenance: **Implemented** in those files. Whether that host is still live is **Unknown / Requires Confirmation**.

There is no product README. `hooks/README.html` is the AppGini hooks explanation. `b2b/readme.html` is the WordPress readme.

## Branch reality

The only branch is `master`. `origin/HEAD` points at `master`. History is three commits.

| Commit | Date | Subject | What it contains |
|---|---|---|---|
| `85a07505` | 2023-01-11 | Initial commit | 1 file, 50 lines |
| `72ec57ca` | 2023-02-20 | commit to repo | 46,987 files. The application, WordPress tree, phpMyAdmin, and SQL dump |
| `058841e9` | 2023-02-24 | latest updates | 477 files. Almost all are files under `images/` (drawings, purchase orders, quality and HR documents) plus Webalizer files under `stats/` for January and February 2023 |

This documentation set is based on `master` at `058841e9`. No other branch was present.

## Scope in the repository

In scope of what is implemented on `master`:

- An AppGini 22.14 PHP application (some screens still say 22.13) with 233 tables registered in `getTableList()`.
- Membership: groups, members, per-table insert/view/edit/delete, record ownership, CSV import, admin mail, backup/restore, and maintenance mode.
- Calculated quantities and values for purchase orders, finished stock, materials, consumables, plates, dispatch, WIP, and a small set of other tables (`calculated_fields()`).
- A client landing screen for membership group `client_Charlotte_Rhyse` (`hooks/__global.php`).
- Extra screens on `finish_stock` and `wip_hud` that are not separate tables.
- WordPress 6.1.1 and WooCommerce 7.0.0 under `b2b/`, with a large set of themes and plugins vendored in the tree.
- phpMyAdmin 5.2.0 under `phpmyadmin/`.
- A phpMyAdmin dump dated 11 January 2023 (`Database/printafoil_backup_20230111.sql`, about 95 MB) that creates databases `bluolive`, `printafoil`, and `printafoil_b2b`.
- Uploaded operational documents under `images/`.

Out of scope of what was found, or not established:

- Automated tests. No PHPUnit suite, no `bitbucket-pipelines.yml`, no test directory for the portal.
- A written product requirements document inside the source repository.
- Which WordPress theme and plugins are active. That state is in the WordPress database.
- Which AppGini membership groups exist, and what each group may do. That state is in `membership_*` tables, not in PHP. One group name is hard-coded: `client_Charlotte_Rhyse`.

## System architecture

```text
Browser
  → index.php (Printafoil Portal, AppGini 22.14)
      → MySQL / MariaDB database named in config.php as printafoil_web_portal
      → images/ for uploads
      → SMTP mail.silvaitservices.co.za (membership mail)
  → /b2b/ (WordPress 6.1.1 + WooCommerce 7.0.0)
      → MySQL database printafoil_b2b (name in b2b/wp-config.php)
  → /phpmyadmin/ (phpMyAdmin 5.2.0) — present in the tree
```

The portal and the shop do not call each other in the PHP that was read. AppGini screens named `b2b_order_*` exist as files but are not registered in `getTableList()`. Provenance: **Implemented** files, **Unknown** whether those tables are still used.

## Major components

| Component | Location | Role |
|---|---|---|
| Portal entry | `index.php`, `index.html`, `home.php`, `login.php` | Sign-in, sign-out, homepage of tables the member may open |
| App identity | `definitions.php` | Title, version 22.14, timezone `Africa/Johannesburg`, MySQL via mysqli, multi-tenant off |
| Runtime config | `config.php`, `config.bak.php` | Database, host, mail, admin account. Secrets are in git and are not copied into this plan |
| Table catalogue | `admin/incFunctions.php` `getTableList()` | 233 tables, captions, homepage blurbs, menu group |
| Permissions | `getTablePermissions()` in `incCommon.php` | Group permissions, overwritten by a member's own permissions |
| Calculated fields | `calculated_fields()` in `admin/incFunctions.php` | SQL run from `ajax-update-calculated-fields.php` and `cli-update-calculated-fields.php` |
| Hooks | `hooks/` | AppGini hook points. `hooks/__global.php` has the only clear product-specific login behaviour found |
| Membership admin | `admin/` | Groups, members, ownership, CSV, mail, backup, SQL, maintenance mode |
| Shop | `b2b/` | WordPress and WooCommerce |
| Database dump | `Database/printafoil_backup_20230111.sql` | Snapshot from 11 January 2023. Not the same database name as `config.php` |
| Uploads and stats | `images/`, `stats/` | Drawings and quality documents; Webalizer output for Jan–Feb 2023 |

## Menu groups

`get_table_groups()` names these homepage groups. Counts are tables whose group in `getTableList()` matches. Four names in that list have no tables.

| Group | Tables in catalogue |
|---|---|
| System | 113 |
| HSE-ISO | 19 |
| Store Manager | 12 |
| HR | 10 |
| Digital Orders | 7 |
| Print Item Manage | 7 |
| Colour Standard | 6 |
| Finishing / Dispatch / Stores | 6 |
| FSC | 6 |
| Admin | 5 |
| PrePress | 5 |
| Consumables | 4 |
| Production System | 4 |
| Manny Test | 3 |
| Purchase Orders | 3 |
| Sample Dept | 3 |
| Sales | 2 |
| Sales Force CRM | 2 |
| Stock - Materials | 2 |
| Covering, Cutting Creasing, Embossing, Foiling, Gluing, Handwork, Sorting, Staying, Stripping, Windowing | 1 each (a group-menu table) |
| Document Template Manager, P-Planning, Production Reports, Sales Admin | 1 each |
| Charlotte Rhys, 1701 Nougat, Order (B2B), Sales Reports | 0 |

The System group is mostly lookup and setup tables (statuses, locations, departments, movement types). User-facing work sits in the other groups. The full list is in `features.md`.

## Milestones visible in git

There is no project plan, issue tracker, or roadmap in the repository. The only timeline is the three commits above: an empty start on 11 January 2023, the full tree on 20 February 2023, and uploaded documents plus usage stats on 24 February 2023. Nothing in git is newer than `058841e9`.

## Known dependencies

- PHP. The SQL dump header records PHP 8.1.14 and MariaDB 10.3.35 on the server that produced the dump. The portal code does not declare a PHP version. WooCommerce 7.0.0 declares `Requires PHP: 7.2`.
- AppGini 22.14 (BigProf) generated the portal. `APP_VERSION` is `22.14`.
- MySQL or MariaDB, charset `utf8` in the portal config, `utf8mb4` in WordPress.
- Bootstrap-era AppGini UI under `resources/initializr/` (several Bootswatch themes are present; which one is selected is an admin setting).
- SMTP at `mail.silvaitservices.co.za` port 587, encryption left blank in `config.php`.
- WordPress plugins vendored under `b2b/wp-content/plugins/`: WooCommerce, WooCommerce PDF Invoices & Packing Slips, WooCommerce Jetpack, Elementor, Jetpack, MailPoet, Contact Form 7, Wordfence, Ultimate Member, User Registration, Facebook for WooCommerce, Google Listings and Ads, Beaver Builder Lite, SiteOrigin Panels, and others. Activation is **Unknown**.

## Current project status

The repository is a snapshot. Last commit 24 February 2023, message `latest updates`. No open branch, no test suite, no deployment script for the portal.

Runtime database name in `config.php` is `printafoil_web_portal`. WordPress config names `printafoil_b2b`. The January 2023 dump creates `bluolive`, `printafoil`, and `printafoil_b2b`. Those names do not match `printafoil_web_portal`. Provenance: **Implemented** in each file. Which database the portal uses in production after 11 January 2023 is **Unknown / Requires Confirmation**.

Credentials, an admin password hash, and an SMTP password are committed. They are not reproduced in Silicon Ark. They need human review and rotation.

## Implementation plan

No future implementation plan is in the repository. This Silicon Ark set records the system as it stood at `058841e9`.
