Structured Programming Trouble
Posted: Wed Jul 01, 2009 12:51 pm
I'm not sure it it's doing this because of some quark of PHP but when I run the code below it will show values in the first table generated but not the second. There are values in the database I double and triple checked that it did. Any help would be greatly appreciate it.
I know this can be done with a loop, I am just trying to get the program working right now. The program generates the tables but only displays values for the first table and for the second on it only puts the "$" that I appended to the strings. If there is anything that is unclear let me know and I will elaborate.
Code: Select all
if(isset($store_number['store1'])) //Checks to see if the user has a store number associated with them.
{
$store = $store_number['store1'];
?>
<h3>Store: <?= $store?> <a href="graph/graph.php?id=<?=$store?>" target="_blank" align="center">Graph</a></h3>
<?
$numbers['week'] = get_week($store_number['store1']); //Each of these functions are located in a seperate fuctions.php file
$numbers['retail'] = "$".get_retail($store_number['store1']);
$numbers['service'] = "$".get_service($store_number['store1']);
$numbers['netsales'] = "$".get_netsales($store_number['store1']);
$numbers['clients'] = get_clients($store_number['store1']);
$numbers['serviceavg'] = "$".get_serviceavg($store_number['store1']);
$numbers['natserviceavg'] = "$".get_natserviceavg($store_number['store1']);
$numbers['retailavg'] = "$".get_retailavg($store_number['store1']);
$numbers['natretailavg'] = "$".get_natretailavg($store_number['store1']);
$numbers['floorhrs'] = get_floorhrs($store_number['store1']);
include('table.php'); //Generates a table to display the values.
}
if(isset($store_number['store2']))
{
$store = $store_number['store2'];
?>
<h3>Store: <?= $store?> <a href="graph/graph.php?id=<?=$store?>" target="_blank" align="center">Graph</a></h3>
<?
$numbers['week'] = get_week1($store_number['store2']);
$numbers['retail'] = "$".get_retail($store_number['store2']);
$numbers['service'] = "$".get_service($store_number['store2']);
$numbers['netsales'] = "$".get_netsales($store_number['store2']);
$numbers['clients'] = get_clients($store_number['store2']);
$numbers['serviceavg'] = "$".get_serviceavg($store_number['store2']);
$numbers['natserviceavg'] = "$".get_natserviceavg($store_number['store2']);
$numbers['retailavg'] = "$".get_retailavg($store_number['store2']);
$numbers['natretailavg'] = "$".get_natretailavg($store_number['store2']);
$numbers['floorhrs'] = get_floorhrs($store_number['store2']);
include('table.php');
}
I know this can be done with a loop, I am just trying to get the program working right now. The program generates the tables but only displays values for the first table and for the second on it only puts the "$" that I appended to the strings. If there is anything that is unclear let me know and I will elaborate.