Friday, 12 March 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!
- TUNGGU TANGGAL TERBITNYA! 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: 1286
News: 208
WebLinks: 15
Visitors: 1370570
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>";

?>

Oh iya, kalau pengen kursus bikin web & PHP sambil praktek plus dapet duit juga, coba deh belajar di sini . Sok atuh di klik biar kelihatan.


BINGUNG CARI UANG? Coba bisnis jual pulsa elektrik ini:
- COCOK UNTUK USAHA PRIBADI
- GRATIS BIAYA REGISTRASI
- MODAL KECIL BANGET.
- ANTI RUGI, LANGSUNG JALAN
- Pasif income 2 M/bln, bonus 250 jt.
- Saya sudah coba sendiri! Silakan klik di sini, nothing to lose!

Tolong di klik dulu 2 iklan di atas kalau belum ya. Siapa tau cocok buat kamu. Thanks.

Last Updated ( Saturday, 29 August 2009 )
< Prev   Next >

Comments
You are not authorized to leave comments. Please login first.
Polls
Materi apa yang menurut kamu masih sangat kurang lengkap?
  
Kursus Online
Insya Allah terbit akhir Maret 2010 !
Nantikan buku karangan Prothelord ini di toko-toko buku kesayangan Anda!

Klik gambar untuk melihat detil
Iklan Indonesia
Related Items
SMO ShoutBox
This is not a Login form

Name:

Message:

Tag Clouds
menghitung fokus 250px anchor jawabannya gudang dasar pastikan alat obyek sedikit kursus arti paypal cookies kiri kosong code penjelasan pasangan menghasilkan file komputer termasuk kira merasa keduanya lain copy mail

Joomla Modul

Who's Online
We have 58 guests online
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