Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

inisialisasi project jadi web-perpustakaan

  • Loading branch information...
commit 15c56ea9fd9daae42e1faa7f42b302b274cbd3d8 0 parents
Adi Sulistiono authored

Showing 90 changed files with 2,516 additions and 0 deletions. Show diff stats Hide diff stats

  1. +23 0 beranda.php
  2. +31 0 cari.php
  3. +59 0 config.php
  4. +60 0 content.php
  5. +308 0 database/db.sql
  6. +19 0 deleteBuku.php
  7. +19 0 deleteKatalog.php
  8. +19 0 deletePenerbit.php
  9. +19 0 deletePengarang.php
  10. +28 0 exelogin.php
  11. +53 0 exeregister.php
  12. +128 0 formBuku.php
  13. +59 0 formKatalog.php
  14. +113 0 formPeminjaman.php
  15. +77 0 formPenerbit.php
  16. +77 0 formPengarang.php
  17. +81 0 formPengembalian.php
  18. +65 0 formUpdateStok.php
  19. BIN  foto_profile/pusio-gmail-tux.png
  20. +16 0 home.php
  21. BIN  images/23.jpg
  22. BIN  images/Books.JPG
  23. BIN  images/Buku-Perpustakaan_main.jpg
  24. BIN  images/GEMBOK.jpg
  25. BIN  images/Jantung_Sekolah1.jpg
  26. BIN  images/L_is_for_Library_cover.jpg
  27. BIN  images/Thumbs.db
  28. BIN  images/WB01292_.GIF
  29. BIN  images/arrow.gif
  30. BIN  images/back.gif
  31. BIN  images/bg.jpg
  32. BIN  images/book sale.jpg
  33. BIN  images/book3.gif
  34. BIN  images/book_stack.jpg
  35. BIN  images/books1.gif
  36. BIN  images/books3.jpg
  37. BIN  images/comment.gif
  38. BIN  images/fb005.jpg
  39. BIN  images/finance.jpg
  40. BIN  images/finance1.jpg
  41. BIN  images/footer.jpg
  42. BIN  images/header.jpg
  43. BIN  images/images.jpg
  44. BIN  images/images2.jpg
  45. BIN  images/images3.jpg
  46. BIN  images/laptop1.jpg
  47. BIN  images/laptsop1.jpg
  48. BIN  images/leftbg.jpg
  49. BIN  images/library011.jpg
  50. BIN  images/library_clipart3.gif
  51. BIN  images/login-welcome.JPG
  52. BIN  images/more.gif
  53. BIN  images/perpus-sekolah.gif
  54. BIN  images/perpustakaanl2.jpg
  55. BIN  images/pile-of-books.jpg
  56. BIN  images/public library.jpg
  57. BIN  images/self_help_library_home.jpg
  58. BIN  images/smk2.gif
  59. BIN  images/spport.gif
  60. +81 0 images/style.css
  61. +89 0 images/style_3c.css
  62. BIN  images/timeicon.gif
  63. BIN  images/tmc054.jpg
  64. BIN  images/top.jpg
  65. +246 0 index.php
  66. +8 0 koneksi.php
  67. +66 0 listBuku.php
  68. +51 0 listKatalog.php
  69. +49 0 listPeminjaman.php
  70. +60 0 listPenerbit.php
  71. +60 0 listPengarang.php
  72. +46 0 listStok.php
  73. +24 0 login.php
  74. +18 0 logout.php
  75. +8 0 notadmin.php
  76. +8 0 notmember.php
  77. +18 0 profil.php
  78. +37 0 profile.php
  79. +85 0 register.php
  80. +41 0 saveBuku.php
  81. +24 0 saveKatalog.php
  82. +42 0 savePeminjaman.php
  83. +29 0 savePenerbit.php
  84. +29 0 savePengarang.php
  85. +17 0 savePengembalian.php
  86. +44 0 searching.php
  87. +8 0 sessionFailed.php
  88. +16 0 updateConfig.php
  89. +15 0 updateStok.php
  90. +43 0 viewbook.php
