5250 to Web: PHP Case Study on IBM i

Alan Seiden PHP on IBM i consultant/developer email: [email protected] blog: http://alanseiden.com Strategic Business Systems, Inc.

• Developing Web apps on IBM i (and iSeries, i5...) since 1996 • Based in Ramsey, New Jersey

• IBM Business Partner . Power Systems hardware, software development, consulting

Business Partner . Working with Zend since they brought PHP to IBM i in 2006 . We offer Zend’s training and Zend Server software to complement our own consulting/development services

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 2 Alan Seiden

PHP on IBM i Developer / Consultant / Mentor • Contributor to IBM’s Redbook PHP: Zend Core for i5/OS • First IBM i developer certified in Zend Framework • Developer of IBM/COMMON’s “Best Web Solution” of 2009

Contact: [email protected] or 201-327-9400 Blog/articles: http://alanseiden.com

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 3 What we’ll discuss today

• Update on Zend Server (new PHP install for i) • PHP basics quick overview . Focus on two ways to call CL/RPG from PHP • Case study: re-imagine green screens as web • Tips and techniques

• Questions

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 4 PHP’s growth as web dev language (as of 2007)

34% of the internet runs on PHP ZF and PDT released, PHP 4 EOL 37% growth in PHP developers announced Zend Framework & project (PDT) announced; i5/OS support 25M IBM, Oracle PHP 4 Endorse PHP Released PHP 5.0 (XML,SOAP,OOP) 20M • 1M Internet domains PHP • Proliferation 15M • Zend Founded Zeev Suraski & Yahoo! Standardizes 10M lead the on PHP development Rasmus of PHP 3 Lerdorf 5M PHP Introduces Internet PHP/FI Domains

1995 1997 1999 2000 2002 2003 2004 2005 2006 2007

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 5 Who uses PHP?

• Yahoo, eBay, Wikipedia, Facebook

• Open source developers – 10,000+ projects

• 7 million+ developers

• Growing community of IBM i shops

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 6 Reasons for PHP’s success

• Easy way to get data to Web . Generates ordinary HTML, viewable in any browser

• Cross-platform: also runs on Windows, Linux, any mainstream OS

• Open source with commercial backing . Managed by Zend, “the PHP company” . Contributors from community and corporations

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 7 Free, open source apps (fine on IBM i)

WordPress blog/CMS MediaWiki (Wikipedia) ZenCart e-Commerce

Bug Tracker SugarCRM (Mantis400.com)

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 8 PHP on i—always something new

• 2004: i5php.net . Unofficial PHP binary for “i” available online

• 2005: IBM and Zend got together

• 2006: Zend Core for i5/OS . Official release with help from IBM . Professional technical support from Zend

• 2007: Zend Studio: IDE/code editor and Zend Platform: performance booster and code tracer/monitor

• 2008: Zend Framework supports “i” variant of db2

• 2009: Zend Server Beta for “i” . Combines the best of Core and Platform

• 2010: Zend Server released

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 9 PHP on i—a comfortable fit

• Runs completely on your good old “i” . Uses IBM’s native Apache web server . Shipped by IBM with v5r4 and higher . Connects directly to db2 database

• Light on its feet . Efficient—runs well out of the box . Create useful functionality quickly; start small and grow • Plenty of room for sophistication in larger apps

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 10 ZendZend ServerServer

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 11 Zend Server for IBM i

• Next generation PHP stack for IBM i . Best of Zend Core and Platform in one licensed program

• Two license levels . Zend Server for IBM i Community Edition (CE) • Available at no charge per IBM partnership • Includes “Optimizer+” that speeds up code • One year silver (email) support . Zend Server for IBM i, a.k.a. Professional Edition (PE) • Subscription-based license • High value extra features, higher Support SLAs

• Details of differences: . http://mikepavlak.blogspot.com/2010/08/i-want-to-do-php-on- ibm-i-so-what-do-i.html

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 12 Installation

• http://www.zend.com/products/server/downloads . Click on the “IBM i” tab

• Prerequisites . v5r4 and: • http://files.zend.com/help/Zend-Server- IBMi/i5_installing_zend_server.htm • IBM’s FastCGI PTF (free)

• Try Zend Studio’s IDE (no charge, courtesy of IBM) . “Zend Studio for Eclipse, IBM i Edition” . http://zend.com/en/products/studio/downloads . Look for “IBM i Edition”

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 13 Administration

