Tuesday, December 4, 2012

TUGAS AKHIR

"Membuat Sistem Informasi Teknologi Atmosfer"

Kali ini saya akan share tentang cara membuat WEB bagi temen - temen yang mau belajar membuat WEB pribadi ikutilah tutorialnya berikut ini, 

Pertama siapkan softwarenya :

1. Dreamweaver CS5, bagi yg belum punya silahkan download disini
2. Wamp Server, bagi yg belum punya silahkan download disini
3. Mozilla firefox, bagi yg belum punya silahkan download disini

Jika software diatas sudah terinstal semua di komputer/laptop anda, selanjutnya ikuti tahap - tahap 
berikut ini :

1. Buatlah database :
- Buka Wamp server, klik wamp pada taksbar sebelah kanan lalu klik put online :

 
- Buka Mozilla Firefox, ketik localhost pada addrees bar - klik phpmyadmin - Silahkan ciptakan database dengan nama yg di inginkan :


- Buatlah Tabel berikut ini :

1. tabel admin berisi : 


2. tabel contact berisi :


3. tabel kegiatan berisi :



4. tbl_ conten berisi :



5. tbl_ daftar  berisi :

 

2. Buka DW CS5, buatlah script connect.php

<?php

mysql_connect('localhost','root','');

mysql_select_db('tugas akhir');

?>


3. Buatlah design halaman index seperti ini... 


- Berikut Source code halaman index.php :

<?php include "config/connect.php"; ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="/ferdy/style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="10">
  <tr>
    <td colspan="3"><img src="/ferdy/images/banner.png" /></td>
  </tr>
  <tr>
    <td colspan="3" align="center">
            <ul id="menu" class="blue">
            <li><a href="index.php">Beranda</a></li>
            <li><a href="latar.php?page=sejarah">Sejarah</a></li>
            <li><a href="latar.php?page=organisasi">Organisasi</a></li>
            <li><a href="latar.php?page=visimisi">Visi Misi</a></li>
        </ul>
   
    </td>
  </tr>
  <tr>
    <td width="100" valign="top"><form id="form2" name="form2" method="post" action="latar.php?page=prosescari">
      <div id="body"><table width="100%">
        <tr>
          <td width="321">Cari Kegiatan</td>
          <td width="67">&nbsp;</td>
        </tr>
        <tr>
          <td><input type="text" name="keyword" size="20" /></td>
          <td><input type="submit" name="submit" value="Cari" /></td>
        </tr>
      </table></div>
    </form></td>
    <td width="588" valign="top"><div id="body"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
<?php
$sql=mysql_query("select * from tbl_conten where kategori = 'index' ORDER BY id DESC LIMIT 0,5 ");
while($data = mysql_fetch_array($sql)){
?>
        <td><?php echo $data['judul'];?> </td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td><?php echo nl2br(substr(html_entity_decode($data['isi']),0,150));?> <a href="latar.php?page=tampil_berita1&id=<?php echo $data['id'];?>"> baca selengkapnya...</a></td>
      </tr>
    </table></div></td>
    <td width="200" valign="top"><div id="body"><form action="/ferdy/login_member.php?op=in" method="post">
      <table width="150" cellspacing="0" cellpadding="0">
        <tr>
          <td colspan="3" align="center"><h3>Login</h3></td>
        </tr>
        <tr>
          <td width="70">Username</td>
          <td width="10">:</td>
          <td width="150"><input type="text" name="user" /></td>
        </tr>
        <tr>
          <td>Password</td>
          <td>:</td>
          <td><input type="password" name="pwd" /></td>
        </tr>
        <tr>
          <td><a href="/ferdy/latar.php?page=form_daftar">Daftar?</a></td>
          <td>&nbsp;</td>
          <td><input type="submit" name="submit2" value="Masuk" /></td>
        </tr>
      </table></form>
    </div><?php } ?></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>

 - Berikut source code proses cari.php :

<?php
include "config/connect.php";
if ((isset($_POST['submit'])) AND ($_POST['keyword'] <> "")) { 

    $kegiatan = $_POST['keyword'];
echo "<table border = '1' width = '200' align = 'center'";
echo "<tr>";
echo "<td align='center'>Judul Kegiatan</td>";
echo "<td align='center'>Rincian Kegiatan</td>";
echo "<td align='center'>Waktu</td>";
echo "<td align='center'><a href = 'index.php'>Back</td>";
echo "</tr>";
}
    $sql = "select * from kegiatan where judul like '%$kegiatan%'
                                    or rincian like '%$kegiatan%'
                                    or waktu like '%$kegiatan%'";
    $b = mysql_query($sql);
    while ($a=mysql_fetch_array($b)){
        $judul = $a['judul'];
        $rincian = $a['rincian'];
        $waktu = $a['waktu'];

echo "<tr>";
echo "<td align='center' width='100'>$judul</td>";
echo "<td align='center' width='200'>$rincian</td>";
echo "<td align='center' width='200'>$waktu</td>";
echo "</tr>";
}
        ?>

          
