Jump to content

How to make a fill in calender


Bjornww

Recommended Posts

Hello,

 

I tried searching around the web and all kinds of php / mysql tutorials but I can't seem to find something on how to make what I want.

 

I would like to make it possible to make a calender on my website that different persons can fill in for themselves and that's visible for everyone that's logged in.

 

What I have: a database with some different users in it.

What I want:

- A calender (like the one in the picture I added) where everyone can fill in their own column and not someone elses.

- To make it possible that when a new user is added in the database, he's also added as a member on the calender. So if I add member 11 as a user, he gets his column after member 10. This would be the same if a member is removed.

- Automated new months in the calender.

 

If  anyone has any idea's on how to make this into a php/html website with a new database to store the inserts from everyone, I would be deeply thankfull.

 

Greetings

 

 

 

[attachment deleted by admin]

Link to comment
Share on other sites

Creating a calendar like the above is as simple as:

 

create table user (
  id integer not null auto_increment,
  ..
  primary key (id));

create table calendar (
  id integer not null auto_increment,
  user_id integer,
  content text,
  datum datetime,
  key calendar_user_id_fk (user_id),
  primary key (id));

 

I assume you can write the required PHP code using the above data and that you can create a simple table. You probably also need the queries:

 

SELECT * FROM calendar WHERE month(datum) = $month; -- zoom to a month
SELECT * FROM calendar WHERE year(datum) = $year; -- zoom year
SELECT * FROM calendar WHERE week(datum) = $week; -- zoom week

 

[ot]Als dit voor je huiswerk is mag ik je eigenlijk niet helpen :)[/ot]

Link to comment
Share on other sites

Thank you for the reply. :) I'm gonna take a look at it tomorrow at work to see if I can make it this way.

 

And it's not for my homework.  :P

I work at a greenhouse and I want to make an online calendar so our parttimers can enter when they're available.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.