web directoryearn money in seconds   Free file hosting, free video sharing

<<< The Web Hosting >>>


Go Back   Noeman GSM > Webhosting & Website development > Website development > Programming

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-13-2007, 05:13 PM
Spiral's Avatar
CO-Admin
 
Join Date: Sep 2004
Location: Martil
Age: 25
Posts: 15,896
Reputation: 20485
Spiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super Member
Default Simple php calendar script

When you search from google for php calendar you will get lot of free and comercial script for this purpose. But my problem is that all those php calendar script is hard to implement and to modify. So I decided to create my own simple calendar script, and share to those who are looking for this kind of script and want to modify it.
PHP Code:
$x=$_GET[x];
if(
$x==""$x date("n");

$date strtotime("2006/$x/1");
$day date("D",$date);
$m date("F",$date);
$totaldays date("t",$date); //get the total day of specified date

echo "<table border = '1' cellspacing = '0' bordercolor='blue' cellpadding ='2'><tr>
<td colspan='7'>$m</td></tr>
<tr>
<td><font size = '1' face = 'tahoma'>Sun</font></td>
<td><font size = '1' face = 'tahoma'>Mon</font></td>
<td><font size = '1' face = 'tahoma'>Tue</font></td>
<td><font size = '1' face = 'tahoma'>Wed</font></td>
<td><font size = '1' face = 'tahoma'>Thu</font></td>
<td><font size = '1' face = 'tahoma'>Fri</font></td>
<td><font size = '1' face = 'tahoma'>Sat</font></td>
</tr>
"
;

if(
$day=="Sun"$st=1;
if(
$day=="Mon"$st=2;
if(
$day=="Tue"$st=3;
if(
$day=="Wed"$st=4;
if(
$day=="Thu"$st=5;
if(
$day=="Fri"$st=6;
if(
$day=="Sat"$st=7;

if (
$st >= && $totaldays == 31) {
$tl=42;
}elseif(
$st == && $totaldays == 30){
$tl 42;
}else{
$tl 35;
}

$ctr 1;
$d=1;

for(
$i=1;$i<=$tl;$i++){

if(
$ctr==1) echo "<tr>";

if(
$i >= $st && $d <= $totaldays){
echo 
"<td align='center'><font size = '2' face = 'tahoma'>$d</font></td>";
$d++;
}
else{
echo 
"<td>&nbsp</td>";
}

$ctr++;

if(
$ctr 7) {
$ctr=1;
echo 
"</tr>";
}

}

$prev=$x 1;
$next $x 1;
if(
$prev==0$prev=1;
if(
$next==13$next 12;
echo 
"</table><b><a href = 'calendar.php?x=$prev'>Previous</a>                  <a href = 'calendar.php?x=$next'>Next</a></b>"
Reply With Quote
Sponsored Links
Reply

Bookmarks

Thread Tools
Display Modes

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


All times are GMT. The time now is 12:12 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Copyright © 2004-2008 Noeman . All rights reserved
Libros de historia | Ringtones | Song Lyrics | Great deals at Champion Achiever | Mortgage

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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112