Laporan project uas
Nama   : Asep Zaenal Mustofa
Nim     : A2.1400026
Kelas   : TI – VI D

link : asepkomputer.pe.hu
halaman awal pada website asepkomputer.pe.hu
 
 tampilan form register untuk membuat acount
form login acount supaya dapat melakukan pembelian
script index.php
<?php
  header('location:media.php?module=home');
?>

 script media.php
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">


    <title>asep toko</title>

    <!-- Bootstrap core CSS -->
    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <link href="../../assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="navbar-static-top.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="../../assets/js/ie-emulation-modes-warning.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>

  <body>

    <!-- Static navbar -->
    <nav class="navbar navbar-default navbar-static-top">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">Project uas</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
          <ul class="nav navbar-nav">

            <li><a href="media.php?module=home">Home </a></li>
            <li><a href="media.php?module=profilkami">Profil </a></li>
            <li><a href="media.php?module=carabeli">Cara Pembelian</a></li>
            <li><a href="media.php?module=keranjangbelanja">Keranjang Belanja </a></li>
            <li><a href="media.php?module=pemesanan">Pemesanan Barang</a></li>
           
          </ul>
          <ul class="nav navbar-nav navbar-right">

            <?php
    if ($_SESSION[email]=="") {
      echo "<li><a href='media.php?module=login' class='log'> login </a></li>
            <li><a href='media.php?module=register' class='user'>register</a></li>
      ";
    }
    else {
      echo "<li class='border'><a href='logout.php' class='log'> Logout </a></li>";
    }
    ?>
            <li class="carts"><a href="media.php?module=keranjangbelanja" class="cart">Shopping Cart</a></li>

          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </nav>


    <div class="container">

<?php
  error_reporting(0);
  session_start(); 
  include "config/koneksi.php";
  include "config/fungsi_indotgl.php";
  include "config/fungsi_combobox.php";
  include "config/library.php";
  include "config/fungsi_autolink.php";
  include "config/fungsi_rupiah.php";
?>
  <head>
  <link rel="shortcut icon" type="image/x-icon" href="bootstrap/images/favicon.ico" />
  <link rel="stylesheet" type="text/css" href="bootstrap/css/style.css"  media="screen" />
  <link rel="stylesheet" type="text/css" href="bootstrap/css/common.css" media="screen" />
  <link rel="stylesheet" type="text/css" href="bootstrap/css/button.css" media="screen" />
  <script src="bootstrap/js/jquery-1.9.1.min.js" type="text/javascript"></script>
  <script src="bootstrap/js/slides.min.jquery.js" type="text/javascript"></script>
  <script type="text/javascript">
    $(function(){
      $('.slides').slides({
        preload: true,
        generatePagination: true,
        play:3000
      });
    });
  </script>
</head>
  <body>
