AJLX Posted March 2, 2012 Share Posted March 2, 2012 Hello Guys, My goal is to make a Php and SQL calendar. I started learning php and sql a while ago, and basically got distracted. I'm now back, with a new project in the unhelpful position of having forgotten most of what I had learnt! I am making a project where I want to make a booking system. I have 3 rooms that are available to be booked Room 1, Room 2 and Room 3. I want to make a table that displays the current year in the top row, with the option to be able to click on a '<' or a '>' to change years. I want the same option for months and weeks. I think I am happy with how I would do this. The next bit is more tricky. I want a column for each of the days of the week. directly under this I want to display the correct date, under the correct day, starting with the current week we are on. for example it might look like this: ------------------------------------------- | < 2012 > | ------------------------------------------- | < March > | ------------------------------------------- | < 2 > | ------------------------------------------- |mon | tues | wed| thur | fri | sat | sun | | 5th | 6th | 7th| 8th |9th |10th| 11th | --------------------------------------------- Room 1 | yes | | | | | | | ---------------------------------------------- Room 2 | | | yes | | | | | ---------------------------------------------- Room 3 | | | | |yes | | | ---------------------------------------------- Although at the moment I'm struggling with the whole flippin' thing, the main issue is getting the correct dates to line up under the correct days of the week. I'm not asking for you to do this for me- but a bit of gentle help in this, and maybe some general advice in what I'm trying to achieve would be really useful! Regards, AJLX Quote Link to comment https://forums.phpfreaks.com/topic/258146-php-calendar-help/ Share on other sites More sharing options...
AJLX Posted March 3, 2012 Author Share Posted March 3, 2012 Hi guys, Sorry I can't seem to find an edit button? I have made a start on building a table to do what I want: www.swerv.ajlx.co.uk My current issue is trying to make the previous and next buttons work for the year, month, and week. I am using this as the code for the '>' year button. echo "<a href='{$_SERVER['PHP_SELF']}?nextyear=nextyear'> > </a>"; I am then checking the url, and then trying to implement this code: if($_GET['nextyear']=="nextyear") $year = strtotime(date("Y", strtotime($date)) . " +1 year"); else($year = date('Y')); Can any one see what is obviously wrong with the above code? presumably once this bit is done it will be easy to copy it for months, and then, with a bit of tweeking the weeks. Regards Andy Jones Quote Link to comment https://forums.phpfreaks.com/topic/258146-php-calendar-help/#findComment-1323516 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.