Sebastiangperez Posted April 4, 2006 Share Posted April 4, 2006 dear PHPhreaks How i can create a dynamic calendar , that i can put dates on a database, and then show into the calendar whit another colors , like a booking hotel system , i want to make by my self .. i need a little help ..best regards.Sebastian msm:sebastiangperez@hotmail.com Quote Link to comment https://forums.phpfreaks.com/topic/6580-how-to-create-a-dynamic-calenda/ Share on other sites More sharing options...
djnrempel Posted April 4, 2006 Share Posted April 4, 2006 [!--quoteo(post=361609:date=Apr 4 2006, 12:16 PM:name=Sebastiangperez)--][div class=\'quotetop\']QUOTE(Sebastiangperez @ Apr 4 2006, 12:16 PM) [snapback]361609[/snapback][/div][div class=\'quotemain\'][!--quotec--]dear PHPhreaks How i can create a dynamic calendar , that i can put dates on a database, and then show into the calendar whit another colors , like a booking hotel system , i want to make by my self .. i need a little help ..best regards.Sebastian msm:sebastiangperez@hotmail.com[/quote]Umm, that's a pretty broad request. I suggest you start working on one (or search through script archives) and then post here as you need help solving individual problems. That's how I learned PHP, function by function as I tackled different problems.In broad terms, you will need to design what it should look like, create a script that will generate that, and then build the parts that will read data from users, add it to the database, and then display search results. I have a script that displays a calendar of the last 31 days, if that helps - see it in action at [a href=\"http://frood.net/comics/\" target=\"_blank\"]http://frood.net/comics/[/a][!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]$blankdays= strval(date("w", tt('30')));$emptycells="";$x=0;while ($x<$blankdays): $x++; $emptycells .= '<td> </td>'; endwhile; echo '<table border="1" cellpadding ="3"><tr><th>Sun.</th><th>Mon.</th><th>Tue.</th><th>Wed.</th><th>Thu.</th><th>Fri.</th><th>Sat</th></tr><tr>'.$emptycells;$x=31; while ($x>0): $x--; $month=date("M", tt($x)); $weekday=date("D", tt($x)); $numdate=date("j", tt($x)); $break=''; if ($weekday=="Sat") $break="</tr>\n<tr>"; $style='""'; if ($weekday=="Sun") $style='"font-weight:bold;"'; echo "date("n/j", tt($x))."</td>$break "; endwhile; $blankdays= 7-(strval(date("w", tt(0))));$emptycells="";$x=1;while ($x<$blankdays): $x++; $emptycells .= '<td> </td>'; endwhile; echo $emptycells.'</tr></table>';[/quote] Quote Link to comment https://forums.phpfreaks.com/topic/6580-how-to-create-a-dynamic-calenda/#findComment-23862 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.