23 beranda.php
... ... @@ -0,0 +1,23 @@
  1 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2 +<html xmlns="http://www.w3.org/1999/xhtml">
  3 +<head>
  4 +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5 +<title>Untitled Document</title>
  6 +<style type="text/css">
  7 +.style3 {color: #FF9933}
  8 +</style>
  9 +</head>
  10 +
  11 +<body>
  12 +<p><a href="#" class="style3">Pustaka SMK Negeri 2 Surabaya.com</a>
  13 +</p>
  14 +<h3>Buku adalah alat pengantar pada pengetahuan yang nantinya pengetahuan itu akan menuju pada kesuksesan </h3>
  15 +<div class="img"><img src="images/finance.jpg" alt="Finance" /></div>
  16 +Pustaka Smekda adalah sebuah perpustakaan yang telah berdiri sejak jaman belanda dan hingga kini perpustakaan itu masih tetap setia menemani siswa/i SMK Negeri 2 Surabaya Dahulu (STM 1) untuk memberikan pengetahuan yang beranekaragam mulai dari pengetahuan tekhnik sampai dengan ilmu pelajaran umum tersedia disana.Harapannya dari sebuah perpustakaan kecil ini dapat membantu untuk mencerdaskan &amp; menambah wawasan siswa/i SMK Negeri 2 Surabaya / Anggota Perpustakaan yang gemar membaca dan tergabung dalam Perpus Smekda Club untuk terus menjadi penjelajah dunia, sehingga Perpus Smkeda dapat memberikan wadah agar tetap terpenuhi kebutuhannya .
  17 +<p><a href="#" class="style3">Aktivitas Siswa Dalam Perpus </a></p>
  18 +<h3>Canda tawa pelajar Smekda </h3>
  19 +<div class="img"><img src="images/laptop1.jpg" alt="laptop" /></div>
  20 +<p>Dapat dilihat bahwa keantusiasan siswa/i SMK Negeri 2 dalam membaca sungguh luar biasa apa lagi didukung dengan tersedianya buku - buku yang memadai mulai dari buku tekhnik maupun pelajaran umum tersedia disini ,sehingga memudahkan para siswa/i untuk mengapresiasikan rasa keingintahuan para siswa/i dan sistem management perpustakaan SMK Negeri 2 yang baik sehingga sang siswa tidak cepat bosan dalam membaca dan diharapkan aktivitas siswa/i pada gambar disamping ini akan terus terbudaya sehingga dapat mencetak generasi STM yang mempunyai kualitas dan potensi yang handal dalam dunia kerja yang sangat luas meskipun hanya seorang lulusan STM yang dianggap remeh oleh orang - orang apriori. </p>
  21 +<p>&nbsp;</p>
  22 +</body>
  23 +</html>
31 cari.php
... ... @@ -0,0 +1,31 @@
  1 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2 +<html xmlns="http://www.w3.org/1999/xhtml">
  3 +<head>
  4 +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  5 +<title>Untitled Document</title>
  6 +</head>
  7 +
  8 +<body>
  9 +<div align="center">
  10 + <table width="152" border="0" cellspacing="0" cellpadding="0">
  11 + <tr>
  12 + <td width="53">Search : </td>
  13 + <td width="99">&nbsp;</td>
  14 + </tr>
  15 + <tr> <form method="post" action="searching.php">
  16 + <td colspan="2"><input name="keyword" type="text" id="keyword" /></td>
  17 + </tr>
  18 + <tr>
  19 + <td colspan="2">
  20 + <label></label>
  21 + <div align="center">
  22 + <input type="submit" name="Submit" value="enter" />
  23 + </div>
  24 + </td>
  25 + </tr></form>
  26 + </table>
  27 + <label></label>
  28 + </form>
  29 +</div>
  30 +</body>
  31 +</html>
59 config.php
... ... @@ -0,0 +1,59 @@
  1 +<?
  2 + include 'koneksi.php';
  3 +
  4 + session_start();
  5 + $admin=$_GET['admin'];
  6 + if($admin!=''){
  7 + $select_admin=mysql_query("select * from admin where id = '$admin'");
  8 + $count=mysql_num_rows($select_admin);
  9 + if($count>0){
  10 + $row=mysql_fetch_array($select_admin);
  11 + if(session_is_registered($row[1]) && session_is_registered($row[2]) && $row[3]="ADM"){
  12 + $select_config=mysql_query("select * from config limit 1");
  13 + $dt_config=mysql_fetch_array($select_config);
  14 + }else {
  15 + header('location:index.php?pg=notadmin');
  16 + }
  17 + } else {
  18 + header('location:index.php?pg=sessionFailed');
  19 + }
  20 + }
  21 +
  22 +
  23 +?>
  24 +<html>
  25 +<head>
  26 +<title>Form Konfigurasi</title>
  27 +</head>
  28 +<body>
  29 +
  30 +<table width="400" align="left" border="0" cellpadding="5" cellspacing="0" style="font-family:arial;color:black;font-size:12px;">
  31 +<form method="post" action="updateConfig.php" target="thetarget">
  32 +<tr valign="center">
  33 +<td align="left">MAX LAMA PINJAM</td>
  34 +<td align="center">:</td>
  35 +<td ><input type="text" name="maxLamaPinjam" maxlength="3" value="<?echo $dt_config[1];?>">&nbsp;(hari)</td>
  36 +</tr>
  37 +
  38 +<tr valign="center">
  39 +<td align="left">DENDA PER HARI</td>
  40 +<td align="center">:</td>
  41 +<td ><input type="text" name="dendaPerHari" value="<?echo $dt_config[2];?>">&nbsp;(Rupiah)</td>
  42 +</tr>
  43 +
  44 +<tr valign="top">
  45 +<td align="center" colspan="3">
  46 + <input type="submit" name="submit" value="submit">
  47 + <input type="reset" name="reset" value="reset">
  48 + <input type="hidden" name="admin" value=<? echo $admin;?>>
  49 + <input type="hidden" name="id" value=<? echo $dt_config[0];?>>
  50 +</td>
  51 +
  52 +</tr>
  53 +<tr>
  54 +<td colspan="3"><iframe width="100%" name="thetarget" height="100" frameborder="0" scrolling="auto"></iframe></td>
  55 +</tr>
  56 +</form>
  57 +
  58 +</body>
  59 +</html>
60 content.php
... ... @@ -0,0 +1,60 @@
  1 +<?
  2 + $admin=$_GET['admin'];
  3 +?>
  4 +<html>
  5 +<head></head>
  6 +<body onload="submitForm()">
  7 +
  8 +<?
  9 + $pg=$_GET['pg'];
  10 + switch($pg){
  11 + case 'home':
  12 + echo "<form method=POST target=content action=home.php name=contentForm id=contentForm>
  13 + <input type=hidden name=admin id=admin value=$admin>
  14 + </form>";
  15 + //include 'home.php';
  16 + break;
  17 + case 'register':
  18 + //include 'register.php';
  19 + echo "<form method=POST target=content action=register.php name=contentForm id=contentForm>
  20 + <input type=hidden name=admin id=admin value=$admin>
  21 + </form>";
  22 + break;
  23 + case 'viewbook':
  24 + //include 'viewbook.php';
  25 + echo "<form method=POST target=content action=viewbook.php name=contentForm id=contentForm>
  26 + <input type=hidden name=admin id=admin value=$admin>
  27 + </form>";
  28 + break;
  29 + case 'login':
  30 + //include 'login.php';
  31 + echo "<form method=POST target=content action=login.php name=contentForm id=contentForm>
  32 + <input type=hidden name=admin id=admin value=$admin>
  33 + </form>";
  34 + break;
  35 + case 'cari':
  36 + //include 'searching.php';
  37 + echo "<form method=POST target=content action=searching.php name=contentForm id=contentForm>
  38 + <input type=hidden name=admin id=admin value=$admin>
  39 + </form>";
  40 + break;
  41 + case 'logout':
  42 + //include 'logout.php';
  43 + echo "<form method=POST target=content action=logout.php name=contentForm id=contentForm>
  44 + <input type=hidden name=admin id=admin value=$admin>
  45 + </form>";
  46 + break;
  47 + case 'profile':
  48 + //include 'profile.php';
  49 + echo "<form method=POST target=content action=profile.php name=contentForm id=contentForm>
  50 + <input type=hidden name=admin id=admin value=$admin>
  51 + </form>";
  52 + break;
  53 + default:
  54 + //include 'login.php';
  55 + echo "<form method=POST target=content action=login.php name=contentForm id=contentForm>
  56 + <input type=hidden name=admin id=admin value=$admin>
  57 + </form>";
  58 + break;
  59 + }
  60 +?><script type='text/javascript'>document.contentForm.submit();</script></body></html>
308 database/db.sql
... ... @@ -0,0 +1,308 @@
  1 +-- MySQL dump 10.13 Distrib 5.1.49, for debian-linux-gnu (i686)
  2 +--
  3 +-- Host: localhost Database: db_perpustakaan
  4 +-- ------------------------------------------------------
  5 +-- Server version 5.1.49-1ubuntu8.1
  6 +
  7 +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  8 +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  9 +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  10 +/*!40101 SET NAMES utf8 */;
  11 +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
  12 +/*!40103 SET TIME_ZONE='+00:00' */;
  13 +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
  14 +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
  15 +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
  16 +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
  17 +
  18 +--
  19 +-- Table structure for table `admin`
  20 +--
  21 +
  22 +DROP TABLE IF EXISTS `admin`;
  23 +/*!40101 SET @saved_cs_client = @@character_set_client */;
  24 +/*!40101 SET character_set_client = utf8 */;
  25 +CREATE TABLE `admin` (
  26 + `id` varchar(255) NOT NULL,
  27 + `username` varchar(255) NOT NULL,
  28 + `password` varchar(255) NOT NULL,
  29 + `type` char(3) NOT NULL,
  30 + PRIMARY KEY (`id`),
  31 + UNIQUE KEY `username` (`username`)
  32 +) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  33 +/*!40101 SET character_set_client = @saved_cs_client */;
  34 +
  35 +--
  36 +-- Dumping data for table `admin`
  37 +--
  38 +
  39 +LOCK TABLES `admin` WRITE;
  40 +/*!40000 ALTER TABLE `admin` DISABLE KEYS */;
  41 +INSERT INTO `admin` VALUES ('21232f297a57a5a743894a0e4a801fc3','admin','0192023a7bbd73250516f069df18b500','ADM');
  42 +/*!40000 ALTER TABLE `admin` ENABLE KEYS */;
  43 +UNLOCK TABLES;
  44 +
  45 +--
  46 +-- Table structure for table `anggota`
  47 +--
  48 +
  49 +DROP TABLE IF EXISTS `anggota`;
  50 +/*!40101 SET @saved_cs_client = @@character_set_client */;
  51 +/*!40101 SET character_set_client = utf8 */;
  52 +CREATE TABLE `anggota` (
  53 + `id_anggota` int(11) NOT NULL AUTO_INCREMENT,
  54 + `id_admin` varchar(255) NOT NULL,
  55 + `nama` varchar(255) NOT NULL,
  56 + `sex` char(1) NOT NULL,
  57 + `telp` varchar(15) NOT NULL,
  58 + `alamat` varchar(255) NOT NULL,
  59 + `email` varchar(255) NOT NULL,
  60 + `tgl_entry` date NOT NULL,
  61 + `descripsi` text NOT NULL,
  62 + `foto` varchar(255) DEFAULT NULL,
  63 + PRIMARY KEY (`id_anggota`),
  64 + KEY `admin` (`id_admin`),
  65 + CONSTRAINT `admin` FOREIGN KEY (`id_admin`) REFERENCES `admin` (`id`)
  66 +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
  67 +/*!40101 SET character_set_client = @saved_cs_client */;
  68 +
  69 +--
  70 +-- Dumping data for table `anggota`
  71 +--
  72 +
  73 +LOCK TABLES `anggota` WRITE;
  74 +/*!40000 ALTER TABLE `anggota` DISABLE KEYS */;
  75 +INSERT INTO `anggota` VALUES (1,'21232f297a57a5a743894a0e4a801fc3','administrator','L','085210831766','administrator home','admin@perpus.co.id','2011-02-15','iam administrator','pusio-gmail-tux.png');
  76 +/*!40000 ALTER TABLE `anggota` ENABLE KEYS */;
  77 +UNLOCK TABLES;
  78 +
  79 +--
  80 +-- Table structure for table `buku`
  81 +--
  82 +
  83 +DROP TABLE IF EXISTS `buku`;
  84 +/*!40101 SET @saved_cs_client = @@character_set_client */;
  85 +/*!40101 SET character_set_client = utf8 */;
  86 +CREATE TABLE `buku` (
  87 + `isbn` varchar(25) NOT NULL,
  88 + `judul` varchar(255) DEFAULT NULL,
  89 + `tahun` int(11) DEFAULT NULL,
  90 + `id_penerbit` varchar(8) DEFAULT NULL,
  91 + `id_pengarang` varchar(8) DEFAULT NULL,
  92 + `id_katalog` varchar(3) DEFAULT NULL,
  93 + `qty_stok` int(11) DEFAULT '0',
  94 + PRIMARY KEY (`isbn`),
  95 + KEY `penerbit` (`id_penerbit`),
  96 + KEY `pengarang` (`id_pengarang`),
  97 + KEY `katalog` (`id_katalog`),
  98 + CONSTRAINT `katalog` FOREIGN KEY (`id_katalog`) REFERENCES `katalog` (`id_katalog`),
  99 + CONSTRAINT `penerbit` FOREIGN KEY (`id_penerbit`) REFERENCES `penerbit` (`id_penerbit`),
  100 + CONSTRAINT `pengarang` FOREIGN KEY (`id_pengarang`) REFERENCES `pengarang` (`id_pengarang`)
  101 +) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  102 +/*!40101 SET character_set_client = @saved_cs_client */;
  103 +
  104 +--
  105 +-- Dumping data for table `buku`
  106 +--
  107 +
  108 +LOCK TABLES `buku` WRITE;
  109 +/*!40000 ALTER TABLE `buku` DISABLE KEYS */;
  110 +INSERT INTO `buku` VALUES ('092-111','BELAJAR PHP',2010,'PN01','PG01','KG0',12);
  111 +/*!40000 ALTER TABLE `buku` ENABLE KEYS */;
  112 +UNLOCK TABLES;
  113 +
  114 +--
  115 +-- Table structure for table `config`
  116 +--
  117 +
  118 +DROP TABLE IF EXISTS `config`;
  119 +/*!40101 SET @saved_cs_client = @@character_set_client */;
  120 +/*!40101 SET character_set_client = utf8 */;
  121 +CREATE TABLE `config` (
  122 + `id` int(11) NOT NULL AUTO_INCREMENT,
  123 + `maxLamaPinjam` int(11) DEFAULT NULL,
  124 + `dendaPerHari` decimal(19,0) DEFAULT NULL,
  125 + PRIMARY KEY (`id`)
  126 +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
  127 +/*!40101 SET character_set_client = @saved_cs_client */;
  128 +
  129 +--
  130 +-- Dumping data for table `config`
  131 +--
  132 +
  133 +LOCK TABLES `config` WRITE;
  134 +/*!40000 ALTER TABLE `config` DISABLE KEYS */;
  135 +INSERT INTO `config` VALUES (1,3,'500');
  136 +/*!40000 ALTER TABLE `config` ENABLE KEYS */;
  137 +UNLOCK TABLES;
  138 +
  139 +--
  140 +-- Table structure for table `detail_peminjaman`
  141 +--
  142 +
  143 +DROP TABLE IF EXISTS `detail_peminjaman`;
  144 +/*!40101 SET @saved_cs_client = @@character_set_client */;
  145 +/*!40101 SET character_set_client = utf8 */;
  146 +CREATE TABLE `detail_peminjaman` (
  147 + `id_pinjam` int(11) NOT NULL DEFAULT '0',
  148 + `isbn` varchar(25) NOT NULL DEFAULT '',
  149 + `qty` int(11) DEFAULT NULL,
  150 + PRIMARY KEY (`id_pinjam`,`isbn`),
  151 + KEY `id_pinjam` (`id_pinjam`),
  152 + KEY `isbn` (`isbn`),
  153 + CONSTRAINT `isbn` FOREIGN KEY (`isbn`) REFERENCES `buku` (`isbn`),
  154 + CONSTRAINT `id_pinjam` FOREIGN KEY (`id_pinjam`) REFERENCES `peminjaman` (`id_pinjam`)
  155 +) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  156 +/*!40101 SET character_set_client = @saved_cs_client */;
  157 +
  158 +--
  159 +-- Dumping data for table `detail_peminjaman`
  160 +--
  161 +
  162 +LOCK TABLES `detail_peminjaman` WRITE;
  163 +/*!40000 ALTER TABLE `detail_peminjaman` DISABLE KEYS */;
  164 +/*!40000 ALTER TABLE `detail_peminjaman` ENABLE KEYS */;
  165 +UNLOCK TABLES;
  166 +
  167 +--
  168 +-- Table structure for table `katalog`
  169 +--
  170 +
  171 +DROP TABLE IF EXISTS `katalog`;
  172 +/*!40101 SET @saved_cs_client = @@character_set_client */;
  173 +/*!40101 SET character_set_client = utf8 */;
  174 +CREATE TABLE `katalog` (
  175 + `id_katalog` varchar(3) NOT NULL,
  176 + `nama` varchar(255) DEFAULT NULL,
  177 + PRIMARY KEY (`id_katalog`)
  178 +) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  179 +/*!40101 SET character_set_client = @saved_cs_client */;
  180 +
  181 +--
  182 +-- Dumping data for table `katalog`
  183 +--
  184 +
  185 +LOCK TABLES `katalog` WRITE;
  186 +/*!40000 ALTER TABLE `katalog` DISABLE KEYS */;
  187 +INSERT INTO `katalog` VALUES ('KG0','KATALOG 1');
  188 +/*!40000 ALTER TABLE `katalog` ENABLE KEYS */;
  189 +UNLOCK TABLES;
  190 +
  191 +--
  192 +-- Table structure for table `peminjaman`
  193 +--
  194 +
  195 +DROP TABLE IF EXISTS `peminjaman`;
  196 +/*!40101 SET @saved_cs_client = @@character_set_client */;
  197 +/*!40101 SET character_set_client = utf8 */;
  198 +CREATE TABLE `peminjaman` (
  199 + `id_pinjam` int(11) NOT NULL AUTO_INCREMENT,
  200 + `id_anggota` int(11) DEFAULT NULL,
  201 + `tgl_pinjam` date DEFAULT NULL,
  202 + `tgl_kembali` date DEFAULT NULL,
  203 + PRIMARY KEY (`id_pinjam`),
  204 + KEY `anggota` (`id_anggota`),
  205 + CONSTRAINT `anggota` FOREIGN KEY (`id_anggota`) REFERENCES `anggota` (`id_anggota`)
  206 +) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  207 +/*!40101 SET character_set_client = @saved_cs_client */;
  208 +
  209 +--
  210 +-- Dumping data for table `peminjaman`
  211 +--
  212 +
  213 +LOCK TABLES `peminjaman` WRITE;
  214 +/*!40000 ALTER TABLE `peminjaman` DISABLE KEYS */;
  215 +/*!40000 ALTER TABLE `peminjaman` ENABLE KEYS */;
  216 +UNLOCK TABLES;
  217 +
  218 +--
  219 +-- Table structure for table `penerbit`
  220 +--
  221 +
  222 +DROP TABLE IF EXISTS `penerbit`;
  223 +/*!40101 SET @saved_cs_client = @@character_set_client */;
  224 +/*!40101 SET character_set_client = utf8 */;
  225 +CREATE TABLE `penerbit` (
  226 + `id_penerbit` varchar(8) NOT NULL,
  227 + `nama_penerbit` varchar(255) DEFAULT NULL,
  228 + `email` varchar(50) DEFAULT NULL,
  229 + `telp` varchar(12) DEFAULT NULL,
  230 + `alamat` varchar(255) DEFAULT NULL,
  231 + PRIMARY KEY (`id_penerbit`)
  232 +) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  233 +/*!40101 SET character_set_client = @saved_cs_client */;
  234 +
  235 +--
  236 +-- Dumping data for table `penerbit`
  237 +--
  238 +
  239 +LOCK TABLES `penerbit` WRITE;
  240 +/*!40000 ALTER TABLE `penerbit` DISABLE KEYS */;
  241 +INSERT INTO `penerbit` VALUES ('PN01','PENERBIT 01','penerbit@perpus.co.id','0219999333','PENERBIT');
  242 +/*!40000 ALTER TABLE `penerbit` ENABLE KEYS */;
  243 +UNLOCK TABLES;
  244 +
  245 +--
  246 +-- Table structure for table `pengarang`
  247 +--
  248 +
  249 +DROP TABLE IF EXISTS `pengarang`;
  250 +/*!40101 SET @saved_cs_client = @@character_set_client */;
  251 +/*!40101 SET character_set_client = utf8 */;
  252 +CREATE TABLE `pengarang` (
  253 + `id_pengarang` varchar(8) NOT NULL,
  254 + `nama_pengarang` varchar(255) DEFAULT NULL,
  255 + `email` varchar(50) DEFAULT NULL,
  256 + `telp` varchar(12) DEFAULT NULL,
  257 + `alamat` varchar(255) DEFAULT NULL,
  258 + PRIMARY KEY (`id_pengarang`)
  259 +) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  260 +/*!40101 SET character_set_client = @saved_cs_client */;
  261 +
  262 +--
  263 +-- Dumping data for table `pengarang`
  264 +--
  265 +
  266 +LOCK TABLES `pengarang` WRITE;
  267 +/*!40000 ALTER TABLE `pengarang` DISABLE KEYS */;
  268 +INSERT INTO `pengarang` VALUES ('PG01','PENGARANG 01','pengarang@perpus.co.id','0929211','PENGARANG');
  269 +/*!40000 ALTER TABLE `pengarang` ENABLE KEYS */;
  270 +UNLOCK TABLES;
  271 +
  272 +--
  273 +-- Table structure for table `pengembalian`
  274 +--
  275 +
  276 +DROP TABLE IF EXISTS `pengembalian`;
  277 +/*!40101 SET @saved_cs_client = @@character_set_client */;
  278 +/*!40101 SET character_set_client = utf8 */;
  279 +CREATE TABLE `pengembalian` (
  280 + `id_kembali` int(11) NOT NULL AUTO_INCREMENT,
  281 + `id_pinjam` int(11) DEFAULT NULL,
  282 + `tgl_kembali` date DEFAULT NULL,
  283 + `denda` decimal(19,0) DEFAULT NULL,
  284 + PRIMARY KEY (`id_kembali`),
  285 + KEY `id_pinjam` (`id_pinjam`),
  286 + CONSTRAINT `pengembalian_ibfk_1` FOREIGN KEY (`id_pinjam`) REFERENCES `peminjaman` (`id_pinjam`)
  287 +) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  288 +/*!40101 SET character_set_client = @saved_cs_client */;
  289 +
  290 +--
  291 +-- Dumping data for table `pengembalian`
  292 +--
  293 +
  294 +LOCK TABLES `pengembalian` WRITE;
  295 +/*!40000 ALTER TABLE `pengembalian` DISABLE KEYS */;
  296 +/*!40000 ALTER TABLE `pengembalian` ENABLE KEYS */;
  297 +UNLOCK TABLES;
  298 +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
  299 +
  300 +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
  301 +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
  302 +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
  303 +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  304 +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  305 +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
  306 +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
  307 +
  308 +-- Dump completed on 2011-02-15 22:28:48
19 deleteBuku.php
... ... @@ -0,0 +1,19 @@
  1 +<?
  2 + session_start();
  3 + include 'koneksi.php';
  4 + $admin=$_GET['admin'];
  5 + $kode=$_GET['idBuku'];
  6 +
  7 + if($kode!=''){
  8 + $query=mysql_query("delete from buku where isbn='$kode'");
  9 + } else {
  10 + echo "KODE TIDAK BOLEH NULL !!!<br>";
  11 + }
  12 + if($query){
  13 + echo "delete success<br>";
  14 + } else {
  15 + echo "delete failed<br>";
  16 + }
  17 + echo "<a href=index.php?pg=buku&admin=$admin>go to list buku</a>";
  18 + //echo $admin;
  19 +?>
19 deleteKatalog.php
... ... @@ -0,0 +1,19 @@
  1 +<?
  2 + session_start();
  3 + include 'koneksi.php';
  4 + $admin=$_GET['admin'];
  5 + $kode=$_GET['idKatalog'];
  6 +
  7 + if($kode!=''){
  8 + $query=mysql_query("delete from katalog where id_katalog='$kode'");
  9 + } else {
  10 + echo "KODE TIDAK BOLEH NULL !!!<br>";
  11 + }
  12 + if($query){
  13 + echo "delete success<br>";
  14 + } else {
  15 + echo "delete failed<br>";
  16 + }
  17 + echo "<a href=index.php?pg=katalog&admin=$admin>go to list katalog</a>";
  18 + //echo $admin;
  19 +?>
19 deletePenerbit.php
... ... @@ -0,0 +1,19 @@
  1 +<?
  2 + session_start();
  3 + include 'koneksi.php';
  4 + $admin=$_GET['admin'];
  5 + $kode=$_GET['idPenerbit'];
  6 +
  7 + if($kode!=''){
  8 + $query=mysql_query("delete from penerbit where id_penerbit='$kode'");
  9 + } else {
  10 + echo "KODE TIDAK BOLEH NULL !!!<br>";
  11 + }
  12 + if($query){
  13 + echo "delete success<br>";
  14 + } else {
  15 + echo "delete failed<br>";
  16 + }
  17 + echo "<a href=index.php?pg=penerbit&admin=$admin>go to list penerbit</a>";
  18 + //echo $admin;
  19 +?>
19 deletePengarang.php
... ... @@ -0,0 +1,19 @@
  1 +<?
  2 + session_start();
  3 + include 'koneksi.php';
  4 + $admin=$_GET['admin'];
  5 + $kode=$_GET['idPengarang'];
  6 +
  7 + if($kode!=''){
  8 + $query=mysql_query("delete from pengarang where id_pengarang='$kode'");
  9 + } else {
  10 + echo "KODE TIDAK BOLEH NULL !!!<br>";
  11 + }
  12 + if($query){
  13 + echo "delete success<br>";
  14 + } else {
  15 + echo "delete failed<br>";
  16 + }
  17 + echo "<a href=index.php?pg=pengarang&admin=$admin>go to list pengarang</a>";
  18 + //echo $admin;
  19 +?>
28 exelogin.php
... ... @@ -0,0 +1,28 @@
  1 +<?
  2 + include 'koneksi.php';
  3 + $user=$_POST['user'];
  4 + $pass=$_POST['pass'];
  5 + $md_pass=md5($pass);
  6 +
  7 + $sqlAdmin=mysql_query("select * from admin where username='$user' and password='$md_pass'");
  8 + $row=mysql_fetch_array($sqlAdmin);
  9 + $count=mysql_num_rows($sqlAdmin);
  10 +
  11 + if($count==0)
  12 + echo "Username atau password salah";
  13 + else if($row[3]=='ADM'){
  14 + session_register($row[1]);
  15 + session_register($row[2]);
  16 + //session_register(administrator);
  17 + $id=1;
  18 + header("location:index.php?pg=profile&admin=$row[0]");
  19 + } else if($row[3]=='ANG'){
  20 + session_register($row[1]);
  21 + session_register($row[2]);
  22 + //session_register(member);
  23 + $id=2;
  24 + header("location:index.php?pg=profile&admin=$row[0]");
  25 + }
  26 + ob_end_flush();
  27 +
  28 +?>
53 exeregister.php
... ... @@ -0,0 +1,53 @@
  1 +<meta http-equiv="Page-Exit" content="BlendTrans(Duration:1.0)">
  2 +<link rev="stylesheet" rel="stylesheet" type="text/css" href="style1.css">
  3 +<?
  4 +include 'koneksi.php';
  5 +$user=$_POST['username'];
  6 +$md_username=md5($user);
  7 +
  8 +$pass=$_POST['password'];
  9 +$md_password=md5($pass);
  10 +
  11 +$name=$_POST['name'];
  12 +$sex=$_POST['sex'];
  13 +$tlp=$_POST['telp'];
  14 +$alamat=$_POST['alamat'];
  15 +$mail=$_POST['mail'];
  16 +$desc=$_POST['description'];
  17 +$tgl=$_POST['tglentry'];
  18 +$filename='';
  19 +
  20 +if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/pjpeg")
  21 + || ($_FILES["file"]["type"] == "image/jpg") || ($_FILES["file"]["type"] == "image/png"))
  22 + && ($_FILES["file"]["size"] < 1000000)){
  23 +
  24 + if ($_FILES["file"]["error"] > 0){
  25 + echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
  26 + } else {
  27 + $sqladmin=mysql_query("insert into admin (id, username, password, type) values('$md_username','$user', '$md_password', 'ANG')");
  28 + if($sqladmin){
  29 + $filename=$_FILES["file"]["name"];
  30 + $sqlanggota=mysql_query("insert into anggota values('','$md_username','$name', '$sex', '$tlp', '$alamat', '$mail', '$tgl', '$desc', '$filename')");
  31 + if($sqlanggota){
  32 + //echo "Upload: " . $_FILES["file"]["name"] . "<br />";
  33 + //echo "Type: " . $_FILES["file"]["type"] . "<br />";
  34 + //echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
  35 + //echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";
  36 +
  37 + if (file_exists("foto_profile/" . $_FILES["file"]["name"])){
  38 + //echo $_FILES["file"]["name"] . " already exists. ";
  39 + } else {
  40 + move_uploaded_file($_FILES["file"]["tmp_name"],"foto_profile/" . $_FILES["file"]["name"]);
  41 + //echo "Stored in: " . "foto_profile/" . $_FILES["file"]["name"];
  42 + //echo "<br>";
  43 + }
  44 + echo "Registrasi Berhasil";
  45 + }
  46 + } else
  47 + echo "username yang anda gunakan sudah dipakai";
  48 + }
  49 +}else{
  50 + echo "Invalid file";
  51 +}
  52 +
  53 +?>
128 formBuku.php
... ... @@ -0,0 +1,128 @@
  1 +<?
  2 + include 'koneksi.php';
  3 +
  4 + session_start();
  5 + $admin=$_GET['admin'];
  6 + if($admin!=''){
  7 + $select_admin=mysql_query("select * from admin where id = '$admin'");
  8 + $count=mysql_num_rows($select_admin);
  9 + if($count>0){
  10 + $row=mysql_fetch_array($select_admin);
  11 + if(session_is_registered($row[1]) && session_is_registered($row[2]) && $row[3]="ADM"){
  12 + $idBuku = $_GET['idBuku'];
  13 + $select_buku=mysql_query("select * from buku where isbn='$idBuku'");
  14 + $dtBuku=mysql_fetch_array($select_buku);
  15 + }else {
  16 + header('location:index.php?pg=notadmin');
  17 + }
  18 + } else {
  19 + header('location:index.php?pg=sessionFailed');
  20 + }
  21 + }
  22 +
  23 +
  24 +?>
  25 +<html>
  26 +<head>
  27 +<title>Form Buku</title>
  28 +</head>
  29 +<body>
  30 +
  31 +<table width="400" align="left" border="0" cellpadding="5" cellspacing="0" style="font-family:arial;color:black;font-size:12px;">
  32 +<form method="post" action="saveBuku.php" target="thetarget">
  33 +<tr valign="center">
  34 +<td align="left">ISBN</td>
  35 +<td align="center">:</td>
  36 +<td ><input type="text" name="isbn" maxlength="25" <? if(mysql_num_rows($select_buku)==1) echo "value=$dtBuku[0]";?>></td>
  37 +</tr>
  38 +
  39 +<tr valign="center">
  40 +<td align="left">JUDUL</td>
  41 +<td align="center">:</td>
  42 +<td ><input type="text" name="judul" value="<? if(mysql_num_rows($select_buku)==1) echo $dtBuku[1];?>"></td>
  43 +</tr>
  44 +
  45 +<tr valign="center">
  46 +<td align="left">TAHUN</td>
  47 +<td align="center">:</td>
  48 +<td ><input type="text" name="tahun" value="<? if(mysql_num_rows($select_buku)==1) echo $dtBuku[2];?>"></td>
  49 +</tr>
  50 +
  51 +<tr valign="center">
  52 +<td align="left">PENERBIT</td>
  53 +<td align="center">:</td>
  54 +<td >
  55 + <select name="penerbit">
  56 + <option value='' >--[pilih]--</option>
  57 + <?
  58 + $penerbit=mysql_query("select * from penerbit");
  59 + while($p=mysql_fetch_array($penerbit)){
  60 + if($p[0]==$dtBuku[3]){
  61 + $selected='selected=selected';
  62 + } else {
  63 + $selected='';
  64 + }
  65 + echo "<option value=$p[0] $selected>$p[1]</option>";
  66 + }
  67 + ?>
  68 + </select>
  69 +</td>
  70 +</tr>
  71 +
  72 +<tr valign="center">
  73 +<td align="left">PENGARANG</td>
  74 +<td align="center">:</td>
  75 +<td >
  76 + <select name="pengarang">
  77 + <option value='' >--[pilih]--</option>
  78 + <?
  79 + $pengarang=mysql_query("select * from pengarang");
  80 + while($w=mysql_fetch_array($pengarang)){
  81 + if($w[0]==$dtBuku[4]){
  82 + $selected='selected=selected';
  83 + } else {
  84 + $selected='';
  85 + }
  86 + echo "<option value=$w[0] $selected>$w[1]</option>";
  87 + }
  88 + ?>
  89 + </select>
  90 +</td>
  91 +</tr>
  92 +
  93 +<tr valign="center">
  94 +<td align="left">KATALOG</td>
  95 +<td align="center">:</td>
  96 +<td >
  97 + <select name="katalog">
  98 + <option value='' >--[pilih]--</option>
  99 + <?
  100 + $katalog=mysql_query("select * from katalog");
  101 + while($k=mysql_fetch_array($katalog)){
  102 + if($k[0]==$dtBuku[5]){
  103 + $selected='selected=selected';
  104 + } else {
  105 + $selected='';
  106 + }
  107 + echo "<option value=$k[0] $selected>$k[1]</option>";
  108 + }
  109 + ?>
  110 + </select>
  111 +</td>
  112 +</tr>
  113 +
  114 +<tr valign="top">
  115 +<td align="center" colspan="3">
  116 + <input type="submit" name="submit" value="submit">
  117 + <input type="reset" name="reset" value="reset">
  118 + <input type="hidden" name="admin" value=<? echo $admin;?>>
  119 +</td>
  120 +
  121 +</tr>
  122 +<tr>
  123 +<td colspan="3"><iframe width="100%" name="thetarget" height="100" frameborder="0" scrolling="auto"></iframe></td>
  124 +</tr>
  125 +</form>
  126 +
  127 +</body>
  128 +</html>
59 formKatalog.php
... ... @@ -0,0 +1,59 @@
  1 +<?
  2 + include 'koneksi.php';
  3 +
  4 + session_start();
  5 + $admin=$_GET['admin'];
  6 + if($admin!=''){
  7 + $select_admin=mysql_query("select * from admin where id = '$admin'");
  8 + $count=mysql_num_rows($select_admin);
  9 + if($count>0){
  10 + $row=mysql_fetch_array($select_admin);
  11 + if(session_is_registered($row[1]) && session_is_registered($row[2]) && $row[3]="ADM"){
  12 + $idKatalog = $_GET['idKatalog'];
  13 + $select_katalog=mysql_query("select * from katalog where id_katalog='$idKatalog'");
  14 + $dtKatalog=mysql_fetch_array($select_katalog);
  15 + }else {
  16 + header('location:index.php?pg=notadmin');
  17 + }
  18 + } else {
  19 + header('location:index.php?pg=sessionFailed');
  20 + }
  21 + }
  22 +
  23 +
  24 +?>
  25 +<html>
  26 +<head>
  27 +<title>Form Katalog</title>
  28 +</head>
  29 +<body>
  30 +
  31 +<table width="400" align="left" border="0" cellpadding="5" cellspacing="0" style="font-family:arial;color:black;font-size:12px;">
  32 +<form method="post" action="saveKatalog.php" target="thetarget">
  33 +<tr valign="center">
  34 +<td align="left">KODE</td>
  35 +<td align="center">:</td>
  36 +<td ><input type="text" name="kode" maxlength="3" <? if(mysql_num_rows($select_katalog)==1) echo "value=$dtKatalog[0]";?>></td>
  37 +</tr>
  38 +
  39 +<tr valign="center">
  40 +<td align="left">NAMA</td>
  41 +<td align="center">:</td>
  42 +<td ><input type="text" name="nama" value="<? if(mysql_num_rows($select_katalog)==1) echo $dtKatalog[1];?>"></td>
  43 +</tr>
  44 +
  45 +<tr valign="top">
  46 +<td align="center" colspan="3">
  47 + <input type="submit" name="submit" value="submit">
  48 + <input type="reset" name="reset" value="reset">
  49 + <input type="hidden" name="admin" value=<? echo $admin;?>>
  50 +</td>
  51 +
  52 +</tr>
  53 +<tr>
  54 +<td colspan="3"><iframe width="100%" name="thetarget" height="100" frameborder="0" scrolling="auto"></iframe></td>
  55 +</tr>
  56 +</form>
  57 +
  58 +</body>
  59 +</html>
113 formPeminjaman.php
... ... @@ -0,0 +1,113 @@
  1 +<?
  2 + include 'koneksi.php';
  3 +
  4 + session_start();
  5 + $admin=$_GET['admin'];
  6 +
  7 + if($admin!=''){
  8 + $select_admin=mysql_query("select * from admin where id = '$admin'");
  9 + $count=mysql_num_rows($select_admin);
  10 + if($count>0){
  11 + $row=mysql_fetch_array($select_admin);
  12 + if(session_is_registered($row[1]) && session_is_registered($row[2]) && $row[3]="ANG"){
  13 + $count = $_POST['txtCount'];
  14 + $count = $count + 1;
  15 + }else {
  16 + header('location:index.php?pg=notmember');
  17 + }
  18 + } else {
  19 + header('location:index.php?pg=sessionFailed');
  20 + }
  21 + }
  22 +
  23 +
  24 +?>
  25 +<html>
  26 +<head>
  27 +<title>Form Peminjaman</title>
  28 +</head>
  29 +<body>
  30 +
  31 +<table width="400" align="left" border="0" cellpadding="5" cellspacing="0" style="font-family:arial;color:black;font-size:12px;">
  32 +<tr valign="center">
  33 +<td align="left" colspan="3">
  34 + <form method="POST" action="" target="_self">
  35 + <input type="submit" value="add_detail" name="add" / >
  36 + <input type="hidden" value="<? echo $admin;?>" name="admin" / >
  37 + <input type="hidden" value="<? echo $count;?>" name="txtCount" / >
  38 + </form>
  39 +</td>
  40 +</tr>
  41 +<form method="post" action="savePeminjaman.php" target="thetarget">
  42 +<tr valign="center">
  43 +<td align="left" width="80">ANGGOTA</td>
  44 +<td align="center">:</td>
  45 +<?
  46 + $Qanggota=mysql_query("select * from anggota where id_admin='$admin'");
  47 + $anggota = mysql_fetch_array($Qanggota);
  48 +?>
  49 +
  50 +<td >
  51 + <? echo $anggota[2];?><input type="hidden" name="id_anggota" value="<? echo $anggota[0];?>">
  52 +</td>
  53 +</tr>
  54 +
  55 +<?
  56 + $tglPinjam = date("Y-m-d");
  57 + $config = mysql_query("select * from config");
  58 + $dtConfig = mysql_fetch_array($config);
  59 +
  60 + $dateMax = mktime(0,0,0, date("m"), date("d")+$dtConfig[1], date("Y"));
  61 + $tglKembali = date("Y-m-d", $dateMax);
  62 +?>
  63 +
  64 +<tr valign="center">
  65 +<td align="left" width="80">TGL PINJAM</td>
  66 +<td align="center">:</td>
  67 +<td ><input type="hidden" name="tglPinjam" value="<? echo $tglPinjam; ?>"><? echo $tglPinjam; ?></td>
  68 +</tr>
  69 +
  70 +<tr valign="center">
  71 +<td align="left" width="80">TGL KEMBALI</td>
  72 +<td align="center">:</td>
  73 +<td ><input type="hidden" name="tglKembali" value="<? echo $tglKembali;?>"><? echo $tglKembali;?></td>
  74 +</tr>
  75 +
  76 +<tr valign="center">
  77 +<td align="left" colspan="3">
  78 + <table align="left" border="1" cellpadding="2" cellspacing="0" style="font-family:arial;color:black;font-size:12px;">
  79 + <?
  80 + for($i=0;$i<$count;$i++){
  81 + echo "<tr><td>";
  82 + echo "<select name=isbn$i >";
  83 + $buku=mysql_query("select * from buku");
  84 + while($w=mysql_fetch_array($buku)){
  85 + echo "<option value=$w[0]>$w[1]</option>";
  86 + }
  87 + echo "</select>";
  88 + echo "</td><td width=20>";
  89 + echo "<input type=hidden value=1 name=jml$i />1";
  90 + echo "</td></tr>";
  91 + }
  92 + ?>
  93 + </table>
  94 +</td>
  95 +</tr>
  96 +
  97 +
  98 +<tr valign="top">
  99 +<td align="center" colspan="3">
  100 + <input type="submit" name="submit" value="submit">
  101 + <input type="reset" name="reset" value="reset">
  102 + <input type="hidden" name="admin" value=<? echo $admin;?>>
  103 + <input type="hidden" name="count" value=<? echo $count;?>>
  104 +</td>
  105 +
  106 +</tr>
  107 +<tr>
  108 +<td colspan="3"><iframe width="100%" name="thetarget" height="100" frameborder="0" scrolling="auto"></iframe></td>
  109 +</tr>
  110 +</form>
  111 +
  112 +</body>
  113 +</html>
77 formPenerbit.php
... ... @@ -0,0 +1,77 @@
  1 +<?
  2 + include 'koneksi.php';
  3 +
  4 + session_start();
  5 + $admin=$_GET['admin'];
  6 + if($admin!=''){
  7 + $select_admin=mysql_query("select * from admin where id = '$admin'");
  8 + $count=mysql_num_rows($select_admin);
  9 + if($count>0){
  10 + $row=mysql_fetch_array($select_admin);
  11 + if(session_is_registered($row[1]) && session_is_registered($row[2]) && $row[3]="ADM"){
  12 + $idPenerbit = $_GET['idPenerbit'];
  13 + $select_penerbit=mysql_query("select * from penerbit where id_penerbit='$idPenerbit'");
  14 + $dtPenerbit=mysql_fetch_array($select_penerbit);
  15 + }else {
  16 + header('location:index.php?pg=notadmin');
  17 + }
  18 + } else {
  19 + header('location:index.php?pg=sessionFailed');
  20 + }
  21 + }
  22 +
  23 +
  24 +?>
  25 +<html>
  26 +<head>
  27 +<title>Form Penerbit</title>
  28 +</head>
  29 +<body>
  30 +
  31 +<table width="400" align="left" border="0" cellpadding="5" cellspacing="0" style="font-family:arial;color:black;font-size:12px;">
  32 +<form method="post" action="savePenerbit.php" target="thetarget">
  33 +<tr valign="center">
  34 +<td align="left">KODE</td>
  35 +<td align="center">:</td>
  36 +<td ><input type="text" name="kode" maxlength="8" <? if(mysql_num_rows($select_penerbit)==1) echo "value=$dtPenerbit[0]";?>></td>
  37 +</tr>
  38 +
  39 +<tr valign="center">
  40 +<td align="left">NAMA</td>
  41 +<td align="center">:</td>
  42 +<td ><input type="text" name="nama" value="<? if(mysql_num_rows($select_penerbit)==1) echo $dtPenerbit[1];?>"></td>
  43 +</tr>
  44 +
  45 +<tr valign="center">
  46 +<td align="left">ALAMAT</td>
  47 +<td align="center">:</td>
  48 +<td ><input type="text" name="address" value="<? if(mysql_num_rows($select_penerbit)==1) echo $dtPenerbit[4];?>"></td>
  49 +</tr>
  50 +
  51 +<tr valign="center">
  52 +<td align="left">EMAIL</td>
  53 +<td align="center">:</td>
  54 +<td ><input type="text" name="email" value="<? if(mysql_num_rows($select_penerbit)==1) echo $dtPenerbit[2];?>"></td>
  55 +</tr>
  56 +
  57 +<tr valign="center">
  58 +<td align="left">TELEPON</td>
  59 +<td align="center">:</td>
  60 +<td ><input type="text" name="telp" value="<? if(mysql_num_rows($select_penerbit)==1) echo $dtPenerbit[3];?>"></td>
  61 +</tr>
  62 +
  63 +<tr valign="top">
  64 +<td align="center" colspan="3">
  65 + <input type="submit" name="submit" value="submit">
  66 + <input type="reset" name="reset" value="reset">
  67 + <input type="hidden" name="admin" value=<? echo $admin;?>>
  68 +</td>
  69 +
  70 +</tr>
  71 +<tr>
  72 +<td colspan="3"><iframe width="100%" name="thetarget" height="100" frameborder="0" scrolling="auto"></iframe></td>
  73 +</tr>
  74 +</form>
  75 +
  76 +</body>
  77 +</html>
77 formPengarang.php
... ... @@ -0,0 +1,77 @@
  1 +<?
  2 + include 'koneksi.php';
  3 +
  4 + session_start();
  5 + $admin=$_GET['admin'];
  6 + if($admin!=''){
  7 + $select_admin=mysql_query("select * from admin where id = '$admin'");
  8 + $count=mysql_num_rows($select_admin);
  9 + if($count>0){
  10 + $row=mysql_fetch_array($select_admin);
  11 + if(session_is_registered($row[1]) && session_is_registered($row[2]) && $row[3]="ADM"){
  12 + $idPengarang = $_GET['idPengarang'];
  13 + $select_pengarang=mysql_query("select * from pengarang where id_pengarang='$idPengarang'");
  14 + $dtPengarang=mysql_fetch_array($select_pengarang);
  15 + }else {
  16 + header('location:index.php?pg=notadmin');
  17 + }
  18 + } else {
  19 + header('location:index.php?pg=sessionFailed');
  20 + }
  21 + }
  22 +
  23 +
  24 +?>
  25 +<html>
  26 +<head>
  27 +<title>Form Pengarang</title>
  28 +</head>
  29 +<body>
  30 +
  31 +<table width="550" align="left" border="0" cellpadding="5" cellspacing="0" style="font-family:arial;color:black;font-size:12px;">
  32 +<form method="post" action="savePengarang.php" target="thetarget">
  33 +<tr valign="center">
  34 +<td align="left">KODE</td>
  35 +<td align="center">:</td>
  36 +<td ><input type="text" name="kode" maxlength="8" <? if(mysql_num_rows($select_pengarang)==1) echo "value=$dtPengarang[0]";?>></td>
  37 +</tr>
  38 +
  39 +<tr valign="center">
  40 +<td align="left">NAMA</td>
  41 +<td align="center">:</td>
  42 +<td ><input type="text" name="nama" value="<? if(mysql_num_rows($select_pengarang)==1) echo $dtPengarang[1];?>"></td>
  43 +</tr>
  44 +
  45 +<tr valign="center">
  46 +<td align="left">ALAMAT</td>
  47 +<td align="center">:</td>
  48 +<td ><input type="text" name="address" value="<? if(mysql_num_rows($select_pengarang)==1) echo $dtPengarang[4];?>"></td>
  49 +</tr>
  50 +
  51 +<tr valign="center">
  52 +<td align="left">EMAIL</td>
  53 +<td align="center">:</td>
  54 +<td ><input type="text" name="email" value="<? if(mysql_num_rows($select_pengarang)==1) echo $dtPengarang[2];?>"></td>
  55 +</tr>
  56 +
  57 +<tr valign="center">
  58 +<td align="left">TELEPON</td>
  59 +<td align="center">:</td>
  60 +<td ><input type="text" name="telp" value="<? if(mysql_num_rows($select_pengarang)==1) echo $dtPengarang[3];?>"></td>
  61 +</tr>
  62 +
  63 +<tr valign="top">
  64 +<td align="center" colspan="3">
  65 + <input type="submit" name="submit" value="submit">
  66 + <input type="reset" name="reset" value="reset">
  67 + <input type="hidden" name="admin" value=<? echo $admin;?>>
  68 +</td>
  69 +
  70 +</tr>
  71 +<tr>
  72 +<td colspan="3"><iframe width="100%" name="thetarget" height="100" frameborder="0" scrolling="auto"></iframe></td>
  73 +</tr>
  74 +</form>
  75 +
  76 +</body>
  77 +</html>
81 formPengembalian.php
... ... @@ -0,0 +1,81 @@
  1 +<?
  2 + include 'koneksi.php';
  3 +
  4 + session_start();
  5 + $admin=$_GET['admin'];
  6 + if($admin!=''){
  7 + $select_admin=mysql_query("select * from admin where id = '$admin'");
  8 + $count=mysql_num_rows($select_admin);
  9 + if($count>0){
  10 + $row=mysql_fetch_array($select_admin);
  11 + if(session_is_registered($row[1]) && session_is_registered($row[2]) && $row[3]="ANG"){
  12 + $idPinjam = $_GET['idPinjam'];
  13 + list($y, $m, $d) = explode("-", $_GET['tglKembali']);
  14 + $tglKembaliSeharusnya = mktime(0,0,0, $m, $d, $y);
  15 + $timeKembaliSebenarnya = mktime(0,0,0, date("m"), date("d"), date("Y") );
  16 + $tglKembaliSebenarnya = date("Y-m-d");
  17 +
  18 + //untuk menghitung denda hitung dulu telat harinya
  19 + //kalau lebih dari 0 kalikan dengan nilai denda yang ada di table config
  20 + $selectConfig = mysql_query("select dendaPerHari from config");
  21 + $value = mysql_fetch_array($selectConfig);
  22 + $denda = 0;
  23 + $telat = 0;
  24 + if($timeKembaliSebenarnya > $tglKembaliSeharusnya){
  25 + $telat = round(abs($timeKembaliSebenarnya - $tglKembaliSeharusnya) / 86400);
  26 + }
  27 + $denda = $value[0] * $telat;
  28 + }else {
  29 + header('location:index.php?pg=notadmin');
  30 + }
  31 + } else {
  32 + header('location:index.php?pg=sessionFailed');
  33 + }
  34 + }
  35 +
  36 +
  37 +?>
  38 +<html>
  39 +<head>
  40 +<title>Form Pengembalian</title>
  41 +</head>
  42 +<body>
  43 +
  44 +<table width="550" align="left" border="0" cellpadding="5" cellspacing="0" style="font-family:arial;color:black;font-size:12px;">
  45 +<form method="post" action="savePengembalian.php" target="thetarget">
  46 +<tr valign="center">
  47 +<td align="left" width="80">ID PINJAM</td>