Saturday, 04 September 2010
 
  Home arrow Contoh Script arrow PHP Script arrow PHP Script: Kalender
template designed by peekmambo.com
 

- 4 langkah mudah belajar bikin web. Langsung praktek!
- DAPATKAN SEGERA! Buku baru dari Prothelord: Cara Mudah Membuat Desain Web untuk Pemula.
- Bisnis Pulsa Tanpa Biaya Registrasi

Popular
Terbaru !!!
Iklan Kursus
Main Menu
Home
Tutorial Programming
Belajar PHP
Belajar HTML
Belajar MySQL
Belajar Web
Membuat Website
Belajar Visual Basic
Tempat Kursus Web
Contoh Script
Belajar Komputer
Jaringan Komputer
Bisnis Internet
Berita
English Tutorial
My Blog
Artikel
Surat Anda
Forum Prothelonians
Buku
Login Form
Username

Password

Remember me
Forgotten your password?
No account yet? Create one
Statistics
Members: 1555
News: 239
WebLinks: 15
Visitors: 1781795
Who's Online
We have 18 guests online
PHP Script: Kalender PDF Print E-mail
Written by Prothelord   
Tuesday, 13 May 2008
PHP Script kalender sederhana. SIlahkan coba dan gunakan di web site kamu.

Berikut kode PHP script nya:

<?
/*  This calendar is not very pretty as-is, but it is functional and fast.
    Formatting to suit your needs should be fairly simple.  

    The latest version of this calendar is formatted much more niceley.  It
    also includes a full-featured "Community Calendar" which is linked to a
    MySQL database for reporting upcoming events.

    The latest copy of the calendar can be viewed and/or downloaded from:
    http://modems.rosenet.net/mysql/   */

/*  Set some variables  */
$date=01;
$day=01;
$off=0;

/*  The month and year variables can (should) be passed from a preceding
    web page rather than hard coded  */
$month = '05';
$year = '1999';

/*  Figure out how many days are in this month  */
while (checkdate($month,$date,$year)):
$date++;
endwhile;

/*  Create a table with days of the week headers  */
echo "<table border='1' cellpaddig='5' cellspacing='5' width='100%'><tr>";
echo "<th><b><font face='Arial'>Sunday</font></b></th>";
echo "<th><b><font face='Arial'>Monday</font></b></th>";
echo "<th><b><font face='Arial'>Tuesday</font></b></th>";
echo "<th><b><font face='Arial'>Wednesday</font></b></th>";
echo "<th><b><font face='Arial'>Thursday</font></b></th>";
echo "<th><b><font face='Arial'>Friday</font></b></th>";
echo "<th><b><font face='Arial'>Saturday</font></b></th>";

/*  Start the table data and make sure the number of days does not exceed
    the total for the month  - $date will always be one more than the total
    number of days in the momth  */
echo "<tr>";
while ($day<$date):

/*  Figure what day of the week the first falls on and set the number of
    preceding and trailing cells accordingly  */
if ($day == '01' and date('l', mktime(0,0,0,$month,$day,$year)) == 'Sunday') {
echo "<td>$day</td>";
$off = '01';
}
elseif ($day == '01' and date('l', mktime(0,0,0,$month,$day,$year)) ==
'Monday') {
echo "<td></td><td>$day</td>";
$off= '02';
}
elseif ($day == '01' and date('l', mktime(0,0,0,$month,$day,$year)) ==
'Tuesday') {
echo "<td></td><td></td><td>$day</td>";
$off= '03';
}
elseif ($day == '01' and date('l', mktime(0,0,0,$month,$day,$year)) ==
'Wednesday') {
echo "<td></td><td></td><td></td><td>$day</td>";
$off= '04';
}
elseif ($day == '01' and date('l', mktime(0,0,0,$month,$day,$year)) ==
'Thursday') {
echo "<td></td><td></td><td></td><td></td><td>$day</td>";
$off= '05';
}
elseif ($day == '01' and date('l', mktime(0,0,0,$month,$day,$year)) ==
'Friday') {
echo "<td></td><td></td><td></td><td></td><td></td><td>$day</td>";
$off= '06';
}
elseif ($day == '01' and date('l', mktime(0,0,0,$month,$day,$year)) ==
'Saturday') {
echo "<td></td><td></td><td></td><td></td><td></td><td></td><td>$day</td>";
$off= '07';
}
else {
echo "<td>$day</td>";
}

/*  Increment the day and increment the cells that go before the end of the row
    and end the row when appropriate */
$day++;
$off++;

if ($off>7) {
echo "</tr><tr>";
$off='01';
} else {
echo "";
}

endwhile;

echo "</table>";

?>

Suka? Tolong kasih tahu ke temen-temen kamu ya :) Gampang kok, tinggal klik tombol SHARE berikut ini dan login ke facebook atau twitter kamu. Thanks.


Bookmark and Share


Cara Mudah Belajar Membuat Website! (Highly recommended)
Khusus PEMULA, lengkap, praktis, terstruktur & langsung praktek.
RIBUAN peserta sudah merasakan manfaatnya. Sok atuh di klik, siapa tau cocok...
KLIK DI SINI

Bisnis Pulsa Elektrik Paling Menguntungkan!
TANPA BIAYA REGISTRASI apa pun ( Gratis / FREE !)
Jadikan HP Anda sebagai "aset" yang membanjiri rekening Anda
Dapatkan! Bonus Rp 275 Juta
Plus! Pasif income Rp 2 Milyar / bulan !!!
KLIK DI SINI

Mudah-mudahan bermanfaat.
Salam hangat.
Prothelord.
Last Updated ( Saturday, 29 August 2009 )
< Prev   Next >

Comments
You are not authorized to leave comments. Please login first.
Kursus Online
Bookmark and Share
Iklan Indonesia
ShoutBox (mhn maaf, IP anda saya log ya)
This is not a Login form

Name:

Message:

Baru!!
Tag Clouds
kompozer perusahaan query konsep walaupun cleanup kurang selected page gak address guest cookie soalnya website smuo injection menginstal sulit memanipulasi melanjutkan kategori penambahan bad sewa sih pda bandwidth mendukung menuliskan

Joomla Modul

Cari melalui Google

Copyright 2000 - 2005 Miro International Pty Ltd. All rights reserved.
Mambo is Free Software released under the GNU/GPL License.

Get The Best Free Mambo Templates at www.peekmambo.com