Hi,
I have a view that gives me the records of MONTH(`CreationDate`)= MONTH(NOW())
Is it possible to make this "interactive" when the View is started?
So I would start the <viewname> = <interactive.....this will be the number of a month> or so
Ron
Interactive view
Re: Interactive view
Hi Ron,
maybe use the hooks folder for this?
You might use the already existing your existing view and add an extra WHERE to it using the (search forum: search.php?keywords=querywhere )
argument. So add your dynamic month to that. You can grab the month from a dropdown of your page with something like this
when you have a dropdown like this
where you can add a "selected" using php to the current month.
or, alternatively you can simply add ?month=5 to your URL when opening the view.
Another way I am sometimes working when I need to use a custom (long) SQL for view only, is to define my SQL completely in the custom (!) code of the page.
Olaf
maybe use the hooks folder for this?
You might use the already existing your existing view and add an extra WHERE to it using the
Code: Select all
$options->QueryWhere =
argument. So add your dynamic month to that. You can grab the month from a dropdown of your page with something like this
Code: Select all
//number of month
$criteria_month = isset($_GET['month']) ? makeSafe($_GET['month']) : date('n');
Code: Select all
<label for="month">Month: </label>
<select id="month" name="ziel" class="input-sm">
<option value="1">January</option>
...
<option value="12">December</option>
</select>
or, alternatively you can simply add ?month=5 to your URL when opening the view.
Another way I am sometimes working when I need to use a custom (long) SQL for view only, is to define my SQL completely in the custom (!) code of the page.
Olaf
Some postings I was involved, you might find useful:
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view
Re: Interactive view
Hi Olaf,
Thank you for answering.
I'm not that familiar with PHP, however I'll look into your given link to the forum.
Thanks so far.
Ron
Thank you for answering.
I'm not that familiar with PHP, however I'll look into your given link to the forum.
Thanks so far.
Ron