# Smart Tech OMP — Unified Forms Update Report

**Release date:** 25 June 2026  
**Database migration:** Not required

## Scope

The project previously had a detailed dedicated product form, while 123 administrator modules still depended on a basic generic form that rendered foreign keys and media paths as plain text inputs. This update replaces that generic form layer with a schema-aware form system and aligns the vendor product workflow with the administrator product form.

## Updated form behavior

### Relationships

Known foreign-key fields now load live select options for users, vendors, products, categories, brands, orders, coupons, locations, couriers, page categories, affiliate plans/members, roles, POS outlets/registers/shifts/sales and other linked records. Parent category/menu/taxonomy fields use self-referencing dropdowns.

### Media and files

Image, logo, banner, avatar, landing image, OG image and media fields now provide MIME-validated uploads and previews. Document fields support private uploads. Uploaded files use randomized names, size limits, image-dimension validation and media-library records.

### Content and structured data

Long descriptions, page content, email bodies, landing biographies, policies and receipt HTML use the internal rich-text editor. JSON fields use a monospace editor, format button and client/server validation.

### Automation

The smart forms support:

- automatic slug generation from the main name/title;
- automatic meta-title synchronization;
- suggested meta keywords;
- generated SKU, barcode, referral code and other code fields;
- table-specific status options;
- yes/no selectors for boolean fields;
- number, money, date, datetime, email, telephone, URL and color input types.

### Management experience

- Fields are grouped into Relationships, Identity, Content, Values & Rules, Media & Files, SEO & Sharing, and Status & Display.
- Forms include responsive layouts, sticky save actions and required-field indicators.
- Record listings include search, pagination, relationship labels, status badges, boolean badges and image thumbnails.
- Audit logging records generic administration create, update and delete actions.
- Financial, payment, stock, POS and audit ledgers remain read-only to avoid bypassing their business workflows.

## Vendor product manager

The vendor product form now includes category/brand selectors, automatic slug/SKU/barcode/product code, full price and stock fields, default image, OG image, up to 12 gallery images, video URL, rich-text descriptions, SEO metadata and status handling. Vendor ownership is enforced server-side and new products are submitted for administrator approval.

## Files added

- `app/Core/SmartForm.php`
- `vendor/_product_manager.php`
- `public/admin-assets/css/smart-forms.css`
- `public/admin-assets/js/smart-forms.js`

## Files updated

- `app/Core/ModuleCrud.php`
- `admin/_module_page.php`
- `vendor/_panel_page.php`
- `README.md`

## Validation

- 315 PHP files passed `php -l` syntax validation.
- 101 JavaScript files passed `node --check` validation.
- 49 detected POST forms include CSRF protection.
- 123 generic administrator modules inherit the new form system.
- No database columns or tables were added, so no SQL import is required.

## Deployment

Upload the patch into the project root and allow it to overwrite existing files. Clear PHP OPcache/server cache and browser cache afterward. Test categories, brands, banners, sliders, coupons, vendors, delivery zones, payment gateways, CMS pages and vendor products before enabling the update for staff users.