- Berikut Source code login_member.php :

<?php
session_start();
include('/config/connect.php');

$username = $_POST['user'];
$password = $_POST['pwd'];
$op = $_GET['op'];

if($op=="in"){
    $cek = mysql_query("SELECT * FROM tbl_daftar WHERE nama='$username' AND kata_kunci='$password'");
    if(mysql_num_rows($cek)==1){
        $c = mysql_fetch_array($cek);
        $login = $_SESSION['nama'] = $c['nama'];
    if($login){
    echo "<script>alert('Welcome'); window.location.href='member/indexmem.php'</script>";
return false; break;
        }
    }else{
    echo "<script>alert('Username atau Password Salah!'); window.location.href='member/index.php'</script>";
return false; break;
    }
}else if($op=="out"){
        unset($_SESSION['username']);
    unset($_SESSION['level']);
    unset($_SESSION['nama']);
    unset($_SESSION['email']);
    header("location:index.php");
}
?>


- Berikut source code tampil_berita1.php :

<?php
include "config/connect.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?php
$id = isset($_GET['id']) ? $_GET['id'] : '';
$sql=mysql_query("select * from tbl_conten where id='$id' ");
$data=mysql_fetch_array($sql);
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><?php echo $data['judul'];?></td>
  </tr>
  <tr>
    <td><img src="images/<?php echo $data['gambar'];?>" style="max-width:420px;" /></td>
  </tr>
  <tr>
    <td><?php echo nl2br(html_entity_decode($data['isi']));?></td>
  </tr>
  <tr>
      <td><hr />
<h2><center>Silahkan Berkomentar</center></h2><form id="form1" name="form1" method="post" action="/ferdy/prosescontact.php">
  <div class="read">
    <table width="400" border="0" align="center">
      <tr>
        <td width="60">Nama</td>
        <td width="8">:</td>
        <td width="310"><input type="text" name="nama" /></td>
      </tr>
      <tr>
        <td>Email</td>
        <td>:</td>
        <td><input type="text" name="email" /></td>
      </tr>
      <tr>
        <td>Komentar</td>
        <td>:</td>
        <td><textarea name="komentar"></textarea></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><input type="submit" value="Kirim" name="submit" /></td>
      </tr>
    </table>
</div></form></td></tr>
    <tr>
        <td><hr /><?php
mysql_connect("localhost","root","");

mysql_select_db("Tugas Akhir");

$data = mysql_query("SELECT * FROM contact ORDER BY id DESC");
$w = 1;
while($d=mysql_fetch_array($data)){
    if($w == 1){
        $warna = "#ffffff";
        $w = 0;
    }else{
        $warna = "#efefef";
        $w = 1;
    }
    echo "<div style=\"background-color:$warna;padding:5\">";
    echo "Nama : ".$d['nama']."<br>";
    echo "Email : ".$d['email']."<br>";
    echo "<b>Komentar :</b><br>".$d['komentar'];
    echo "</div><p>\n";
}
?></td></tr>
</table>
</body>
</html>

 
4. Buatlah halaman loginadmin.php :

 - Berikut Source code loginadmin.php :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="/ferdy/style.css" rel="stylesheet" type="text/css" />
<title>Untitled Document</title>
<style type="text/css">
body,td,th {
    font-family: Verdana, Geneva, sans-serif;
}
</style>
</head>

<body>
<form id="form1" name="form1" method="post" action="proseslogin.php"><div id="login">
  <table width="291" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td colspan="3" align="center">LOGIN ADMIN</td>
    </tr>
    <tr>
      <td width="153">User name</td>
      <td width="4">:</td>
      <td width="478"><input type="text" name="user" /></td>
    </tr>
    <tr>
      <td>Password</td>
      <td>:</td>
      <td><input type="password" name="pwd" /></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td><input type="submit" name="button" id="button" value="Login" /></td>
    </tr>
  </table></div>
</form>
</body>
</html>
 
 
- Berikut Source code proseslogin.php :

<?php
session_start();
include('../config/connect.php');
$user = $_POST['user'];
$pwd = $_POST['pwd'];

$query= mysql_query("select * from admin where user = '$user' and pwd = '$pwd'");
$data = mysql_fetch_array($query);
if (mysql_num_rows($query)>0)
{
    $_SESSION['user'] = $data['user'];
    header ("location:lataradmin.php?page=indexadmin");
   
}
else
{
    echo "<script>alert('nama atau kata kunci salah');
    location = 'login_admin.php';
    </script>";
}
?>

 
5. Buatlah design halaman lataradmin.php :

 

