I designed a budget inside the customer portal using wpdatatables, in total we have 15 diferent tables where the end user adds budget, payments done and balance.
I need to build a summary table that grabs the data from all 15 tables and shows the data.
Each table is user based therefore only that 1 user will see the data they have inputed and this summary also needs to be this way.
If those 15 tables are stored in the database, you could probably use SQL query to pull the necessary information in one table, and use condition like:
WHERE userid = %CURRENT_USER_ID%
So the relevant data is displayed only to the customer currently logged in, hiding the data of all other customers.
Can you help me do this? I need help from someone that knows the tool and this is very urgent for the client, this is the only thing holding the go live of the website :)
It has budget categories and 15+ tables, what i need to consolidate (add+) is the integer added on each of those tables for "Costo Aproximado" and "Monto Pagado" so that then this can be added into a new table and show a consolidated amount..
On the new table i need to add a third column with the variance (substract -) between them.
select userid, sum(montopagado) totalpagado, sum(costoaproximado) totalaproximado from ( select userid, montopagado, costoaproximado from wpkv_wpdatatable_1_2 union all select userid, montopagado, costoaproximado from wpkv_wpdatatable_1_2_1 union all select userid, montopagado, costoaproximado from wpkv_wpdatatable_1_2_1_1 union all select userid, montopagado, costoaproximado from wpkv_wpdatatable_1_2_1_1_1 union all select userid, montopagado, costoaproximado from wpkv_wpdatatable_1_2_1_1_1_1 ) t Group by userid
its pulling the data but now i need to add "where" the data is only shown for the logged in user at that time and for the data stored that belongs to him only.
You could take advantage of our placeholder here, like mentioned in the previous reply.
If you have a userid column, then all you need to do is add the WHERE clause, like this:
select userid, sum(montopagado) totalpagado, sum(costoaproximado) totalaproximado
from
(
select userid, montopagado, costoaproximado
from wpkv_wpdatatable_1_2
union all
select userid, montopagado, costoaproximado
from wpkv_wpdatatable_1_2_1
union all
select userid, montopagado, costoaproximado
from wpkv_wpdatatable_1_2_1_1
union all
select userid, montopagado, costoaproximado
from wpkv_wpdatatable_1_2_1_1_1
union all
select userid, montopagado, costoaproximado
from wpkv_wpdatatable_1_2_1_1_1_1
) t
Group by userid
WHERE userid = %CURRENT_USER_ID%
and it will only show the rows associated to the user currently logged in.
Unfortunately, I am not able to help you in writing custom queries as that is out of scope of the support provided for the plugin, which only refers to advice.
I designed a budget inside the customer portal using wpdatatables, in total we have 15 diferent tables where the end user adds budget, payments done and balance.
I need to build a summary table that grabs the data from all 15 tables and shows the data.
Each table is user based therefore only that 1 user will see the data they have inputed and this summary also needs to be this way.
How can I do this?
Hello Guillermo.
Thank you for your interest in our plugin.
If those 15 tables are stored in the database, you could probably use SQL query to pull the necessary information in one table, and use condition like:
So the relevant data is displayed only to the customer currently logged in, hiding the data of all other customers.
Best regards.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Can you help me do this? I need help from someone that knows the tool and this is very urgent for the client, this is the only thing holding the go live of the website :)
Pls pls pls pls help me
Ive played around building relations with SQL and have had no luck at all...
the url is :
https://bodas.cr/presupuesto-nuevo/
It has budget categories and 15+ tables, what i need to consolidate (add+) is the integer added on each of those tables for "Costo Aproximado" and "Monto Pagado" so that then this can be added into a new table and show a consolidated amount..
On the new table i need to add a third column with the variance (substract -) between them.
made some progress, did ths:
select userid, sum(montopagado) totalpagado, sum(costoaproximado) totalaproximado
from
(
select userid, montopagado, costoaproximado
from wpkv_wpdatatable_1_2
union all
select userid, montopagado, costoaproximado
from wpkv_wpdatatable_1_2_1
union all
select userid, montopagado, costoaproximado
from wpkv_wpdatatable_1_2_1_1
union all
select userid, montopagado, costoaproximado
from wpkv_wpdatatable_1_2_1_1_1
union all
select userid, montopagado, costoaproximado
from wpkv_wpdatatable_1_2_1_1_1_1
) t
Group by userid
its pulling the data but now i need to add "where" the data is only shown for the logged in user at that time and for the data stored that belongs to him only.
Whats the class name or id used for active user?
Hi Guillermo.
Good job on doing this.
You could take advantage of our placeholder here, like mentioned in the previous reply.
If you have a userid column, then all you need to do is add the WHERE clause, like this:
and it will only show the rows associated to the user currently logged in.
Unfortunately, I am not able to help you in writing custom queries as that is out of scope of the support provided for the plugin, which only refers to advice.
Best regards.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables