Looking for suitable calendar for project

This is a discussion on "Looking for suitable calendar for project" within the PHP Forum section. This forum, and the thread "Looking for suitable calendar for project are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Feb 21st, 2008, 15:15
Junior Member
Join Date: Nov 2006
Location: Bangkok
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Looking for suitable calendar for project


Hi All
I am hoping one of you guys can help me out.
I am developping a travel booking system.

(php & Mysql)

Admin users only.
its not very complex. Customers book travel packages for certain dates. (1 per day, no multiple days)

The main admin view should be a calendar. So users can have a direct calendar view of all the bookings.

Can anyone recommend a calendar, availabel on the net that could be somewhat painlessly integrated to my project.
Perhaps someone has done something similar.

I would really appreciate tips on where I could find a suitable calendar.

Thanks

Sami
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Feb 21st, 2008, 18:17
Junior Member
Join Date: Feb 2008
Location: Glasgow
Age: 28
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Looking for suitable calendar for project

I really hate date maths.

I've included what I've got, but its pretty heavily tied into other objects when it comes to displaying data on the calendar but I've included it below incase it helps.

PHP: Select all

[left]class JonnoCalendar {
var 
$daysInMonth;
var 
$year;
var 
$month;
var 
$monthName;
var 
$day;
var 
$firstDayInMonth;
var 
$days = array ( );
var 
$contents = array ( );
var 
$galleryCounter 0;
var 
$videoCounter 0;
var 
$diaryTypes = array ( );
var 
$editable false;
var 
$mode "summary";
var 
$navLink "";
var 
$showCurrentDay true;

function 
setEditable() {
$this->editable true;
}

function 
showTitles() {
$this->mode "title";
}

function 
hideCurrentDay() {
$this->showCurrentDay false;
}

function 
JonnoCalendar($day null,$month null,$year null) {
if (
$day == null && $month == null && $year == null) {
$this->year date 'Y' );
$this->month date 'n' );
$this->day date 'j' );
} else {
$this->year $year;
$this->month $month;
$this->day $day;
}

$this->monthName date 'F'mktime 000$this->month$this->day$this->year ) );

$this->daysInMonth date "t"mktime 000$month1$year ) );
$this->firstDayInMonth date "w"mktime 000$month1$year ) );

// fill days array
$i $this->firstDayInMonth;
$end $i 42;
for(
$i$i <= $end$i ++) {
$this->days [$i] = array ( );
}

}

function 
addContentsCollection($in) {
while ( 
$in->hasMore () ) {
$tmp $in->next ();

if (
is_array $tmp )) {
$tmp $tmp [0];
}

$parts explode '-'$tmp->getLaunchDate () );

$day $parts [2] + 0;

$this->days [$day] [] = $tmp;

}
}

function 
addContent($dataObject) {

}

function 
renderTable($showNumEventsPerDay false) {
// output month, year
echo '<table class="jCal">';
echo 
'<tr><th colspan="7" class="jcTitle">' $this->monthName ' ' $this->year '</th></tr>';
echo 
'<tr><th class="jcHead">Sun</th><th class="jcHead">Mon</th><th class="jcHead">Tue</th><th class="jcHead">Wed</th><th class="jcHead">Thur</th><th class="jcHead">Fri</th><th class="jcHead">Sat</th></tr>';
echo 
'<tr>';

$counter 0;
$weekCounter 0;

foreach ( 
$this->days as $k => $v ) {
if (
$counter == 0) {
$weekStyle "jcOddWeek";
if (
$weekCounter == 0) {
$weekStyle "jcEvenWeek";
}
echo 
'</tr>';
if (
$k <= $this->daysInMonth) {
echo 
'<tr class="' $weekStyle '">';
} else {
break;
}
$weekCounter ++;
}

$content $k;
$dayStyle 'jcDay';
if ((
$k == $this->day) && ($this->month == date "m" ))) {

$dayStyle 'jcToday';
$content '<b>' $k;

if (
$showNumEventsPerDay) {
$content .= ' (' count $v ) . ')';
}
$content .= '</b>';
} else if (
$k || $k $this->daysInMonth) {
$dayStyle 'jcNoDay';
} else {
if (
$showNumEventsPerDay) {
$content .= ' (' count $v ) . ')';
}
$content .= '</b>';
}

echo 
'<td class="' $dayStyle '">';
if (
$k <= $this->daysInMonth && $k 0) {
echo 
$content;
} else {
echo 
'&nbsp;';
}

echo 
'</td>';
$counter ++;
}

echo 
'<tr>';
echo 
'</table>';
}

function 
renderTable2($showNumEventsPerDay false) {
ob_start ();
// output month, year
echo '<table class="jCal">';
if (
$this->navLink == "") {
echo 
'<tr><th colspan="7" class="jcTitle">' $this->monthName ' ' $this->year '</th></tr>';
} else {
$minusMonth $this->month 1;
$minusYear $this->year;

if (
$minusMonth == 0) {
$minusMonth 12;
$minusYear --;
} else if (
$minusMonth 0) {
$minusMonth ++;
$minusMonth *= - 1;

$minusYear -= $minusMonth 12;
$minusMonth $minusMonth 12;
}

$plusMonth $this->month 1;
$plusYear $this->year;

while ( 
$plusMonth 12 ) {
$plusYear ++;
$plusMonth -= 12;
}

echo 
'<tr><th class="jcTitle"><a href="FONT> . $this->navLink . '&month=' . $minusMonth . '&year=' . $minusYear . '"><<</a></th><th colspan="5" class="jcTitle">' . $this->monthName . ' ' . $this->year . '</th><th class="jcTitle"><a href="FONT> . $this->navLink '&month=' $plusMonth '&year=' $plusYear '">>></a></th></tr>';

}
echo 
'<tr><th class="jcHead">Sunday</th><th class="jcHead">Monday</th><th class="jcHead">Tuesday</th><th class="jcHead">Wednesday</th><th class="jcHead">Thursday</th><th class="jcHead">Friday</th><th class="jcHead">Saturday</th></tr>';
echo 
'<tr>';

$counter 0;
$weekCounter 0;

$dayShit '';
$dayNumShit '';

foreach ( 
$this->days as $k => $v ) {
if (
$counter == 0) {
$weekStyle "jcOddWeek";
if (
$weekCounter == 0) {
$weekStyle "jcEvenWeek";
}
echo 
$dayShit '</tr>';
$dayShit '';
if (
$k <= $this->daysInMonth) {
echo 
'<tr>';
for(
$jjj $counter$jjj < ($counter 7); $jjj ++) {

echo 
'<td width="95" class="dayNumber">';

if (
$jjj >= $this->firstDayInMonth && $jjj) {
$tmpV $jjj $this->firstDayInMonth;
if (
$tmpV <= $this->daysInMonth) {
if (
$this->editable) {
$tmpMonth $this->month;
$tmpDay $tmpV;
if (
strlen $this->month ) < 2) {
$tmpMonth '0' $this->month;
}
if (
strlen $tmpV ) < 2) {
$tmpDay '0' $tmpV;
}
echo 
'<a href="FONT> . $_SERVER ['PHP_SELF'] . '?action=add&date=' . urlencode ( $this->year . '-' . $tmpMonth . '-' . $tmpDay ) . '">+ </a>';
}
echo $tmpV;

}
}

echo '</td>';
}

echo '</tr><tr class="' . $weekStyle . '">';
} else {
break;
}
$weekCounter ++;
}

$content = '';
$dayStyle = 'jcDay';
if ($k == $this->day && ($this->month == date ( "
m" ))) {
$dayStyle = 'jcToday';
$content = '<b>';

if ($showNumEventsPerDay) {
$content .= $this->dayContentHelper ( $v );
}
$content .= '</b>';
} else if ($k < 1 || $k > $this->daysInMonth) {
$dayStyle = 'jcNoDay';
} else {
if ($showNumEventsPerDay) {
$content .= $this->dayContentHelper ( $v );
}
$content .= '</b>';
}

$dayShit .= '<td class="' . $dayStyle . '"';

if ($this->editable && $dayStyle != 'jcNoDay') {
$tmpMonth = $this->month;
$tmpV = $k;
$tmpDay = $tmpV;
if (strlen ( $this->month ) < 2) {
$tmpMonth = '0' . $this->month;
}
if (strlen ( $tmpV ) < 2) {
$tmpDay = '0' . $tmpV;
}

$dayShit .= ' style="
cursorpointer;" onClick="document.location '' $_SERVER ['PHP_SELF'] . '?action=ViewDay&date=' urlencode $this->year '-' $tmpMonth '-' $tmpDay ) . '\';" ';
}

$dayShit .= '>';
if (
$k <= $this->daysInMonth && $k 0) {
$dayShit .= $content;
} else {
$dayShit .= '&nbsp;';
}

$dayShit .= '</td>';
$counter ++;
}

echo 
'<tr>';
echo 
'</table>';
$out ob_get_contents ();
ob_end_clean ();

echo 
str_replace 'qqq''<br><br><br>'$out );
}

function 
dayContentHelper($events) {
$galleryCounter 0;
$videoCounter 0;
$diaryTypes = array ( );
$textUpdatesCounter 0;
$out '';

//$out = ' '.count($events).' events';


if (count $events ) == 0) {
$out 'qqq';

} else {

if (
$this->mode == "summary") {
$out2 '';
foreach ( 
$events as $event ) {

if (
$event->getType () == 'gallery') {
$galleryCounter ++;
} else if (
$event->getType () == 'video') {
$videoCounter ++;
} else if (
$event->getType () == "" || $event->getType () == "update") {
$textUpdatesCounter ++;
} else {
if (! isset ( 
$diaryTypes [$event->getDiaryType ()] )) {
$diaryTypes [$event->getDiaryType ()] = 0;
}
$diaryTypes [$event->getDiaryType ()] ++;
}

}

if (
$galleryCounter 0) {
$out '<span >' $galleryCounter ' Galleries</span><br>' $out;
}
if (
$videoCounter 0) {
$out '<span >' $videoCounter ' Videos</span><br>' $out;
}
if (
$textUpdatesCounter 0) {
$out '<span >' $textUpdatesCounter ' Text Updates</span><br>' $out;
}

foreach ( 
$diaryTypes as $k => $v ) {
$out '<span>' $v ' ' $k '</span><br>' $out;

}

} else {
foreach ( 
$events as $event ) {
if (
is_array $event )) {
$event $event [0];
}
$out '<span> ' $event->getTitle () . '</span><br>' $out;
}

}

}

return 
$out;
}

}

$cal = new JonnoCalendar();
echo 
$cal->renderTable();
exit;[/
left
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Feb 22nd, 2008, 03:25
Junior Member
Join Date: Nov 2006
Location: Bangkok
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Looking for suitable calendar for project

Thanks for the help Able
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Suitable CMS THFC1882 PHP Forum 9 May 17th, 2008 09:52
[SOLVED] Is this a suitable 'search CSV' function? Aso PHP Forum 8 Dec 18th, 2007 15:19
Can you think of a suitable domain name? Marc Hosting & Domains 20 Jul 17th, 2007 14:17
Graphic Designer Required on Project by Project Basis crucialx Job Opportunities 0 Dec 22nd, 2005 09:52


All times are GMT. The time now is 16:09.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42