# sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7 architecture

> Architecture diagram of the GitHub repository sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7
- Repository: https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7

## Overview

##### Project type and purpose
- This is a legacy, full-stack, monolithic PHP web application (“TAE and Surf Enhanced v7”), designed as an advertising and surf-exchange platform.
- It provides member and admin interfaces to manage text ads, banners, PTC links, surfing earnings, commission payouts and IPN integrations for multiple payment gateways.

##### File structure
- Top-level files:
- index.php (public entry)
- config.php / connect.php (database configuration and bootstrap)
- style.css / style.php (presentation layer)
- egoPaySci.php, various *_ipn.php files (payment-gateway IPN endpoints)
- DB/phpsites_demotaeenhancedv7.sql (schema dump)
- Directories of logical modules:
- /admin – all administrative CRUD pages (ads, banners, users, settings, stats)
- /members – authenticated member area (posting ads, surfing, stats, IPN callbacks for JV, pro, bonus, etc.)
- /ioncube – PHP loader and licensing
- No formal MVC layers or services; the code is organized into file-per-function modules separated by directory.

##### README for additional insights
- Confirms PHP 5.4 compatibility, MLM/commission features, resell rights.

a. Main components
- Client browsers (Members & Admin UIs)
- Web Server (Apache/nginx) with .htaccess rewriting
- PHP Application (monolithic codebase under /admin, /members, root files)
- MySQL Database (stores users, ads, transactions, stats)
- Static Asset Server (serving /images, /jscripts, CSS)
- External Payment Gateways (EgoPay, Moneybookers, Payza, PerfectMoney, OkPay, SolidTrustPay, etc.)
- Email Service (SMTP for verification, notifications, autoresponders)
b. Relationships & data flows
1. Browser → Web Server: HTTP requests to index.php, /members/*, /admin/*
2. Web Server → PHP: invokes script, includes config.php/connect.php
3. PHP → MySQL: CRUD operations for ads, clicks, member records, stats
4. PHP → External Gateways: IPN endpoints receive callbacks → update DB → send confirmation emails
5. PHP → SMTP: transactional emails (verification, support, promotions)
6. Browser ← Static Assets: CSS, JS, images
c. Architectural patterns & principles
- Tiered architecture: Presentation (PHP/HTML/CSS/JS) ↔ Business logic (procedural PHP scripts per module) ↔ Data tier (MySQL)
- Logical modularization by folder rather than by formal layers
- Event-driven hooks for IPN callbacks and autoresponders
d. Key technologies/frameworks
- PHP 5.4, MySQL
- TinyMCE rich-text editor
- Ioncube loader for licensing
- Various JS libraries (calendarDateInput.js, colorjack, colorpicker)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Browser
    Browser["Browser (Members/Admin)"]:::external
    Browser -->|"HTTP GET/POST"| WebServer["Web Server (Apache/nginx)"]:::module

    %% Bootstrap
    WebServer --> configFile["config.php"]:::config
    configFile --> connectFile["connect.php"]:::config

    %% Frontend Monolith
    subgraph "Frontend (PHP Monolith)"
        direction TB
        Public["Public Site Entry (index.php)"]:::frontend
        subgraph "Member Area"
            direction TB
            MemIndex["members/index.php"]:::frontend
            MemPost["members/post.php"]:::frontend
            MemSurf["members/surf.php"]:::frontend
            MemStats["members/stats.php"]:::frontend
            membersIPN1["members/jv_ipn.php"]:::gateway
            membersIPN2["members/pro_ipn.php"]:::gateway
            membersIPN3["members/jvpartner_ipn.php"]:::gateway
            membersIPN4["members/superjv_ipn.php"]:::gateway
            RefMail["members/refmail.php"]:::email
        end
        subgraph "Admin Area"
            direction TB
            AdminIndex["admin/index.php"]:::frontend
            AdminControl["admin/admincontrol.php"]:::frontend
            Settings["admin/settings.php"]:::frontend
            EmailAdmin["admin/email.php"]:::email
            AutoRes["admin/autoresponder.php"]:::email
        end
        subgraph "Payment IPN Endpoints"
            direction TB
            EgoPaySci["EgoPaySci.php"]:::gateway
            EgopayIPN["egopay_ipn.php"]:::gateway
            MoneyBookers["moneybookers_ipn.php"]:::gateway
            Payza["payza_ipn.php"]:::gateway
            PerfectMoney["perfectmoney_ipn.php"]:::gateway
            OkPay["okpay_ipn.php"]:::gateway
            SolidTrust["solidtrustpay_ipn.php"]:::gateway
        end
        subgraph "Ad Click Tracking"
            direction TB
            Click1["clicks.php"]:::module
            Click2["clicks2.php"]:::module
            Click3["clicks3.php"]:::module
            Banner1["bannerclick.php"]:::module
            Banner2["bannerclicks1.php"]:::module
            Banner3["bannerclicks2.php"]:::module
            Button1["buttonclick.php"]:::module
            Button2["buttonclick1.php"]:::module
            Button3["buttonclick2.php"]:::module
        end
    end

    %% Static Assets
    subgraph "Static Asset Server"
        direction TB
        CSS1["style.css / style.php"]:::assets
        CSS2["members/advanced.css"]:::assets
        JS["jscripts/"]:::assets
        Images["images/"]:::assets
    end

    %% Database
    DB["MySQL Database"]:::db

    %% External Services
    SMTP["SMTP Email Service"]:::email
    subgraph "External Payment Gateways"
        direction TB
        EGExt["EgoPay"]:::gateway
        MBExt["MoneyBookers"]:::gateway
        PZExt["Payza"]:::gateway
        PMExt["PerfectMoney"]:::gateway
        OPExt["OkPay"]:::gateway
        STExt["SolidTrustPay"]:::gateway
    end

    %% Data Flows
    connectFile --> Public
    connectFile --> MemIndex
    connectFile --> AdminIndex
    Public -->|HTTP| Browser
    MemIndex -->|HTTP| Browser
    AdminIndex -->|HTTP| Browser

    %% PHP to DB
    Public -->|SQL CRUD| DB
    MemIndex -->|SQL CRUD| DB
    MemPost -->|SQL CRUD| DB
    MemSurf -->|SQL CRUD| DB
    MemStats -->|SQL CRUD| DB
    AdminControl -->|SQL CRUD| DB
    Settings -->|SQL CRUD| DB
    Click1 -->|SQL INSERT| DB
    Click2 -->|SQL INSERT| DB
    Click3 -->|SQL INSERT| DB
    Banner1 -->|SQL INSERT| DB
    Banner2 -->|SQL INSERT| DB
    Banner3 -->|SQL INSERT| DB
    Button1 -->|SQL INSERT| DB
    Button2 -->|SQL INSERT| DB
    Button3 -->|SQL INSERT| DB
    EgoPaySci -->|IPN Callback| DB
    EgopayIPN -->|IPN Callback| DB
    MoneyBookers -->|IPN Callback| DB
    Payza -->|IPN Callback| DB
    PerfectMoney -->|IPN Callback| DB
    OkPay -->|IPN Callback| DB
    SolidTrust -->|IPN Callback| DB
    membersIPN1 -->|IPN Callback| DB
    membersIPN2 -->|IPN Callback| DB
    membersIPN3 -->|IPN Callback| DB
    membersIPN4 -->|IPN Callback| DB

    %% PHP to External Gateways
    EGExt -->|IPN POST| EgoPaySci
    MBExt -->|IPN POST| EgopayIPN
    PZExt -->|IPN POST| Payza
    PMExt -->|IPN POST| PerfectMoney
    OPExt -->|IPN POST| OkPay
    STExt -->|IPN POST| SolidTrust

    %% PHP to Email Service
    EmailAdmin -->|SMTP| SMTP
    AutoRes -->|SMTP| SMTP
    RefMail -->|SMTP| SMTP

    %% Browser to Static Assets
    Browser -->|GET CSS/JS/Images| CSS1
    Browser -->|GET CSS| CSS2
    Browser -->|GET JS| JS
    Browser -->|GET Images| Images

    %% Click Events
    click Public "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master/index.php"
    click configFile "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master/config.php"
    click connectFile "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master/connect.php"
    click AdminIndex "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master//admin/index.php"
    click AdminControl "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master//admin/admincontrol.php"
    click Settings "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master//admin/settings.php"
    click EmailAdmin "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master//admin/email.php"
    click AutoRes "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master//admin/autoresponder.php"
    click MemIndex "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master//members/index.php"
    click MemPost "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master//members/post.php"
    click MemSurf "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master//members/surf.php"
    click MemStats "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master//members/stats.php"
    click membersIPN1 "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master//members/jv_ipn.php"
    click membersIPN2 "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master//members/pro_ipn.php"
    click membersIPN3 "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master//members/jvpartner_ipn.php"
    click membersIPN4 "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master//members/superjv_ipn.php"
    click RefMail "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master//members/refmail.php"
    click EgoPaySci "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master/EgoPaySci.php"
    click EgopayIPN "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master/egopay_ipn.php"
    click MoneyBookers "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master/moneybookers_ipn.php"
    click Payza "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master/payza_ipn.php"
    click PerfectMoney "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master/perfectmoney_ipn.php"
    click OkPay "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master/okpay_ipn.php"
    click SolidTrust "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master/solidtrustpay_ipn.php"
    click Click1 "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master/clicks.php"
    click Click2 "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master/clicks2.php"
    click Click3 "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master/clicks3.php"
    click Banner1 "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master/bannerclick.php"
    click Banner2 "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master/bannerclicks1.php"
    click Banner3 "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master/bannerclicks2.php"
    click Button1 "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master/buttonclick.php"
    click Button2 "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master/buttonclick1.php"
    click Button3 "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master/buttonclick2.php"
    click CSS1 "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master/style.css"
    click CSS2 "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master/members/advanced.css"
    click JS "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/tree/master/jscripts/"
    click Images "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/tree/master/images/"
    click DB "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master/DB/phpsites_demotaeenhancedv7.sql"
    click EGExt "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master/EgoPaySci.php"
    click MBExt "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master/moneybookers_ipn.php"
    click STExt "https://github.com/sabrinamarkon/php-legacy-tae-and-surf-enhanced-v7/blob/master/solidtrustpay_ipn.php"

    %% Styles
    classDef frontend fill:#D6E9F8,stroke:#31708F
    classDef module fill:#F5F5F5,stroke:#CCC
    classDef config fill:#F2DEDE,stroke:#A94442
    classDef db fill:#DFF0D8,stroke:#3C763D
    classDef gateway fill:#FAEBCC,stroke:#8A6D3B
    classDef email fill:#EAEAEA,stroke:#333
    classDef assets fill:#FCF8E3,stroke:#8A6D3B
    classDef external fill:#FFF3CD,stroke:#F0AD4E
```
