Username Password

Lost Password
View Thread
Explore Your Brain Pemrograman PHP
Membuat Kalender Sederhana dengan php
Username
Password
Register FAQ Members List Today's Posts Search

Print Thread

27-05-2013 10:22 PM Membuat Kalender Sederhana dengan php
User Avatar

denji
Murid Akademi I


Posts: 14
Joined: 18.06.12

Deprecated: Function eregi() is deprecated in /home/explnorg/public_html/includes/bbcodes/code_bbcode_include.php on line 24

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/explnorg/public_html/includes/bbcodes/code_bbcode_include.php on line 29
Halo agan2 dan bro2...
ane mo share mengenai script php "kalender sederhana" maklum ane masih belajar bikin web nih...
monggo buka notepad ato software yang biasa membuat file .php
Copy kan script dibawah ini:
Download source  Code
<?php
function buatkalender($tanggal,$bulan,$tahun) {     
  $bulanan=array(1=>"Januari","Februari","Maret","April",
                    "Mei","Juni","Juli","Agustus","September",
                    "Oktober","November","Desember");
  $bln=date("n");
  $thn=date("Y");

  $jmlhari = date("t",mktime(0,0,0,$bulan,1,$tahun));
  $haritglsatu = date("w",mktime(0,0,0,$bulan,1,$tahun));

  $kalender = "<table cellspacing=2 cellpadding=2 
               border=0 with=200 align=center id=border >\n";
  $kalender .= "<tr>
               <th colspan=7 align=center>Kalender $bulanan[$bln] $thn
               </th></tr>\n";

  $kalender .= "<tr>
                <td align=center>M</td>
            <td align=center>S</td>
            <td align=center>S</td>
            <td align=center>R</td>
                <td align=center>K</td>
            <td align=center>J</td>
            <td align=center>S</td></tr>\n";
  $a      = 1;
  $adabaris   = TRUE;
  $mulaicetak = 0;
  while ($adabaris) {
    $kalender .= "<tr align=center>";
    for ($i = 0; $i < 7; $i++ ) {
      if ($mulaicetak < $haritglsatu) {
        $kalender .= "<td>&nbsp;</td>";
        $mulaicetak++;
      }
      elseif ($a <= $jmlhari) {
        $tt = $a;
        if ($a == $tanggal) {
          $tt = "<span style='color: blue; font-weight: bold; text-decoration: blink;'>$tt</span>";
        }
        if ($i == 0) {
          $tt = "<font color=\"#FF0000\">$tt</font>";
        }
        $kalender .= "<td align=center>$tt</td>";
        $a++;
      }
      else {
        $kalender .= "<td>&nbsp;</td>";
      }
    }
    $kalender .= "</tr>\n";
    if ($a <= $jmlhari) {
      $adabaris = TRUE;
    }
    else {
      $adabaris = FALSE;
    }
  }
  $kalender .= "</table>\n";
  return $kalender;
}
$tgl_skrg=date("d");
$bln_skrg=date("n");
$thn_skrg=date("Y");
echo buatkalender($tgl_skrg,$bln_skrg,$thn_skrg);
?>




simpan file dengan nama kalender.php (nama file sih terserah yang penting .php nya)
klo udah coba buka file php itu pake browser.
praktisnya nih ada scriptnya http://www.odendut.com/download/kalen...lender.rar
Semoga Bermanfaat
 
Offline
Jump to Forum:
Forum powered by fusionBoard
Share this Thread
URL:
BBcode:
HTML:
Similar Threads
Thread Forum Replies Last Post
DNS Browsing Makin Cepat dan Kencang dengan Google Public Networking 16 14-11-2016 14:42
Belajar Melukis Sketsa Wajah dengan Photoscape E-Book 2 16-11-2013 04:27
Membuat Fungsi Tanggal Indonesia (Database) PHP 1 24-09-2012 16:51
Membuat Linux Live USB Networking 1 19-06-2012 22:09
Download file lebih cepat dengan leecher Out Of Topic 1 27-12-2011 07:55
Copyright © 2007-2016