For each order status, GetOrderCountByStatus(status, @total) puts the number of orders in @total. The page reads it back with SELECT @total and shows the counts in a grid built from an array.
This demo calls the GetOrderCountByStatus procedure, which isn't in the database yet. Stored procedures aren't part of the sample database, so they are installed separately:
examples/SampleDB/mysql_storedproc.sql into the sample database that conf.php uses:
mysql -u USER -p sampledb < examples/SampleDB/mysql_storedproc.sqlor open the file in phpMyAdmin, MySQL Workbench or another client and run it.
CREATE ROUTINE privilege to import it and EXECUTE to call the procedures.