PDF='MAIN' { ATTRIBUTES='*' { PLATFORM='php.txt'; REPTYPE='1'; OBJECTNAME='ssgrphp.php'; LIBLOBJ='*FILES'; TITLE='single series graph PHP'; WEBPATH='http://192.168.0.100/wsphp/'; TARGETPATH='/www/zendcore/htdocs/wsphp/'; FTPSITE='100box'; SET='-1'; VERSION='4.00'; CRTBNUM='Revision 2166'; CRTTEMPLT='C:\\Program Files\\ESDI\\WebSmart6.8\\WebSmart\\Templates v6.8\\PHP Templates\\iSeries SQL\\Lincoln\\A Simple Page.tpl'; SAVBNUM='Revision 2166'; REPSYSTEM='ESDI520'; LASTLOC='1'; VHTML='N'; LASTSAVE='3/5/2008 14:54:18'; } FTPREFINFO='*' { URL='192.168.0.100'; INITIALDIR='/www/zendcore/htdocs/wsphp/'; FTPPORT='21'; PASSIVEMODE='1'; WEBPATH='http://192.168.0.100/wsphp/'; } PANELS='*' { PANEL='MainSeg' { DESC='Main Segment'; DETAILS=' Example 149 Single Series SmartChart graph built using WebSmart PHP
Example 149 Single Series SmartChart graph built using WebSmart PHP
'; } PANEL='GraphSeg' { DESC='GraphSeg'; DETAILS=' $graphdata '; } } PREVIEWS='*' { DEFAULT='MainSeg'; PREVIEW='MainSeg' { SEG='MainSeg'; } } ACTIONS=' // Program Name: ssgrphp.php // Program Title: single series graph PHP // Created by: SPOT // Template family: Lincoln // Template name: Simple Page // Purpose: // Program Modifications: require(\'/esdi/websmart/v6.8/include/xl_functions001.php\'); //globalize the variables global $selstring, $graphdata, $numdecimals, $decFormat, $numPrefix, $numSuffix; global $formatNum, $altGridColors, $xName, $yName, $grCaption, $grSubCaption; global $yAxisMin, $showGrValues, $showGrNames, $grWidth, $grHeight; //Set Graph properties. You can find more properties and their settings at //http://www.excelsystems.com/smartcharts/helpdocs/Index.html. Click on Single Series Chart XML //then 3D Column Chart. $numdecimals = "0"; $decFormat = "."; $numPrefix = ""; $numSuffix = " Units"; $formatNum = "0"; $altGridColors = "0"; $xName = ""; $yName = "Inventory"; $grCaption = "Inventory On Hand"; $grSubCaption = ""; $yAxisMin = "0"; $showGrValues = "1"; $showGrNames = "1"; $grWidth = "700"; $grHeight = "400"; // DB Connection code $options = array(\'i5_naming\' => DB2_I5_NAMING_ON); global $db2conn; $db2conn = xl_db2_connect($options); if(!$db2conn) { die(\'Could not connect to database: \' . db2_conn_error()); } // run the specified task switch($pf_task) { case \'default\': generic(); break; // Record display option case \'RUN_REPORT\': buildgraph(); break; } function generic() { wrtseg(\'MainSeg\'); } function buildgraph() { // Make all global variables available here foreach($GLOBALS as $arraykey=>$arrayvalue) { if($arraykey[0]!=\'_\' && $arraykey != \'GLOBALS\') global $$arraykey; } $graphdata = ""; //Get Level Break category names and values for graph $selstring = "select IMCAT,sum(IMQTONHD) AS IMQTONHD from xl_webdemo/mu_itmf group by IMCAT" ; //test the resource statement if (!($stmt = db2_exec($db2conn, $selstring))) { echo "Error ".db2_stmt_error() .":".db2_stmt_errormsg(). ""; die; } // While SQL retrieves records assign the names and values while ($row = db2_fetch_assoc($stmt)) { // Get the fields $IMCAT = $row["IMCAT"]; $IMQTONHD = $row["IMQTONHD"]; $graphdata = $graphdata ."\\r\\n"; } //close the connection db2_close($db2conn); //output the graph wrtseg(\'GraphSeg\'); } '; FILES='*' { FILE='MU_ITMF' { LIBRARY='XL_WEBDEMO'; RCDFORMAT='R_ITMF '; LEVELID='1071025172821'; RFLEVELID='3DFDDACCC07BD'; EXTDS='0'; } } }