• Zend Server combines “Core” and “Platform” controls in one interface

• Simpler Apache setup . Single web server • PASE server eliminated

. IBM HTTP Server Powered by Apache • PHP implemented using IBM’s Fast CGI

. Clean, more complete graphical user interface • Favorite: the Restart button

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 14 Admin menu (GO ZENDSVR/ZSMENU)

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 15 Zend Server’s Interface

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 16 Cheat sheet for upgrade

http://alanseiden.com/2010/04/21/differences- between-zend-core-and-zend-server-on-ibm-i/

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 17 Zend Server and PHP resources

• Support: Zend Server CE includes one year of email support. Upgrade to Zend Server PE for more years and fast phone support . Register at http://www.zend.com/products/server/downloads and also get Zend’s IBM i newsletter

• Web: . Zend’s recorded webinars: http://www.zend.com/resources/webinars/i5-os . Zend Forums: forums.zend.com (look for IBM i Zend Server forums) . http://alanseiden.com (of course!)

• Books (online and print) . PHP Manual: http://php.net . PHP on IBM i book by Jeff Olen & Kevin Schroeder (MC Press)

• Training from Zend/others

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 18 Community PHP resources

• PHP User Groups . See http://php.net for a list . Not only learn, but tell the PHP world about IBM i

• Conferences . COMMON Fall Conference (Congratulations—you made it!) . Zend/PHP (ZendCon), Nov 1-4, 2010, Santa Clara, Calif.

• Your local IBM i / Power Systems user group . Consider asking your board to schedule some PHP talks . PHP topics tend to boost attendance

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 19 PHPPHP basicsbasics onon ii

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 20 PHP basics: Step 1

• Learn some basic HTML . Try http://w3schools.com/html . Tables (

,,
) useful for business data . “View Source” in browser to borrow bits of HTML

• Then learn these as you go . Javascript • Adds dynamic functionality to pages

. Cascading style sheets (CSS) • Modern way to specify colors, fonts, and other attibutes of how a site looks

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 21 Step 2: Try a simple PHP script

• PHP scripts are text files that reside in the IFS • Edit using notepad or Zend Studio for Eclipse, IBM i edition • Script file: /www/zendsvr/htdocs‏/helloworld.php • Run in browser: http://yourIBMi:10088/helloworld.php

// simple script to test PHP echo “Hello, world!”;

?>

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 22 “Hello, world!” in browser

Output from helloworld.php

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 23 Step 3: Access db2

Example: Code: /www/zendsvr/htdocs/Samples/SQL_access/DB2_SQL_example.php URL: http://yourIBMi:10088/Samples/SQL_access/DB2_SQL_example.php . Connect to db2 on i . Select records from a db2 table . Output the records into an HTML table

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 24 Step 4: Call RPG/CL from PHP

Two methods:

• i5 PHP Toolkit . included with Zend Server . call commands and programs . access data areas, spool files and other resources . Remote IBM i systems/LPARs can be accessed if you request a free license from Aura Easycom • http://www.easycom-aura.com/en/services_reg.asp

• db2 Stored Procedures . “Native” way to call RPG/CL . Flexible: add SQL or multiple program calls in one s.p. . Remote IBM i systems/LPARs can be accessed using ordinary DRDA- type connections. Supply an entry from WRKRDBDIRE

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 25 Let’s call this CL using both methods

0001.00 /* MYLIB/MYPGM, type CLLE */ 0002.00 0003.00 PGM PARM(&CODE &FNAME) 0004.00 DCL VAR(&CODE) TYPE(*DEC) LEN(5) 0005.00 DCL VAR(&FNAME) TYPE(*CHAR) LEN(10) 0005.01 0005.02 CHGVAR VAR(&CODE) VALUE(6) 0008.00 CHGVAR VAR(&FNAME) VALUE('JOHN') 0009.02 0010.00 ENDPGM

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 26 First method: i5 Toolkit

• Special “i5_” functions let PHP access system resources . call commands and programs . access data areas, spool files, and other resources . Examples: i5_connect (secure user/pw), i5_program_prepare, i5_program_call, i5_spool_list

• Documentation . http://files.zend.com/help/Zend-Core-i5/i5_php_api_toolkit.htm . http://files.zend.com/help/Zend-Core-i5/i5_php_connector_api.htm

• Samples . http://files.zend.com/help/Zend-Core-i5/program_samples.htm

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 27 i5 Toolkit functions for calling CL/RPG

