Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.

  • 21/11/2023 BLACK FRIDAY 23 is coming

    BIG SALE, 35% discount for all our extensions. Use BF23 coupon code. Hurry up the discount is valid till 27 November.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

SESSION like a query parameter
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: SESSION like a query parameter
#21928
SESSION like a query parameter 12 Years, 5 Months ago Karma: 0
Hi,

i have a problem. I need to retreive data by a query in a module AriDataTable based on a session variable that i retreive in the same article.

In the article:
{jumi [jumi_includes/Select_CodClasse.php]}

{aridatatables moduleId="118"}


The query in the moduleId 118 is.

SELECT dbo_coordinatori.Nominativo, Ricevimento FROM (dbo_coordinatori INNER JOIN scrutini_classi ON dbo_coordinatori.IdInsegnante = scrutini_classi.CodCoordinatore) WHERE scrutini_classi.idClasse = ??????????;

How can i do to give $_SESSION[codclasse] like a parameter of the query of the module?

I've tried to modify the \modules\mod_aridatatables\includes\kernel\DataTables\Models\class.DataTablesDataSqlModel.php file adding these rows:
if (strpos($query, '{$_SESSION:') !== false)
{
$session = $_SESSION;
$db =& JFactory::getDBO();

AriArrayHelper::walkRecursive($session, array(&$db, 'Quote'));
$params['SESSION'] = $session;
}

and then i've modified the select instruction in this way

SELECT dbo_coordinatori.Nominativo, Ricevimento FROM (dbo_coordinatori INNER JOIN scrutini_classi ON dbo_coordinatori.IdInsegnante = scrutini_classi.CodCoordinatore) WHERE scrutini_classi.idClasse = {$_SESSION[codclasse]};
or this way
SELECT dbo_coordinatori.Nominativo, Ricevimento FROM (dbo_coordinatori INNER JOIN scrutini_classi ON dbo_coordinatori.IdInsegnante = scrutini_classi.CodCoordinatore) WHERE scrutini_classi.idClasse = {$_SESSION:codclasse};

...but i don't retreive any data.

Someone can help me?
Paolo
The administrator has disabled public write access.
 
#21931
Re:SESSION like a query parameter 12 Years, 5 Months ago Karma: 748
Hello,

Try to use the next SQL query:

Code:


SELECT dbo_coordinatori.Nominativo, Ricevimento FROM (dbo_coordinatori INNER JOIN scrutini_classi ON dbo_coordinatori.IdInsegnante = scrutini_classi.CodCoordinatore) WHERE scrutini_classi.idClasse = {$SESSION:codclasse}



If it doesn't help, could you provide temporary access to your J! backend by email so we can investigate the problem?

Regards,
ARI Soft
The administrator has disabled public write access.
 
Go to topPage: 1