- Berikut Source code pada lataradmin.php :

 <?php include "../config/connect.php"; ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Menu Admin</title>
<link href="/ferdy/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body {
    background-image: ;
    background-repeat: bottom right no-repeat fixed;;
  
}

</style>
</head>

<body style="max-width:100%;" >
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="3"><img src="/ferdy/images/banner.png"/></td>
  </tr>
  <tr>
    <td colspan="3" align="center">
  
        <ul id="menu" class="blue">
            <li><a href="?page=inputkegiatan">Input Kegiatan</a></li>
            <li><a href="?page=view">Lihat Kegiatan</a></li>
            <li><a href="?page=lihat_komentar">Lihat Komentar</a></li>
            <li><a href="?page=konten">Konten</a></li>
            <li><a href="?page=daftar_pengguna">Daftar Pengguna</a></li>
            <li><a href="/ferdy/Admin/logout.php">Logout</a></li>
        </ul>
    </td>
  </tr>
  <tr>
    <td width="100" valign="top"><form id="form2" name="form2" method="post" action="">
    </form></td>
    <td width="588" valign="top"><div id="body"><?php
    $page = isset($_GET['page']) ? $_GET['page'] : "";
    if($page == 'lataradmin')
    {
        @header("location:lataradmin.php");  
    }
    elseif($page=='konten')
    {
        include 'konten.php';
    }
    elseif($page=='form_edit_conten')
    {
        include 'form_edit_conten.php';
    }
    elseif($page=='daftar_pengguna')
    {
        include 'daftar_pengguna.php';
    }
    elseif($page=='form_daftar')
    {
        include 'form_daftar.php';
    }
    elseif($page=='inputkegiatan')
    {
        include 'inputkegiatan.php';  
    }
    elseif($page=='view')
    {
        include 'view.php';
    }
    elseif($page=='indexadmin')
    {
        include 'indexadmin.php';
    }
    elseif($page=='lihat_komentar')
    {
        include 'lihat_komentar.php';
    }
    elseif($page=='editkegiatan')
    {
        include 'editkegiatan.php';
    }
    elseif($page=='editkomentar')
    {
        include 'editkomentar.php';
    }
 ?></div></td>
    <td width="200" valign="top"><form id="form1" name="form1" method="post" action="">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td align="center">Selamat Datang Admin</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
      </table>
    </form></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>


6. Buatlah Halaman input kegiatan.php :















- Berikut Source code input kegiatan.php :

<body>
<form id="form1" name="form1" method="post" action="prosesinput.php">
  <table width="400" border="0" align="center">
    <tr>
      <td width="87">Judul Kegiatan</td>
      <td width="8">:</td>
      <td width="283"><input type="text" name="judul" /></td>
    </tr>
    <tr>
      <td>Rincian Kegiatan</td>
      <td>:</td>
      <td><textarea name="rincian"> </textarea></td>
    </tr>
    <tr>
      <td>Tanggal</td>
      <td>:</td>
      <td><select name="tgl" id="tgl">
        <?php
      for ($i=1; $i<32; $i++)
      {
          echo "<option value='$i'>$i</option>";
      }
      ?>
      </select>
        <select name="bln" id="bln">
          <?php
      $bulan = array("","januari","februari","maret","april","mei","juni","juli","agustus","september","oktober","november","desember");
      for ($i=1; $i<13; $i++)
      {
        echo "<option value='$i'>$bulan[$i]</option>"  ;
      }
     
      ?>
        </select>
        <select name="thn" id="thn">
          <?php
      for ($i=2012; $i>1920; $i--)
      {
        echo "<option value='$i'>$i</option>"; 
      }
      ?>
      </select></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td><input type="submit" name="submit" value="Kirim" /></td>
    </tr>
  </table>
</form>
</body>
</html>


- Berikut Source code proses input.php :

<?php

include "../config/connect.php";

$judul = $_POST['judul'];
$rincian = $_POST['rincian'];
$waktu = $_POST['thn'].'-'.$_POST['bln'].'-'.$_POST['tgl'];

$input = mysql_query("INSERT INTO kegiatan VALUES (null, '$judul','$rincian','$waktu')");

if ($input) {
   
    echo "<script>alert('Kegiatan Berhasil Di Input'); location = 'lataradmin.php?page=view';</script>";
} else {
    echo "<script>alert('Kegiatan Gagal Di Input'); location = 'lataradmin.php?page=inputkegiatan';</script>";
}

?>

0 comments:

Post a Comment

Minergate

 
Copyright © Ferdy Blog's
Blogger Theme by BloggerThemes Sponsored by Internet Entrepreneur