/    Sign up×
Community /Pin to ProfileBookmark

[Calendar] Saving selected days

I have a calendar.

[URL=”http://www.wdk.be/test/calendar.php”]LINK[/URL]

And it’s possible to select days (onClick >> change class).
But now I need a way to save selected days so I can load them later.

Could somebody help me to find the best way for doing that?

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@paulkoanFeb 14.2008 — Would they need to be saved for each person? Would people need to be able to see each others highlighted days? Would the owner of the site need to know which days were clicked?

Perhaps you could start with what you are trying to achieve, then we can go from there to see what is the best approach.

Paul
Copy linkTweet thisAlerts:
@skChauthorFeb 14.2008 — Yes, they need to be saved separate for each person.

Well, I have a database with clients and only the owner must be able to click/select days. The intention of this application is to manage payments for each client.
Copy linkTweet thisAlerts:
@paulkoanFeb 14.2008 — Right, I see, so your calendar.php needs to be able to understand which days were clicking, and store this information in the database.

From what I can tell, you are currently identifying which dates are selected by changing the style of the cell. So you are going to need another javascript function that you can attach to a button that passes all of the highlighted cells to calendar.php, and then calendar.php would then save them to the database.

Calendar.php would also need to read them from the database, and display them as the calendar is displayed.

You will also need a means of identifying users, such as with a login screen with userids and passwords.

You have a lot to do. Have you considered looking for an application that does what you need already?
Copy linkTweet thisAlerts:
@skChauthorFeb 16.2008 — I was thinking to make a javascript function that goes through each cell and checks the style of that cell. If style = "selected" then puts it in a hidden field and when it's done, sends that field to a php page.
Copy linkTweet thisAlerts:
@paulkoanFeb 16.2008 — Yeah, that's right.

If you are driving from javascript then you also have the opportunity to do it asynchronously. Like an ajax kinda thing.

But still, this is just selection - the back-end storage, retrieval and admin is where the work is.
×

Success!

Help @skCh spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...