Jump to content


Photo

Calander


  • Please log in to reply
5 replies to this topic

#1 GremlinP1R

GremlinP1R
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts
  • LocationSouth Africa

Posted 10 October 2006 - 08:05 PM

Hi there

I'm looking for a neet and nice calander script.
1) to select from a pop-up calandar to insert a new date.
2) a calander that takes up the whole window in date blocks that can move from one month to another using          arrow's and display the events. with an easy update and edit function.

Can some one help please. Thanx

#2 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 10 October 2006 - 08:15 PM

are you looking for someone to write the script for you, or do you have specific questions for how to accomplish some of the things mentioned above? if you're looking to have it provided, you may be better off to post in the freelancing forum.
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#3 GremlinP1R

GremlinP1R
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts
  • LocationSouth Africa

Posted 10 October 2006 - 08:29 PM

Uhmm looking for a script. But dont have money on this stage for a freelance job.....
Got this thou looks nice and all but dont really know how to make it edit able....

<html>
<head>
<style type="text/css">
.calendar {
  font-family: arial, verdana, sans serif; 
}

.calendar td {
  border: 1px solid #eee;
}
.calendar-title {
  text-align: center;
  font-style: italic;
}
.calendar-day-title {
  text-align: center;
  font-size: small;
  background: #ccc;
  font-weight: bold;
}
.calendar-day, .calendar-outmonth-day {
  height: 60px;
  vertical-align: top;
  text-align: center;
  font-size: small;
  padding: 0px;
}
.calendar-day-number {
  text-align: right;
  background: #ddd;
}
.calendar-content { 
  padding: 2px;
  font-size: x-small;
}
.calendar-outmonth-day {
  color: #666;
  font-style: italic;
  background: #ddd;
}
</style>
</head>
<body>
<?php
class Day
{
  function Day( $inmonth, $month, $day, $year )
  {
	$this->{'month'} = $month;
	$this->{'day'} = $day;
	$this->{'year'} = $year;
	$this->{'inmonth'} = $inmonth;
	$this->{'number'} = $number;
	$this->{'text'} = "";
  }
  function get_day() { return $this->{'day'}; }
  function get_month() { return $this->{'month'}; }
  function get_year() { return $this->{'year'}; }

  function get_inmonth() { return $this->{'inmonth'}; }
  function get_number() { return $this->{'number'}; }
  function get_text() { return $this->{'text'}; }
  function set_text( $text ) { $this->{'text'} = $text; }
}

function setCalendarText( $days, $m, $d, $y, $text )
{
  foreach( $days as $day )
  {
	if ( $day->get_day() == $d &&
		 $day->get_month() == $m &&
	   $day->get_year() == $y )
	  $day->set_text( $text );
	}
}

function get_last_month( $month, $year )
{
  $lastmonth = $month - 1;
  $lastyear = $year;
  if ( $lastmonth < 0 ) { $lastmonth = 11; $lastyear -= 1; }
  return array( $lastmonth, $lastyear );
}

function get_next_month( $month, $year )
{
  $nextmonth = $month + 1;
  $nextyear = $year;
  if ( $nextmonth > 11 ) { $nextmonth = 0; $nextyear += 1; }
  return array( $nextmonth, $nextyear );
}

function makeCalendarDays( $month, $year )
{
  list( $nextmonth, $nextyear ) = get_next_month( $month, $year );
  list( $lastmonth, $lastyear ) = get_last_month( $month, $year );

  $dimlm = cal_days_in_month( CAL_GREGORIAN, $lastmonth, $lastyear );

  $jd = cal_to_jd( CAL_GREGORIAN, $month + 1, 1, $year );
  $day = jddayofweek( $jd );
  $dim = cal_days_in_month( CAL_GREGORIAN, $month + 1, $year );

  $days = array( );

  for( $d = 0; $d < $day; $d++ )
	$days []= new Day( 0, $lastmonth + 1, $dimlm - ( $day - $d ), $lastyear );

  for( $d = 1; $d <= $dim; $d++ )
	$days []= new Day( 1, $month + 1, $d, $year );

	$left = ( ( floor( ( $day + $dim ) / 7 ) + 1 ) * 7 ) - ( $day + $dim );
	for( $d = 0; $d < $left; $d++ )
	  $days []= new Day( 0, $nexmonth + 1, $d+1, $nextyear );

	return $days;
}

$today = getdate();

$year = $today['year'];
$month = $today['mon'] - 1;

if ( $_GET['year'] ) $year = $_GET['year'];
if ( $_GET['month'] ) $month = $_GET['month'];

$days = makeCalendarDays( $month, $year );

setCalendarText( &$days, $month + 1, 5, $year, "Meet<br/>Jim" );
setCalendarText( &$days, $month + 1, 10, $year, "Meet<br/>Sue" );

$months = array(
  "January", "February", "March", "April",
  "May", "June", "July", "August",
  "September", "October", "November", "December" );
$day_names = array( "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" );
?>
<div style="width:600px;">
<table class="calendar" width="100%" cellspacing="0" cellpadding="1">
<tr><td colspan="7" class="calendar-title" width="13%">
<?php
list( $nextmonth, $nextyear ) = get_next_month( $month, $year );
list( $lastmonth, $lastyear ) = get_last_month( $month, $year );
?>
<a href="cal.php?year=<?php echo($lastyear); ?>&month=<?php echo( $lastmonth );
?>">&lt;&lt;</a>
<?php echo( $months[$month] ); ?> <?php echo( $year ); ?>
<a href="cal.php?year=<?php echo($nextyear); ?>&month=<?php echo( $nextmonth );
?>">&gt;&gt;</a>
</td></tr>
<tr>
<?php foreach( $day_names as $day ) { ?>
<td class="calendar-day-title"><?php echo( $day ); ?></td>
<?php } ?>
</tr>
<?php
$p = 0;
foreach( $days as $d ) {
if ( $p == 0 ) echo ( "<tr>" );
$day_style = $d->get_inmonth() ? "calendar-day" : "calendar-outmonth-day";
?>
<td class="<?php echo( $day_style ); ?>" width="13%">

<div class="calendar-day-number">
<?php echo( $d->get_day() ); ?>
</div>
<div class="calendar-content">
<?php echo( $d->get_text() ); ?>
</div>
</td>
<?php
$p += 1;
if ( $p == 7 ) $p = 0;
}
?>
</tr>
</table>
</div>
<body>
</html>

If some one maybe can help me to make it posible to edit from a interface that would be great, then num 2 is solved. Number one I know thatyou get those pop-up calander's just don't know where.

#4 GremlinP1R

GremlinP1R
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts
  • LocationSouth Africa

Posted 11 October 2006 - 06:33 AM

help please! Any one if you can.

#5 whitehat

whitehat
  • Members
  • PipPip
  • Member
  • 18 posts

Posted 11 October 2006 - 09:43 PM

I think this is what you need.
Activecalendar

#6 GremlinP1R

GremlinP1R
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts
  • LocationSouth Africa

Posted 12 October 2006 - 11:06 AM

Yes thats it Thanx Alot.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users