• i5_connect(server, user, password, options) . $conn = i5_connect("1.2.3.4", "MYUSER", "MYPWD");

• i5_command(command, inputs, outputs) . Good for commands/programs with no parameters . E.g. i5_command("call LIB_NAME/PROGRAM_NAME")

• i5_program_prepare(name, description) . Sets up parameter names and data types . program library is optional; e.g. MYLIB/MYPROG if needed.

• i5_program_call(program, params, retvals) . Calls program with parameter values . More about this on next slide

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 28 Simplify i5 Toolkit calls with “Toolkit Classes”

• A code library in a single .php file that provides: . Handling of connection errors . Code to connect to i5, prepare, call programs . Proper naming of description/params/retvals . Output params in an object rather than scattered all around in individual variables

• One caveat: to get the convenience of “Toolkit Classes,” you need a bit of Object Oriented syntax

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 29 Calling our CL with“Toolkit Classes”

Simpler than direct connect/prepare/call Note: In OO syntax, “->” calls a method/function or gets/sets a property (like a field in a data structure)

// include “Toolkit “Classes” file, assuming Toolkit_classes.php is in same folder as this PHP script require_once('Toolkit_classes.php');

// define parameters $desc = new i5_Description(); $desc->I5_TYPE_INT('code', ‘5', I5_INOUT); $desc->I5_TYPE_CHAR(‘fname', '10', I5_INOUT);

// prepare program definition $prog = new i5_Program(‘MYLIB',‘MYPGM', $desc);

// provide input param value(s) $prog->code = ‘5’; $prog->fname = ‘Frederick;

// call the program prog->call();

// if no errors, show the output (properties of the $prog object) if(is_null($prog->LastErr)){ echo 'Code:'.$prog->code.'
'; echo ‘First Name:'.$prog->fname.'
} // output based on CL shown earlier is Code: 6 and First Name: John

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 30 Zend Server “Toolkit Classes” specifics

• Location of the code: . /www/zendsvr/htdocs/i5Toolkit_library/Toolkit_classes.php • Demo code: . /www/zendsvr/htdocs/i5Toolkit_library/demo_for_toolkit_class es.php . One update and then you can run it: /* Define i5/OS user and password before running this demo program */ $USER=“i5USER"; $PASSWORD=“i5PWD"; • URL to run the demo: . http://yourIBMi:10088/i5Toolkit_library/demo_for_toolkit_class es.php

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 31 i5_program_prepare in detail

We can avoid these details because Toolkit Classes handles them

resource i5_program_prepare(string name[, array description][, resource connection])

Parameters: • Name: program name. Library is optional (lib/pgm) • Description: definition of parameters to be passed . Sample: • $description = Array ( array('Name' => ‘code', 'IO' => I5_INOUT, 'Type' => I5_TYPE_INT, 'Length' => ‘5'), array('Name' => ‘fname', 'IO' => I5_INOUT, 'Type' => I5_TYPE_CODE, 'Length' => ‘10')); • For details: http://files.zend.com/help/Zend-Core-i5/easycom_php_data_description.htm

• Connection: optional connection handle

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 32 i5_program_call in detail

We can avoid these details because Toolkit Classes handles them

bool i5_program_call(resource program, array params[, array retvals])

Parameters: • Program: resource id from i5_program_prepare

