Sign in to follow this  
bakes

Fusion Real Time Charts

Recommended Posts

Below is my PHP script that generates the daily PV from our AS400 but it wont work when I use the echo "&value=".$PV; line.  Howerver if I comment it out and use the echo "&value=".$num; (which is just a random number) it works just fine.  I looked at the page source for both its only 1 line long and everything looks fine.  Any ideas?

 

<?php require_once('../../Connections/dpsas400.php'); ?>

<?php

$date=date('Ymd');

$bfdrtpvq="SELECT SUM(LQORD*LNET) as NetBook FROM ECL WHERE LODTE='".$date."' and LICFAC='010'";

$bfdrtpvr = odbc_exec($as400, $bfdrtpvq);

$bfdrtpvq2="SELECT SUM(c.UNITCOST*e.LQORD) as Cost FROM ECL e LEFT JOIN CMFV0300 c on e.LPROD=c.CFPROD and e.LICFAC=c.CFFAC WHERE e.LODTE='".$date."' and e.LICFAC='010'";

$bfdrtpvr2 = odbc_exec($as400, $bfdrtpvq2);

$NetBook = odbc_result($bfdrtpvr, 'NetBook');

$Cost = odbc_result($bfdrtpvr2, 'Cost');

$PV = (($NetBook-$Cost)/$NetBook)*100;

$num = rand(0,100);

odbc_close($as400);

//echo "&value=".$num;

//echo "&value=".$NetBook;

$disp = "&value=".$PV;

echo $disp;

//echo "&value=".$Cost;

?>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this