********************************************************************* * RPG ILE MODULE AJAX/CUSTMAST * * After compiling this RPG MODULE, * create the related program with the following command: * * CRTPGM AJAX/CUSTMAST MODULE(AJAX/CUSTMAST) * ACTGRP(AJAX) AUT(*USE) ********************************************************************* * Input HTML parameters * * VARIABLE MEANING * cust= customer number * ********************************************************************* /copy CGIDEV2/qrpglesrc,hspecs /copy CGIDEV2/qrpglesrc,hspecsbnd Fqcustcdtl if e k disk ********************************************************************* * Variables common to all CGIs ********************************************************************* /copy CGIDEV2/qrpglesrc,prototypeb /copy CGIDEV2/qrpglesrc,usec /copy CGIDEV2/qrpglesrc,variables3 ********************************************************************* * Variables parsed from input query string ********************************************************************* D cust s 6a ********************************************************************* * Other variables ********************************************************************* D sCUSNUM s 6 0 D aLSTNAM s 8 D aINIT s 3 D aSTREET s 13 D aCITY s 6 D aSTATE s 2 D aZIPCOD s 5 D aCDTLMT s 4 D aCHGCOD s 1 D aBALDUE s 7 D aCDTDUE s 7 ********************************************************************* * PROCESS ********************************************************************* * Write qualified job name to debug file (optional). The *on * parameter forces output even if debugging is off. * Remove this parameter or change it to *off if you * want the output only if debugging is on. C callp wrtjobdbg(*on) * Receive query string from the browser /copy CGIDEV2/qrpglesrc,prolog3 * Parse it into program variables C eval cust = zhbgetvar('cust') * Load external HTML C callp gethtml('HTMLSRC' : C 'AJAX' : C 'CUST') C move cust sCUSNUM C sCUSNUM chain qcustcdtl * Clear/Set html output variables C exsr ClearVar C if %found C exsr SetVar C endif * Send sections C callp wrtsection('top') * Quit C** dump(a) C exsr Exit ********************************************************************* * Close output html and quit * * Do not delete the call to wrtsection with section name *fini. It is needed * to ensure that all output html that has been buffered gets output. ********************************************************************* C Exit begsr C callp wrtsection('*fini') C return C endsr ********************************************************************* * Clear HTML output variables ********************************************************************* C ClearVar begsr C callp updHTMLvar('CUSNUM' : *BLANKS) C callp updHTMLvar('LSTNAM' : *BLANKS) C callp updHTMLvar('INIT' : *BLANKS) C callp updHTMLvar('STREET' : *BLANKS) C callp updHTMLvar('CITY' : *BLANKS) C callp updHTMLvar('STATE' : *BLANKS) C callp updHTMLvar('ZIPCOD' : *BLANKS) C callp updHTMLvar('CDTLMT' : *BLANKS) C callp updHTMLvar('CHGCOD' : *BLANKS) C callp updHTMLvar('BALDUE' : *BLANKS) C callp updHTMLvar('CDTDUE' : *BLANKS) C endsr ********************************************************************* * Set HTML output variables ********************************************************************* C SetVar begsr * Cust # (and clear all HTML output variables) C callp updHTMLvar('CUSNUM' : C cust : C '0') * Remaining variables C callp updHTMLvar('LSTNAM' : LSTNAM) C callp updHTMLvar('INIT' : INIT ) C callp updHTMLvar('STREET' : STREET) C callp updHTMLvar('CITY' : CITY ) C callp updHTMLvar('STATE' : STATE ) C callp updHTMLvar('ZIPCOD' : C %char(ZIPCOD)) C callp updHTMLvar('CDTLMT' : C %char(CDTLMT)) C callp updHTMLvar('CHGCOD' : C %char(CHGCOD)) C callp updHTMLvar('BALDUE' : C %char(BALDUE)) C callp updHTMLvar('CDTDUE' : C %char(CDTDUE)) C endsr