<!--Wrapper-->
<div id="wrapper">
      <!--Page-->
      <div class="page shadow">
    <!--Header-->
    <div id="header">
      <div class="primary-section">
        <div class="logo"><img src="bootstrap/images/logo.jpg" /></div>
        <div class="header-aside">
        </div>
      </div>
    </div>
    <!--Header-->
    <!--Content-->
    <div id="content">
          <div class="sidebar">
     
  <?php
  if ($_SESSION[email] !="") {
  echo "
        <div class='latest-product'>
              <h2>Your Menu</h2>
              <ul class='info'>
        <img src='bootstrap/images/1384271379_Admin.png' />
        <li><a href='media.php?module=profilKustomer'>My Profil</a></li>
        <li><a href='media.php?module=keranjangbelanja'>Shoping Cart<img src='bootstrap/images/cart.gif' /></a></li>
        ";
       echo "<div style='color:#E1473D;border:1px solid #E78686;padding:10px;background:#FFE1E1;'>";
        include "item.php";
       echo "</div>";
  echo "
       
        <li><a href='logout.php'>Logout</a></li>
          </ul>
             </div>
    ";
      }
  ?>
        <div class="latest-product">
              <h2>Produk Terlaris</h2>
              <ul class="info">
      <?php
      $best=mysql_query("SELECT * FROM produk ORDER BY dibeli DESC LIMIT 3");
      while($a=mysql_fetch_array($best)){
        $harga = format_rupiah($a[harga]);
        echo "<li><img src='foto_produk/small_$a[gambar]' height='50' width='30' />
          <div class='p-info'><a href='media.php?module=detailproduk&id=$a[id_produk]'>$a[nama_produk]</a></div>     
        </li>
      ";
      }

        ?>
          </ul>
             </div>
        <div class="latest-product ">
              <h2>Kategori Produk</h2>
              <ul class="info">
        <?php
                    $kategori=mysql_query("select nama_kategori, kategori.id_kategori,
                                  count(produk.id_produk) as jml
                                  from kategori left join produk
                                  on produk.id_kategori=kategori.id_kategori
                                  group by nama_kategori");
            $no=1;
            while($k=mysql_fetch_array($kategori)){
                echo "<li><a href=' media.php?module=detailkategori&id=$k[id_kategori]'> $k[nama_kategori] ($k[jml])</a></li>";
              $no++;
            }
            ?>
      Kami Menerima Service Komputer,Laptop,Printer
      <img src="bootstrap/images/bca.gif" /><img src="bootstrap/images/mandiri.gif" />
      <img src="bootstrap/images/bni.gif" />
      <img src="bootstrap/images/bri.gif" />
          </ul>
           </div>
        <div class="latest-product f-des">
<div class="plugin">            
              <div id="fb-root"></div>
              <div class="fb-like-box" data-href="http://www.facebook.com/webgranth" data-width="289" data-show-faces="true" data-stream="false" data-header="true"></div>
</div>            </div>
      </div>
          <div class="content-right" >
  <?PHP include "tengah.php";?>
      </div>
     </div>
    <!-- Content-->
  </div>
      <!--Footer-->
      <div id="footer">
    <div class="footer-top">
   
    <div class="page">
          <div class="footer-bottom">
        <div class="copyright">
            </div>
        <div class="social-icon">
      </div>
        </div>
  </div>
</div>
      <!--Footer-->
    </div>
<!--Wrapper-->
</body>

</div> <!-- /container -->


    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
    <script>window.jQuery || document.write('<script src="../../assets/js/vendor/jquery.min.js"><\/script>')</script>
    <script src="../../dist/js/bootstrap.min.js"></script>
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
  </body>
</html>

script aksi.php
<?php
session_start();
error_reporting(0);
include "config/koneksi.php";
include "config/library.php";

if (empty($_SESSION[username]) AND empty($_SESSION[password])) {
    header('location:media.php?module=warning');
}
else {

    $module=$_GET[module];
    $act=$_GET[act];

    if ($module=='keranjang' AND $act=='tambah'){
   
        $sid = $_SESSION[email];
   
        $sql2 = mysql_query("SELECT stok FROM produk WHERE id_produk='$_GET[id]'");
        $r=mysql_fetch_array($sql2);
        $stok=$r[stok];
     
      if ($stok == 0){
          echo "stok habis";
      }
      else{
        // check if the product is already
        // in cart table for this session
        $sql = mysql_query("SELECT id_produk FROM orders_temp
                WHERE id_produk='$_GET[id]' AND id_session='$sid'");
        $ketemu=mysql_num_rows($sql);
        if ($ketemu==0){
            // put the product in cart table
            mysql_query("INSERT INTO orders_temp (id_produk, jumlah, id_session, tgl_order_temp, jam_order_temp, stok_temp)
                    VALUES ('$_GET[id]', 1, '$sid', '$tgl_sekarang', '$jam_sekarang', '$stok')");
        } else {
            // update product quantity in cart table
            mysql_query("UPDATE orders_temp
                    SET jumlah = jumlah + 1
                    WHERE id_session ='$sid' AND id_produk='$_GET[id]'");       
        }   
        deleteAbandonedCart();
        header('Location:media.php?module=keranjangbelanja');
      }               
    }

    elseif ($module=='keranjang' AND $act=='hapus'){
        mysql_query("DELETE FROM orders_temp WHERE id_orders_temp='$_GET[id]'");
        header('Location:media.php?module=keranjangbelanja');               
    }

elseif ($module=='keranjang' AND $act=='update'){
  $id       = $_POST[id];
  $jml_data = count($id);
  $jumlah   = $_POST[jml]; // quantity
  for ($i=1; $i <= $jml_data; $i++){
    $sql2 = mysql_query("SELECT stok_temp FROM orders_temp    WHERE id_orders_temp='".$id[$i]."'");
    while($r=mysql_fetch_array($sql2)){
    if ($jumlah[$i] > $r[stok_temp]){
        echo "<script>window.alert('Jumlah yang dibeli melebihi stok yang ada');
        window.location=('media.php?module=keranjangbelanja')</script>";
    }
    elseif($jumlah[$i] == 0){
        echo "<script>window.alert('Anda tidak boleh menginputkan angka 0 atau mengkosongkannya!');
        window.location=('media.php?module=keranjangbelanja')</script>";
    }
    else{
      mysql_query("UPDATE orders_temp SET jumlah = '".$jumlah[$i]."'
                                      WHERE id_orders_temp = '".$id[$i]."'");
      header('Location:media.php?module=keranjangbelanja');
    }
  }
  }
}
}

/*
    Delete all cart entries older than one day
*/
function deleteAbandonedCart(){
    $kemarin = date('Y-m-d', mktime(0,0,0, date('m'), date('d') - 1, date('Y')));
    mysql_query("DELETE FROM orders_temp
            WHERE tgl_order_temp < '$kemarin'");
}
?>

script koneksi.php
<?php
$server = "localhost";
$username = "root";
$password = "";
$database = "db_toko";

// Koneksi dan memilih database di server
mysql_connect($server,$username,$password) or die("Koneksi gagal");
mysql_select_db($database) or die("Database tidak bisa dibuka");
?>

script diskon_stok.php
<?php
    // diskon 
    $harga     = format_rupiah($r[harga]);
    $disc      = ($r[diskon]/100)*$r[harga];
    $hargadisc = number_format(($r[harga]-$disc),0,",",".");

    $d=$r['diskon'];
    $hargatetap  = "<span class='price'> <br /></span>&nbsp;
                    <span style=\"color:#ff6600;font-size:14px;\"> Rp. <b>$hargadisc,-</b></span>";
    $hargadiskon = "<span style='text-decoration:line-through;font-size:14px;' class='price'>Rp. $harga <br /></span>
                    <div style='text-align=center;font-size:14px;'>&nbsp;diskon $d%</div>
                    <span style=\"color:#ff6600;font-size:14px;\"> Rp. <b>$hargadisc,-</b></span>";
    if ($d!=0){
      $divharga=$hargadiskon;
    }else{
      $divharga=$hargatetap;
    }

    // tombol stok habis kalau stoknya 0
    $stok        = $r['stok'];
    $tombolbeli  = "<a class='prod_cart' href=\"aksi.php?module=keranjang&act=tambah&id=$r[id_produk]\">beli</a>";
    $tombolhabis = "<div class='prod_cart_habis'>habis</div>";
    if ($stok!=0){
      $tombol=$tombolbeli;
    }else{
      $tombol=$tombolhabis;
    }
?>
Tampilan awal admin 
Ini tampilan awal pada home admin
tampilan pemesanan barang
lalu ada laporan pemesanan barang jika laporan ingin di print
 
kategori produk dalam hal ini admin dapat mengedit,mengubah dan menambahkan tag produk
produk dalam hal ini admin dapat mengedit,mengubah dan menambahkan produk
 
tabel order untuk melihat daftar orderan
untuk tabel ongkos bisa di sesuaikan
 
profil toko online di sini bermaksud untu mengedit tampilan profil
 
tabel cara beli disini dimaksudkan jika ingin menampilkan aturan dalam website
 
edit info rekening
 
laporan untuk melihat tanggal
 
logout
  
di bawah ini adalah script untuk form admin index.php
    <head>
        <link rel="stylesheet" type="text/css" href="css/style.css" />
        <style>
            body {
                background: url(images/blurred.jpg) no-repeat center top;
                -webkit-background-size: cover;
                -moz-background-size: cover;
                background-size: cover;
            }
        </style>
<script language="javascript">
function validasi(form){
  if (form.username.value == ""){
    alert("Anda belum mengisikan Username.");
    form.username.focus();
    return (false);
  }
    
  if (form.password.value == ""){
    alert("Anda belum mengisikan Password.");
    form.password.focus();
    return (false);
  }
  return (true);
}
</script>
    </head>
<body OnLoad="document.login.username.focus();">
        <div class="container">
            <section class="main">
            <form name="login" action="cek_login.php" method="POST" onSubmit="return validasi(this)" class="form-3">
                    <p class="clearfix">
                        <label for="login">Username</label>
                        <input type="text" name="username" id="login" placeholder="Username">
                    </p>
                    <p class="clearfix">
                        <label for="password">Password</label>
                        <input type="password" name="password" id="password" placeholder="Password">
                    </p>
                    <p class="clearfix">
                        <input type="submit" name="submit" value="Sign in">
                    </p>      
                </form>​
            </section>
           
        </div>
    </body>


 lalu ini adalah script media.php
<?php
  error_reporting(0);

session_start();

if (empty($_SESSION[username]) AND empty($_SESSION[passuser])){
  echo "<link href='style.css' rel='stylesheet' type='text/css'>
 <center>Untuk mengakses modul, Anda harus login <br>";
  echo "<a href=index.php><b>LOGIN</b></a></center>";
}
else{
?>

<html>
<head>
<title></title>
<script language="javascript" type="text/javascript">
    tinyMCE_GZ.init({
    plugins : 'style,layer,table,save,advhr,advimage, ...',
        themes  : 'simple,advanced',
        languages : 'en',
        disk_cache : true,
        debug : false
});
</script>
<script language="javascript" type="text/javascript"
src="../tinymcpuk/tiny_mce_src.js"></script>
<script type="text/javascript">
tinyMCE.init({
        mode : "textareas",
        theme : "advanced",
        plugins : "table,youtube,advhr,advimage,advlink,emotions,flash,searchreplace,paste,directionality,noneditable,contextmenu",
        theme_advanced_buttons1_add : "fontselect,fontsizeselect",
        theme_advanced_buttons2_add : "separator,preview,zoom,separator,forecolor,backcolor,liststyle",
        theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator",
        theme_advanced_buttons3_add_before : "tablecontrols,separator,youtube,separator",
        theme_advanced_buttons3_add : "emotions,flash",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        extended_valid_elements : "hr[class|width|size|noshade]",
        file_browser_callback : "fileBrowserCallBack",
        paste_use_dialog : false,
        theme_advanced_resizing : true,
        theme_advanced_resize_horizontal : false,
        theme_advanced_link_targets : "_something=My somthing;_something2=My somthing2;_something3=My somthing3;",
        apply_source_formatting : true
});

    function fileBrowserCallBack(field_name, url, type, win) {
        var connector = "../../filemanager/browser.html?Connector=connectors/php/connector.php";
        var enableAutoTypeSelection = true;
       
        var cType;
        tinymcpuk_field = field_name;
        tinymcpuk = win;
       
        switch (type) {
            case "image":
                cType = "Image";
                break;
            case "flash":
                cType = "Flash";
                break;
            case "file":
                cType = "File";
                break;
        }
       
        if (enableAutoTypeSelection && cType) {
            connector += "&Type=" + cType;
        }
       
        window.open(connector, "tinymcpuk", "modal,width=600,height=400");
    }
</script>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">
    <div id="menu">
      <ul>
        <li><a href='media.php?module=home'>Home</a>
        <li><a href='media.php?module=hubungi'>Pemesanan Barang</a></li>
        <li><a href='media.php?module=laporanpemesanan'> Lap. Pemesanan Barang</a></li>
        <li><a href='media.php?module=kategori'>Kategori Produk</a></li>
        <li><a href='media.php?module=produk'>Produk</a></li>
        <li><a href='media.php?module=order'>Order</a></li>
        <li><a href='media.php?module=ongkoskirim'>Ongkos Kirim</a></li>
        <li><a href='media.php?module=profil'>Profil Toko Online</a></li>
        <li><a href='media.php?module=carabeli'>Cara Beli</a></li>
        <li><a href='media.php?module=rekening'>Info Rekening Toko</a></li>
        <li><a href='media.php?module=laporan'>Laporan</a></li>
        <li><a href='logout.php'>Logout</a></li>    
     </ul>
        <p>&nbsp;</p>
     </div>

  <div id="content">
        <?php include "content.php"; ?>
  </div>
 
</div>


</body>
</html>
<?php
}
?>

ini adalah script content.php
<?php
include "../config/koneksi.php";
include "../config/library.php";
include "../config/fungsi_indotgl.php";
include "../config/fungsi_combobox.php";
include "../config/fungsi_rupiah.php";

// Bagian Home
if ($_GET[module]=='home'){
  if ($_SESSION['leveluser']=='admin'){
  echo "<h2>Selamat Datang</h2>
          <p>Hai <b>$_SESSION[namalengkap]</b>, selamat datang di halaman Administrator.<br> Silahkan klik menu pilihan yang berada
          di sebelah kiri untuk mengelola content website. </p>
          <p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>
          <p align=right>Login : $hari_ini, ";
  echo tgl_indo(date("Y m d"));
  echo " | ";
  echo date("H:i:s");
  echo " WIB</p>";
  }
}

// Bagian Modul
elseif ($_GET[module]=='modul'){
  if ($_SESSION['leveluser']=='admin'){
    include "modul/mod_modul/modul.php";
  }
}
elseif ($_GET[module]=='laporanpemesanan'){
  if ($_SESSION['leveluser']=='admin'){
    include "modul/mod_laporanpemesanan/laporan.php";
  }
}

// Bagian Kategori
elseif ($_GET[module]=='kategori'){
  if ($_SESSION['leveluser']=='admin'){
    include "modul/mod_kategori/kategori.php";
  }
}

// Bagian Produk
elseif ($_GET[module]=='produk'){
  if ($_SESSION['leveluser']=='admin'){
    include "modul/mod_produk/produk.php";
  }
}


// Bagian Order
elseif ($_GET[module]=='order'){
  if ($_SESSION['leveluser']=='admin'){
    include "modul/mod_order/order.php";
  }
}

// Bagian Profil
elseif ($_GET[module]=='profil'){
  if ($_SESSION['leveluser']=='admin'){
    include "modul/mod_profil/profil.php";
  }
}

// Bagian Order
elseif ($_GET[module]=='hubungi'){
  if ($_SESSION['leveluser']=='admin'){
    include "modul/mod_hubungi/hubungi.php";
  }
}

// Bagian Cara Pembelian
elseif ($_GET[module]=='carabeli'){
  if ($_SESSION['leveluser']=='admin'){
    include "modul/mod_carabeli/carabeli.php";
  }
}

// Bagian Banner
elseif ($_GET[module]=='rekening'){
  if ($_SESSION['leveluser']=='admin'){
    include "modul/mod_rekening/rekening.php";
  }
}

// Bagian Kota/Ongkos Kirim
elseif ($_GET[module]=='ongkoskirim'){
  if ($_SESSION['leveluser']=='admin'){
    include "modul/mod_ongkoskirim/ongkoskirim.php";
  }
}


// Bagian Laporan
elseif ($_GET[module]=='laporan'){
  if ($_SESSION['leveluser']=='admin'){
    include "modul/mod_laporan/laporan.php";
  }
}

// Apabila modul tidak ditemukan
else{
  echo "<p><b>MODUL BELUM ADA ATAU BELUM LENGKAP</b></p>";
}
?>

ini adalah aksi.php
<?php
session_start();
if (empty($_SESSION['username']) AND empty($_SESSION['passuser'])){
  echo "<link href='style.css' rel='stylesheet' type='text/css'>
 <center>Untuk mengakses modul, Anda harus login <br>";
  echo "<a href=../../index.php><b>LOGIN</b></a></center>";
}


<body>
hjggjkjf
</body>
</html>
dan ada sebagian script yg belum terupload
0 Komentar untuk " "

Silakan tinggalkan komentar anda. DILARANG KERAS menyimpan link blog/web pada komentar dengan tujuan backlink, Spam.

 
Copyright © 2014 Tutorial Kampus - All Rights Reserved
Template By. Catatan Info