Hello everybody, i'm new to chrono so my question i simple for the most of you (i hope).
I wanto to share tha value of a variable between header, body and footer. For example, i have a variable used in the body to count the records and i want to print the value in the footer. It seems that in the footer the varibale is not valorized. Why? How and where have i declare my vars to share its.
Thanks to anyone who can help me.
Salvatore
I wanto to share tha value of a variable between header, body and footer. For example, i have a variable used in the body to count the records and i want to print the value in the footer. It seems that in the footer the varibale is not valorized. Why? How and where have i declare my vars to share its.
Thanks to anyone who can help me.
Salvatore
Hi Salvatore,
Please show us the code snippets for the counter in the body and footer.
Bob
Please show us the code snippets for the counter in the body and footer.
Bob
something like this in the body (in $MyRow->money there are numbers):
and in the footer:
and the output is... empty!
Thanks at advance
Salvatore
<?php
$tmp = $MyRow->money;
$money_total = $money_total + $tmp;
?>
and in the footer:
<?php
echo $money_total;
?>
and the output is... empty!
Thanks at advance
Salvatore
Hi tot72,
Try adding global $money_total; in both places (and possibly in the header too??)
Bob
Try adding global $money_total; in both places (and possibly in the header too??)
Bob
Hi GreyHead, thank you for your response. I solved inserting the global declaration in bot body and footer, it seems to be non necessary in the header. Just to give some ideas to anyone, i have inserted a div into the header, and via javascript into the footer i update the text of the div via innerHTML, with the value of the variable defined into the body.
Thanks again,
Salvatore
Thanks again,
Salvatore
I have a similar need in CC, but would prefer to avoid the javascript work around described in related posts.
I am writing a php if/then to display a link to "new record" in the footer only if a current record does not exist.
If a record does exist - the edit/delete links will be displayed in the body and the footer will not show.
The "global" idea sounded promising but kicked out lots of errors. Can you give me an example of syntax to set the variable and call it up in the footer?
I tried using this in the body to set the variable:
I tried using this in the footer to call it up:
Thanks in advance.
I am writing a php if/then to display a link to "new record" in the footer only if a current record does not exist.
If a record does exist - the edit/delete links will be displayed in the body and the footer will not show.
The "global" idea sounded promising but kicked out lots of errors. Can you give me an example of syntax to set the variable and call it up in the footer?
I tried using this in the body to set the variable:
<?php
global $hasvalue = $MyRow->cf_id;
?>
I tried using this in the footer to call it up:
<?php
echo $hasvalue;
?>
Thanks in advance.
This topic is locked and no more replies can be posted.