Contact Us Today! | vcare@wdmtech.com

WDMtech

Topic-icon Multi-column chart + year drop-down

More
5 months 2 weeks ago #3797

Hello,
It is not implemented in Extra condition, You can use this in Custom Query only.


Thanks
Daniel

Please Log in or Create an account to join the conversation.

  • Vladimir Kocic
  • Vladimir Kocic's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
5 months 2 weeks ago #3794

I tried using the variable like this -> {chartYearStart} in the extra condition, like it is shown on the picture, but it doesn't work.

Attachments:

Please Log in or Create an account to join the conversation.

More
5 months 2 weeks ago #3793

Hello,
You can use all the get / post variables directly with the variable names enclosed in braces e.g. for userid you can use {userid}


Thanks
Daniel

Please Log in or Create an account to join the conversation.

  • Vladimir Kocic
  • Vladimir Kocic's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
5 months 2 weeks ago #3791

No, I just need to know what dynamic variable I need to put into MYSQL query in order to get the value from the form selection in the front end.
With the other plug-in, I used {$REQUEST:chartYearStart|empty:'2017'}, what is the equivalent for your addon?

Last Edit: 5 months 2 weeks ago by Vladimir Kocic.

Please Log in or Create an account to join the conversation.

More
5 months 2 weeks ago #3787

Hello,
Please contact our Sales team via Contact us form, We'll look into it.


Thanks
Daniel

Please Log in or Create an account to join the conversation.

  • Vladimir Kocic
  • Vladimir Kocic's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
5 months 2 weeks ago #3780

I need to create a chart like the one in the attachment.



The "Anno" selects the year, and based on that selection, the SQL query shows the data for that year.
This is the MYSQL query:
SELECT
       CONCAT(SUBSTRING(YEAR(datefield),3),'/',LPAD(MONTH(datefield),2,0)) AS Periodo,
       SUM(statistica_assunti_n.assunzioni) AS `Assunzioni`,
	   SUM(statistica_licenziati_n.licenziamenti) AS `Licenziamenti`
    FROM  calendar
	INNER JOIN statistica_assunti_n
    ON calendar.datefield = statistica_assunti_n.data_assunzioni
  INNER JOIN statistica_licenziati_n
    ON calendar.datefield = statistica_licenziati_n.data_licenziamenti
WHERE YEAR(datefield) ={$REQUEST:chartYearStart|empty:'2017'} AND datefield <= DATE(NOW())
    GROUP  BY YEAR(datefield), MONTH(datefield)
    ORDER  BY YEAR(datefield), MONTH(datefield)

On the front-view I placed this form into a joomla page:
{source}<div style="width: 70px; display: block; vertical-align: bottom;margin: left; padding: 0px; "><form action="" method="post"><select name="chartYearStart" on-change="this.form.submit();"><option value="2017">Anno</option><option value="2011">2011</option><option value="2012">2012</option><option value="2013">2013</option><option value="2014">2014</option><option value="2015">2015</option><option value="2016">2016</option><option value="2017">2017</option></select></form></div>{/source}

If you have a suggestion how to do it faster with your add-on, please tell me.

Attachments:

Please Log in or Create an account to join the conversation.