• Params: array of key => value pairs for input . Supplies input parameters . Key: name of input parameter, which • Should match name given in “prepare” . Value: value of input parameter . Example: array("code"=>"5", “fname"=>"Fred")

• Retvals: array of key => value pairs for output . Supplies names of variables to receive output parameters . Key: name of output parameter • Should match name given in “prepare” . Value: name of PHP variable to receive the output parameter • OK to use same name you gave in Key (documentation shows this) • Will generate new PHP variable of this name, containing output data . Example: array("code"=>"code", “fname"=>“fname")

• Full example: http://files.zend.com/help/Zend-Core-i5/program_samples.htm

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 33 Second method: db2 stored procedures

• Benefits: . Re-use existing db2_connect connection from any SQL calls . Access remote programs using DRDA capabilities if you provide the remote database name from WRKDBRDIRE . db2 calls are more portable than i5 Toolkit calls . Bundle several program calls or SQL statements in one s.p. . As db2 improves, you can take advantage of the improvements

• I’ve noticed a trend toward stored procedures . A conversation with John Valance at VTMUG convinced me to give them serious consideration when calling CL/RPG

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 34 Create the stored procedure

Example: Define call to CL MYLIB/MYPGM with two input/output params

DROP procedure SPLIB/CALL_MYPGM ; CREATE procedure SPLIB/CALL_MYPGM ( INOUT CODE dec(5), INOUT FNAME char(10) CCSID 37 ) RESULT SETS 0 LANGUAGE CL EXTERNAL NAME MYLIB/MYPGM PARAMETER STYLE GENERAL;

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 35 Run stored procedure from PHP

$conn = db2_connect ('', '', '', array ('i5_libl' => "ALAN", 'i5_naming' => DB2_I5_NAMING_ON ) ) or die("Connection failed! ". db2_conn_errormsg());

$sql = 'CALL SPLIB/CALL_MYPGM (?, ?)'; $stmt = db2_prepare($conn, $sql) or die("
Prepare failed! ". db2_stmt_errormsg());

$code = 5; $fname = "Frederick";

db2_bind_param($stmt, 1, "code", DB2_PARAM_INOUT, DB2_DOUBLE, 5, 0); db2_bind_param($stmt, 2, "fname", DB2_PARAM_INOUT, DB2_CHAR, 10);

print "Values of bound parameters before CALL:
"; print "code: {$code}
fname: {$fname}
";

if (db2_execute($stmt)) { print "


Values of bound parameters after CALL:
"; print "code: {$code}
fname: {$fname}
"; }

db2_close ( $conn ); // output based on CL shown earlier is Code: 6 and First Name: John

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 36 RPG/PHPRPG/PHP sideside byby sideside

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 37 That age-old issue

• “New users don’t like the green screens”

• “We need to open up our apps/data to the outside, safely, and with a GUI”

• But we don’t want to lose our investment in RPG code

• We still want stability…and to run on the “i” !!

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 38 First thought: automatic webfacing

• Tools such as NewLook do it fast, but: . Often require java or plug-ins for browser . Users know they’re not true web apps . Still green screens in disguise

• Zend has “5250 Bridge” for PHP . Pulls 5250 data stream into a PHP app • Essential if you don’t have the RPG source code . Shows promise, but not a slam dunk • Requires coding for each field unless you can automate • Performs slower than a native PHP app • Web app will still be based on original 5250 app • OK if your changes will be minor

• These solutions serve a purpose but don’t get you something new

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 39 Next thought: an approach for true web apps

• I used it with my team at SBS for the first time in 2002 (before PHP on i)

• A smart ‘i’ friend of mine just came up with the same approach independently

• It’s time to talk about it

• All it needs is a catchy name

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 40 Here is the basic ormula

• PHP calls modified RPG with parameters . Copy the RPG and replace its input screen with a list of parameters • (a unique sequence and/or session id and other key values) . RPG looks up data, does calculations, validation

• RPG returns data and error messages in work file(s) • Redirect output to a file instead of the screen

• PHP reads the work file using SQL; outputs data on page

• It is worth the effort if your RPG is complex and valuable

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 41 Some RPG is already prepared for this

• Some shops already structure their RPG into screen/logic components, even in 5250 mode . Parameters rather than one monolithic program . Not that there’s anything wrong with monolithic programs

• In that case you may be able to use your “logic” RPG virtually unmodified

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 42 Flow of PHP/RPG

• PHP controls the flow . Receive input from browser . Zero-pad numeric fields . Write records (if any) to work file(s) . Call appropriate RPG(s) • RPG processes, calculates, validates . Writes results to work files(s) . Returns status flag to PHP • PHP reads work file(s) and shows any validation results and data

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 43 ExampleExample ofof RPGRPG parametersparameters

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 44 Parameter list of RPG includes sequence and flag

0008.00 H* PARAMETERS : SEQ - (*CHAR 11) - transaction sequence # 0009.00 H* SESS - (*CHAR 25) - session key 0010.00 H* FLAG - (*CHAR 1) - Success Flag (Y/N) 0011.00 H* Y = ... Processed Normally 0012.00 H* N = Not Processed Normally (validation error)

0137.00 C *ENTRY PLIST 0138.00 C PARM SEQ 11 0139.00 C PARM SESS 25 0140.00 C PARM FLAG 1

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 45 How work files might look

1. PHP creates work file records keyed by sequence# 2. PHP fills records with data that user entered on web page 3. PHP calls RPG 4. RPG fills appropriate work file records with additional data and validation messages. All complex RPG logic occurs here. RPG returns stat 5. PHP reads records, shows messages and other data

Transaction work file(s)/table(s) containing data. Could have header and details.

Transaction sequence 284 Order Number 332 Sales Rep 105 Dollar total 100.35 Validation Request 2951 Validation Group 1

Sample: Validation log file containing validation errors and so on . Headers and each detail line of transaction can have multiple validation messages . “Validation Group” usage: group 1 = header; group 2, 3, 4, … are detail lines.

Validation Request 2951 Validation Group 1 Validation Unique Seq 8032 Message Id VOR4039 Message Severity 60 Message Text Invalid model year/exterior/interior combination.

• You can devise your own conventions that work for you

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 46 TipTip

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 47 Use MONMSG

• Avoid any possibility of a crash in RPG/CL . If an RPG/CL does not complete, it won’t return control . Web page will “hang” till it times out

• Use MONMSG in CL; provide a return flag to tell PHP if an error occurred

• You could even email yourself the error message

• This technique will avoid head-scratching while you test, change file layouts, etc.!

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 48 OrderOrder EntryEntry CaseCase StudyStudy #1#1

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 49 Medrano Express: four into one

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 50 Screen #1, Order header

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 51 Screen #2, Order detail

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 52 Screen #3, Content package from detail

(Option 4 from order header)

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 53 Screen #4, Notes from order detail

F9 key launches this

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 54 Web page combines all 4 “green screens”

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 55 How do we fit all that on one page?

• Vertical scrolling • Contrasting fonts and colors

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 56 One PHP script, four RPG programs

• Call each RPG; it fills a work file with data to read • Repeat 4x ! • “header” RPG returns useful information for calling “detail” RPG, etc. • Show results in one PHP “view”

• (Thanks to Jessie Clark)

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 57 OrderOrder EntryEntry CaseCase StudyStudy #2#2

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 58 Allied Beverage Group

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 59 Original 5250-mode order entry process

• Aimed at expert customer service users • Sales reps accessed it using Jadvantage java applet in browser . Better than nothing . S-l-o-w logon . Forced reps to have expert knowledge of system • Dicey wireless signals on the road = lost sessions • RPG was powerful but too complex to be updated with major new functionality

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 60 Intro screen

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 61 Intro with error message (customer)

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 62 Intro with error message (“return to number”)

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 63 Main screen

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 64 Search for a product by description

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 65 Select a product

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 66 Help!

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 67 What Allied wanted in web-based order entry

• Good for sales reps and customers . Keep speed while making it easier for newcomers . Reps can copy from past orders . Lots of information at fingertips (fewer clicks)

• Users can save drafts of orders . Drafts are brand-new functionality . We use the old RPG logic, but we’re not tied to it

• No problem if temporarily disconnected . Stateless web connection can easily resume later

• Overcome 90-item limit . So we didn’t have to treat that as an error . Internally we split order into 90-item bunches and sent multiple orders to RPG

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 68 Web ordering intro page

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 69 Web with account type/search box

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 70 Web Mode #1: Quick Order Entry

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 71 Search results

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 72 Web Mode #2: Standard Order Entry

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 73 AJAX technology (javascript) loads dynamic info

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 74 UsabilityUsability tipstips

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 75 Check error messages for user friendliness

• Don’t assume users are experts

• Old style . “CODE NOT ON FILE” • New style . “We’re sorry, but the warranty code you entered was not valid.” . (Better: provide a lookup to avoid errors)

• Old style . “WARNING-LIMIT EXCEEDED” • New style . “You entered more than the maximum number of line items (100).” . (Better: find a way to allow more items, perhaps by calling the old RPG program once for each 100 you need to process.)

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 76 Graphical appeal = usability and “sizzle”

• Need HTML skills or know someone who does

• Borrow from: . your corporate logos or graphics . sites that you like • Use “View Source” command in browser

• Use Photoshop, Snagit, or other graphic programs

• Match colors for instant professional look . See next slide for a tip

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 77 Colorzilla for Firefox (free)

• https://addons.mozilla.org/en-US/firefox/addon/271

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 78 NowNow itit’’ss youryour turnturn

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 79 Questions?

Alan Seiden [email protected], 201-327-9400, http://alanseiden.com

To receive free PHP/i tips by email, write to [email protected] with subject: “PHP tips.”

Alan Seiden, Strategic Business Systems 5250 to Web: PHP Case Study on IBM i | | 80