# WBMCZ — what to upload to the live server
## Everything from 05 – 07 September 2026, in one list

**86 files.** 60 new, 26 changed. One migration to run afterwards.

Nothing here drops a table, drops a column, retypes a column or deletes a row.

---

## THE ORDER TO UPLOAD IN

Upload in these four steps. The order matters: `includes/` holds the shared code
that the `admin/` screens call, so a screen uploaded before its engine would
show "undefined function" for the minute in between.

    1. includes/          the shared engines           11 files
    2. admin/includes/    the four screen engines       4 files
    3. everything else in admin/                       68 files
    4. the root pages + activitmigration.php            4 files

Then open **activitmigration.php** once while signed in as admin, and delete it.

---

## 1 · includes/  — NEW

    includes/kyc_checkout.php          collects the KYC a product needs, on the checkout page
    includes/pipeline.php              the Activity & Task ladder, the desks, the access rules
    includes/product_pages.php         names the per-category pages, and writes missing ones

## 1b · includes/  — CHANGED

    includes/kyc.php                   locks a KYC line once it has been filled in
    includes/shares.php                buying no longer waits for admin KYC approval
    includes/sms.php                   reads the HSPSMS reply properly, whatever shape it comes in
    includes/purchase.php              writes category_id onto new orders
    includes/acl.php                   the permission registry — 389 keys, 20 modules

---

## 2 · admin/includes/  — NEW

    admin/includes/product_engine.php            the catalogue screen, shared by 13 pages
    admin/includes/pending_services_engine.php   the seller-submission screen, shared by 12
    admin/includes/user_list_engine.php          the user list, shared by 8

## 2b · admin/includes/  — CHANGED

    admin/includes/sidebar.php         the menu, and the notification bell

---

## 3 · admin/  — NEW  (48 files)

### The staff door

    admin/login.php

### User lists — 8, one per audience

    admin/users_user.php          admin/users_seller.php
    admin/users_employee.php      admin/users_admin.php
    admin/users_all.php           admin/users_free.php
    admin/users_pro.php           admin/users_deleted.php

### The catalogue — 13, one per category plus two doors

    admin/product_gov_portals.php        admin/product_imp_tools.php
    admin/product_service_booking.php    admin/product_print_order.php
    admin/product_agency_software.php    admin/product_cyber_accessories.php
    admin/product_online_courses.php     admin/product_web_dev.php
    admin/product_digi_marketing.php     admin/product_shopping.php
    admin/product_b2b_shopping.php
    admin/product_all.php                admin/product_cat.php

### Seller submissions — 11, one per category

    admin/service_gov_portals.php        admin/service_imp_tools.php
    admin/service_service_booking.php    admin/service_print_order.php
    admin/service_agency_software.php    admin/service_cyber_accessories.php
    admin/service_online_courses.php     admin/service_web_dev.php
    admin/service_digi_marketing.php     admin/service_shopping.php
    admin/service_b2b_shopping.php

> These 24 category files can be left out if you prefer — `activitmigration.php`
> writes them from the catalogue. Uploading them is faster, and works even on a
> host where the `admin/` folder is not writable.

## 3b · admin/  — CHANGED  (20 files)

### Rewritten or substantially changed

    admin/index.php                    the dashboard, rebuilt around real figures
    admin/activity_task.php            the ladder board
    admin/staff.php                    Add Staff — the duplicate-field fix
    admin/orders.php                   order categories, and the 9 hidden rows
    admin/service_import.php           bulk upload, shaped to the category
    admin/services.php                 writes a new category its two pages
    admin/sms_settings.php             the DLT wording and the delivery check
    admin/pending_services.php         now three lines — the engine does the work
    admin/product_management.php       now three lines
    admin/product_management_gov.php   now three lines
    admin/user_list.php                now three lines
    admin/kyc_fields.php               moved in the menu, unchanged inside

### Sign-in redirect only

These 32 files each had one line changed — `redirect('../login.php')` became
`redirect('login.php')`, so a signed-out admin lands on the staff door instead
of the member login:

    activity_log      commissions        hero_slides       kyc_pending
    leads             messages           notifications     order_manage
    payment_settings  payouts            profile           refer
    reports           roles              sellers           settings
    staff_fields      subscription_plans switch_user       task_criteria
    tickets           transactions       upgrade_requests  users
    wallet            wallet_history     website_requests  withdrawals

---

## 4 · Root — CHANGED

    checkout.php       the KYC form, with name / mobile / email locked
    register.php       no referral code on the "done" screen
    cart.php           the KYC gate follows the new rule
    product.php        the same
    category.php       the same
    kyc_extra.php      locked lines show as locked

## 4b · Root — NEW

    activitmigration.php     run once, then delete

---

## 5 · THE MIGRATION

Open **`https://wbmcz.online/activitmigration.php`** while signed in as admin.
It is admin-gated, so it will send you to the sign-in first if you are not.

### What it changes in the database

Only these, and only when they are missing:

| Table | Column | Why |
|---|---|---|
| `tasks` | `outcome`, `outcome_at`, `advanced` | what happened when you spoke to them |
| `users` | `task_access` | which desks a person was given |
| `users` | `staff_level`, `perm_extra`, `perm_denied` | the staff login and per-person access |
| `roles` | `perms_json`, `level`, `status`, `description`, `created_by`, `created_by_name`, `updated_at` | detailed role permissions |
| `orders` | `category_id` | so the category tabs work |
| `seller_services` | `required_kyc` | which documents a product asks for |
| `service_categories` | `category_key` | the page file names are built from it |
| `pipe_reviews` | `ref_id` | which record a decision was about |

And these tables, only if they do not exist: `pipe_reviews`,
`seller_collections`, `seller_settlements`.

### And these data repairs

* fills in a `category_key` wherever one is blank
* fills in `orders.category_id` from each order's items, then from the product it
  names — on the local copy this moved **47 of 54** orders into Agency And
  Software; the other 7 keep no category because their product no longer exists
* writes any missing per-category page file
* runs the ladder once so everybody lands on the right rung, including the three
  new KYC rungs

**Running it twice is safe.** Every step checks first and does nothing when
there is nothing to do.

### Checked on the local copy

    would add 0 column(s), create 0 table(s)     — everything already present
    24 of 24 files found
    0 categories without a key
    7 orders with no category (the oldest test orders)

---

## 6 · AFTER THE MIGRATION

1. **Delete `activitmigration.php`.**
2. Delete `kycsmsmigration.php` and `productsplitmigration.php` if they are still
   on the server — this one does everything they did.
3. On **Custom Roles**, tick the new keys for each role: the per-category product
   pages, the 25 per-desk Activity & Task keys, and the seven dashboard blocks.
   Existing roles lose nothing — a role saved before this system existed is
   expanded into every key of the modules it already held.
4. To let an admin create staff, tick **Staff & Roles → Create an employee** for
   them. They will only ever be able to hand out permissions they hold
   themselves.

---

## 7 · STILL OPEN

* The OTP text ends with the reseller's brand until your own DLT entity, header
  and templates are registered. No code change — just the Sender ID box and the
  two template boxes on the SMS screen.
* `withdrawal_requests` does not exist in this database, so the **Wallet** and
  **Payout** desks always read 0. They are written against that table and will
  start working the day it is created; nothing errors meanwhile.
* The **KYC Request** rung and the **KYC · approve or reject** desk hold the same
  people on purpose — one says where somebody has got to, the other is where you
  read the documents. Say the word if you would rather have only one.
