Jump to content

Postable Calender


syco
 Share

Recommended Posts

Can some show me how to make or give me codes for a calender that people can post "requested" appointment times, for a hair salon website. then if possible make it give a notification email with a accept or deny action?

Link to comment
Share on other sites

I'm not going to do it for you, you need to learn some PHP first.Just to help you out, I'll tell you what you need:

You need to think, learn to structure data. Try to break down your idea into things you're able to tell the computer.

Link to comment
Share on other sites

the hardest part about calendars is getting the offset correct in the tables. I saw a method used in a tutorial... the link ishttp://www.evolt.org/quick_calendar_using_ajax_and_phpFrom what i can give you the logic goes like this:get the current month, day, year.figure out what day of the week the first isfigure out how many days are in the current monthdivide days by seven, rounding up to count the weeks.loop through the weeks loop from 0-6 (1-7 respectively) for each day. subtract the current number from the day that first day is, any days not in the current month will be <=0, so you don't display those, only empty spaces. The database interaction in the tutorial i gave you i dont much like. I'd preffer timestamps and an increment value column, but you can choose whatever you like. obviously you'd need to add an hour/minute column if you'd like to stick with the syntax shown previously in the tutorial since this is an appointment kind of thing. Best of luck

Link to comment
Share on other sites

by following that guide, it gives you a pretty much done n done calendar script. your job would be to thusly alter it to include hours/minuntes in the db, check the dates, and make sure that they dont conflict with one another.

Link to comment
Share on other sites

Here was a calendar I made a long time ago; you can use it. It just displays a table calendar, with the month and year at the top.

<style type="text/css">  .day {	text-align: center;  }  .ds {	text-align: right;  }</style><table border="1" width="20%"><tr>  <td colspan="7" align="center"><?php  $date=explode(' ', date('F n Y t'));  $days=array('S', 'M', 'T', 'W', 'T', 'F', 'S');  $fom=date('w', mktime(0, 0, 0, $date[1], 1, $date[2]));  $eom=date('w', mktime(0, 0, 0, $date[1], $date[3], $date[2]));  $space=0;  echo "{$date[0]} {$date[2]}</td>\n</tr>\n<tr>\n";  for ($i=0; $i<count($days); $i++) {	echo "  <td class=\"day\">{$days[$i]}</td>\n";  }  for ($j=0; $j<$date[3]+$fom+6-$eom; $j++) {	if ($j%7==0) {	  echo "</tr>\n<tr>\n";	}	echo "  <td class=\"ds\">";	if ($space<$fom) {		echo " ";		$space++;	}	elseif ($j-$fom>=$date[3]) {	  echo " ";	}	else {	  echo $j-$fom+1;	}	echo "</td>\n";  }?></tr></table>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...