Hi all,
I am using Table Display type in my CC.
I have variable in header code (frontlist -> list display -> table) and I need to transmit (use) this variable in php functions (frontlist -> settings). I used global operaror, but it doesnt work.
interesting is that variable used in php functions as global is visible in header code, but in reverse direction isnt visible.
any idea?
thx
I am using Table Display type in my CC.
I have variable in header code (frontlist -> list display -> table) and I need to transmit (use) this variable in php functions (frontlist -> settings). I used global operaror, but it doesnt work.
interesting is that variable used in php functions as global is visible in header code, but in reverse direction isnt visible.
any idea?
thx
Hi homeopat,
How do you call/set the variable ? you may try to store it in the session, or store it in the $_POST array.
Regards,
Max
How do you call/set the variable ? you may try to store it in the session, or store it in the $_POST array.
Regards,
Max
Hi Max,
I used global variable, but it doesnt work in this direction (from header to body - table display type)
Then I have tried $_POST, $_GET and $_SESSION and this works particulary. I mean that I have to click on submit button twice to get correct value.
I dont know why it works that way
I used global variable, but it doesnt work in this direction (from header to body - table display type)
Then I have tried $_POST, $_GET and $_SESSION and this works particulary. I mean that I have to click on submit button twice to get correct value.
I dont know why it works that way
Sorry, but which submit button ?
And why do you need to pass a variable from header to row ?
And why do you need to pass a variable from header to row ?
submit button for filtering part of data where I use variable wich I need calculated to the end (from all records - not filtered only).
So I have a query in header box and I need to transmit this variable to body for calculate to the end.
thx
So I have a query in header box and I need to transmit this variable to body for calculate to the end.
thx
Hi homeopat,
Sorry for the late reply!
What about doing your calculation and using the variable all in one place ? the $rows variable is available in the header and footer, so you can simply do a foreach loop and calculate the result you need.
Let me know!
Regards,
Max
Sorry for the late reply!
What about doing your calculation and using the variable all in one place ? the $rows variable is available in the header and footer, so you can simply do a foreach loop and calculate the result you need.
Let me know!
Regards,
Max
I will describe what I need.
I have table with dates and values and I have filter by months. I calculate the saldo value by code (not saved in db).
So If I need show data in definite season (i.e. march) I have to calculate the saldo value from the begining (this is done in header) and then I need to transmit this value to body for showing exact saldo of that month.
one way is in $_session ($_GET and $_POST dont work). But I have to click twice od submit button (filer) to get correct value in saldo column.
do you understand me?
thx.
I have table with dates and values and I have filter by months. I calculate the saldo value by code (not saved in db).
So If I need show data in definite season (i.e. march) I have to calculate the saldo value from the begining (this is done in header) and then I need to transmit this value to body for showing exact saldo of that month.
one way is in $_session ($_GET and $_POST dont work). But I have to click twice od submit button (filer) to get correct value in saldo column.
do you understand me?
thx.
Ok, please try this:
Create a new Chronoform, add a "Connection action" to the "on load", set the action to "index" and set the connection's name, add a "custom code" action before it and do your calculation then set that inside global variable or $_POST then use it in the rows.
Does this work ?
regards,
Max
Create a new Chronoform, add a "Connection action" to the "on load", set the action to "index" and set the connection's name, add a "custom code" action before it and do your calculation then set that inside global variable or $_POST then use it in the rows.
Does this work ?
regards,
Max
I understand you, but I forgot said you one thing.
In custom code I use $row variables from CC for setting query in where statement.
resume>
My CC is named "newpokladnikniha"
I have created a CF named "pokladnikniha-saldo"
I put to on load section Custom code with hello echo and then put Connection Action with name "newpokladnikniha" and action "index".
If I put to the CF in custom code echo "hello" then doesnt show in CC.
thx
In custom code I use $row variables from CC for setting query in where statement.
resume>
My CC is named "newpokladnikniha"
I have created a CF named "pokladnikniha-saldo"
I put to on load section Custom code with hello echo and then put Connection Action with name "newpokladnikniha" and action "index".
If I put to the CF in custom code echo "hello" then doesnt show in CC.
thx
custom code
<?php
echo "holaho";
?>
But then how do you access the action ? you should access it using the form link, did you try that ?
No, I didnt.
so I put to the FrontList --> actions - view - form event : pokladnikniha-saldo:load
but nothing happened, no holaho text.
so I put to the FrontList --> actions - view - form event : pokladnikniha-saldo:load
but nothing happened, no holaho text.
No, frontlist > actions > index > form event
Then try to test it using the connection's main page or the form link too.
Then try to test it using the connection's main page or the form link too.
Hi max,
it doesnt work. nothing depict if I have simple echo "holaho" in custom code.
I tried in CC put this code to frontlist > actions > index > code
but same result, nothing depict.
it doesnt work. nothing depict if I have simple echo "holaho" in custom code.
I tried in CC put this code to frontlist > actions > index > code
<?php
echo "holaho";
?>
but same result, nothing depict.
Hi homeopat,
Apologies for the late reply!
I checked the code and found that in the table block, the body is processed before the header, but its output is only sent after the header output is sent.
So, you can either build your list using the "custom" block, or send me a message using the "contact us" page to get a patch file and test it.
Regards,
Max
Apologies for the late reply!
I checked the code and found that in the table block, the body is processed before the header, but its output is only sent after the header output is sent.
So, you can either build your list using the "custom" block, or send me a message using the "contact us" page to get a patch file and test it.
Regards,
Max
This topic is locked and no more replies can be posted.