A PHP-based decision-support tool that turns a listed company's raw filings — equity, share count, sales, costs, and market price — into a clear, three-part verdict: is the share fairly priced, how long until a market premium pays for itself, and how efficiently is the company turning its assets into profit.
This module is one screen inside a larger stock-market platform. Given a company's
phone number, the market value of its share, its country, and a reporting year, it
looks the company up in a company database table, prints its full
financial record, and then runs that record through a fixed set of accounting
formulas to produce a graded evaluation report — without requiring the visitor to
do any arithmetic themselves.
It is not a live market-data feed. It works entirely from figures that a company or an analyst has already entered into the database for a given fiscal year, so the result reflects the company's fundamentals for that period, not real-time trading activity.
The goal is to answer three practical investing questions in one pass, using standard accounting logic rather than opinion:
By standardising the calculation, every company evaluated through the tool is judged against the same formulas — useful for investors comparing multiple listed companies side by side.
The page runs in three stages once the form is submitted.
The telephone number, year, and country are validated, then used
in a parameterised query against the company table to fetch that
company's full financial record for the chosen year.
Gross profit, net profit (before and after interest), book value per share, and a return-on-assets ratio are derived from the raw figures using fixed formulas.
Each derived figure is passed through threshold logic that assigns one of nine outcome labels across the three evaluation standards, and the matching report fragment is included on the page.
Book value = Equity ÷ Shares is compared with the share's nominal value. A book value at or above par (or only modestly below it) signals a company with sound fundamentals; a book value well below par flags a company trading on weaker footing.
If the market price sits above book value, the gap is treated as a premium the investor is paying up front. Assuming a conservative 8% annual return on book value, the tool estimates how many years it takes for that premium to be recovered — two years or less is read as a quick, low-risk payback.
Net profit (after cost of sales, expenses and interest) is measured against the company's asset base to produce a ratio, which is then mapped onto a five-tier scale from Excellent down to Loss-Making.
The visitor fills in four fields. Everything else is read from the company's existing database record for the matching year.
| Field (you enter) | Description | Validation |
|---|---|---|
| Telephone number | The registered phone number used as the company's lookup key in the database. | Digits only, 1–20 characters. |
| Market value | The current trading price of one share, as entered by the user. | Numeric value. |
| Country | The country the company operates and is listed in. | Selected from a country list. |
| Year | The fiscal year of the financial record to evaluate (2011–2015). | Selected from a fixed list of years. |
| Field | What it represents |
|---|---|
| name, email, tel, site, legal, sect | Company identity — name, contact details, website, legal status on the exchange, and sector. |
| pro | Nominal (par) value per share. |
| cap | Shareholders' equity (total capital). |
| idc | Number of issued shares. |
| n1 / n2 | Sales value / purchase (cost of sales) value. |
| n3 / n4 / n5 | Operating expenses / debit interest / other revenues. |
| n6 | Total assets value. |
Book value meets or is close enough to par value. Fundamentals support the share's standing.
Book value exactly equals nominal value — a neutral, break-even reading.
Book value falls well short of par value — a caution flag on fundamentals.
Any premium paid over book value is earned back fast at an assumed 8% yield — lower risk entry point.
The premium takes longer to pay back, implying the share carries a heavier valuation risk.
Excellent · Very Good · Good · Fair · Weak · Loss-Making — five profit-to-assets tiers plus a loss flag.
Below is a worked example, computed live by this page's own PHP using representative sample figures for a fictional listed company — laid out exactly as the tool itself would present it: first the record pulled from the database, then the full evaluation report.
Sample data — not a live database connection| Company | Tel | Website | Legal Form | Year | Sector | Country | Nominal Value | Equity | Shares | Sales | Purchases | Expenses | Interest | Other Rev. | Assets | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Nile Delta Ceramics Co. | ir@nileceramics-sample.com | 32323232 | www.nileceramics-sample.com | Company is recorded in stock exchange | 2015 | Building Materials | Egypt | 10 | 15,000,000 | 1,000,000 | 8,000,000 | 5,000,000 | 500,000 | 200,000 | 100,000 | 20,000,000 |
Market value entered for this evaluation: 25.00 per share.
Quickly sense-check whether a share's asking price is backed by the company's book value before buying, and estimate how patient an investment needs to be.
Screen and compare multiple listed companies on a single, consistent scale rather than re-deriving ratios by hand for each one.
See how the market's asking price and the firm's own reported fundamentals line up, as an outside observer would read them.
Use it as a hands-on illustration of book-value, payback-period, and return-on-assets analysis applied to real filings.