Is there a good PHP Calendar Popup, that can be adjusted?
Moderator: General Moderators
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Is there a good PHP Calendar Popup, that can be adjusted?
I am building a little tool where the administrator can click a calendar button, up pops a calendar, they select the current date, ad it processes to show the attendance of a person to an event.
However, I want them to be able to backdate it, so they can choose a few days ago. So it cannot just use the current date.
It would also help if I could use PHP to click a popup, and be able to highlight the date in the database too. For example, if they date needs to be changed.
Is there such a thing? I know PHP probably won't have the relevant script as its Server Side, but anything that can do it.
However, I want them to be able to backdate it, so they can choose a few days ago. So it cannot just use the current date.
It would also help if I could use PHP to click a popup, and be able to highlight the date in the database too. For example, if they date needs to be changed.
Is there such a thing? I know PHP probably won't have the relevant script as its Server Side, but anything that can do it.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Is there a good PHP Calendar Popup, that can be adjusted
Could be something as simple as jQuery UI datepicker attached to a change listener. Alternately, the button could open a modal (or a new tab) which would display a calendar based on the month and year passed in as parameters. Definitely sounding like a combination of JavaScript and PHP, the former sending AJAX calls to the latter.
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Is there a good PHP Calendar Popup, that can be adjusted
Problem is, Ive never worked out how to do "change listener" scripts.
I did try, via a thread on here. It was about adding to a PHP basket, and showing the update in the template. But it never worked and I gave up.
A simple date picker is sufficient, so they select that, and hit Go.
I did try, via a thread on here. It was about adding to a PHP basket, and showing the update in the template. But it never worked and I gave up.
A simple date picker is sufficient, so they select that, and hit Go.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Is there a good PHP Calendar Popup, that can be adjusted
It's working, to a point. It seems to be submitting it in the American format, rather than the SQL format:
08/04/2015 for 4th Aug, rather than: 2015-08-04.
08/04/2015 for 4th Aug, rather than: 2015-08-04.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Is there a good PHP Calendar Popup, that can be adjusted
You absolutely must learn this. JavaScript usage is ever increasing and that's not going to change any time soon.simonmlewis wrote:Problem is, Ive never worked out how to do "change listener" scripts.
https://learn.jquery.com/events/event-basics/
Re: Is there a good PHP Calendar Popup, that can be adjusted
What's working? What does the code look like? That should be fairly trivial to change.simonmlewis wrote:It's working, to a point. It seems to be submitting it in the American format, rather than the SQL format:
08/04/2015 for 4th Aug, rather than: 2015-08-04.
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Is there a good PHP Calendar Popup, that can be adjusted
Check the docs or source. There should be a way to set the format of the date. I usually switch it to database style yyyy-mm-dd.simonmlewis wrote:It's working, to a point. It seems to be submitting it in the American format, rather than the SQL format:
08/04/2015 for 4th Aug, rather than: 2015-08-04.
(#10850)
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Is there a good PHP Calendar Popup, that can be adjusted
Code: Select all
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
$dateattend = isset($_POST['dateattend']) ? $_POST['dateattend'] : null;
<form method='POST' action='/index.php?page=search&search=$search&memberid=$row->memberid&u=dateattend'>
<input type='text' id='datepicker' name='dateattend'>
<input type='submit' value='Go'>
</form>
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Is there a good PHP Calendar Popup, that can be adjusted
Oh that's cool, didn't spot that.
Is it possible to change it from being an input field, to being an actiual image or fontawesome icon?
I guess it would have to hide the field, but not sure the best way to achieve it.
Is it possible to change it from being an input field, to being an actiual image or fontawesome icon?
I guess it would have to hide the field, but not sure the best way to achieve it.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Is there a good PHP Calendar Popup, that can be adjusted
Can the date be pre-set per page?
This is for date of birthday, so be good if I can set it at a middle ground, like 1st January 1985.... that sort of thing.
This is for date of birthday, so be good if I can set it at a middle ground, like 1st January 1985.... that sort of thing.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Is there a good PHP Calendar Popup, that can be adjusted
Do you mean with a default value?
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Is there a good PHP Calendar Popup, that can be adjusted
Yes I do. Is this possible in the top bit of code?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Is there a good PHP Calendar Popup, that can be adjusted
Can the datepicker also be enabled to push forward year by year? Because entering DOB and set at 1985, would be a pain if the person was born in 1991.... Sooooo many clicks...!!!
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Is there a good PHP Calendar Popup, that can be adjusted
Yes, using value="whatever" as you would in any other input element.simonmlewis wrote:Yes I do. Is this possible in the top bit of code?