diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 0000000..560b6c2 --- /dev/null +++ b/INSTALL.md @@ -0,0 +1,5 @@ +Install +- Buat database dengan nama "ruserba" +- import database pada folder "db" +- Taruh isi src di dalam server. +- Jalankan \ No newline at end of file diff --git a/MEMBER.md b/MEMBER.md new file mode 100644 index 0000000..f47e016 --- /dev/null +++ b/MEMBER.md @@ -0,0 +1,4 @@ +NIM NAMA MAIL GITHUB_ID +13510004 Ahmad Fauzan azon04@gmail.com azon04 +13510046 Dimas Angga dimas11@rocketmail.com dimas-angga +13510045 Zulhendra Valiant taeruza_zuga1@yahoo.com zugarijaru \ No newline at end of file diff --git a/README.md b/README.md index 3bae8f5..10c7da9 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Rule dan Konvensi: - Setiap peserta harus menggunakan akun pribadi, dan bukan shared-account, pada setiap kegiatan/hubungan dengan github - Proyek yang dikumpulkan harus memuat file berikut: - INSTALL.md - berisi how-to untuk proses peng-install-an dari aplikasi -- MEMEBER.md - berisi NIM NAMA MAIL GITHUB_ID dari anggota grup ini +- MEMBER.md - berisi NIM NAMA MAIL GITHUB_ID dari anggota grup ini - src/ - berisi semua kode sumber dari aplikasi yang akan anda kumplukan - docs/ - berisi dokumentasi dari aplikasi, jika diperlukan - db/ - berisi file sql hasil dump diff --git a/db/progin_13510004.sql b/db/progin_13510004.sql new file mode 100644 index 0000000..df67af1 --- /dev/null +++ b/db/progin_13510004.sql @@ -0,0 +1,187 @@ +-- phpMyAdmin SQL Dump +-- version 3.2.4 +-- http://www.phpmyadmin.net +-- +-- Host: localhost +-- Generation Time: Oct 29, 2013 at 08:48 PM +-- Server version: 5.1.41 +-- PHP Version: 5.3.1 + +SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; + +-- +-- Database: `ruserba` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `barang` +-- + +CREATE TABLE IF NOT EXISTS `barang` ( + `id_barang` varchar(10) NOT NULL, + `nama_barang` text NOT NULL, + `url_gambar` text NOT NULL, + `harga` double DEFAULT '0', + `url_link` text NOT NULL, + `detail` text NOT NULL, + `stok` int(5) DEFAULT '0', + `kategori` int(11) NOT NULL, + `jumlah_jual` int(10) NOT NULL, + PRIMARY KEY (`id_barang`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `barang` +-- + +INSERT INTO `barang` (`id_barang`, `nama_barang`, `url_gambar`, `harga`, `url_link`, `detail`, `stok`, `kategori`, `jumlah_jual`) VALUES +('BRG001', 'Beras', 'img/items/beras.jpg,img/items/beras_1.jpg,img/items/beras_2.jpg', 9000, '', 'Beras adalah bagian bulir padi (gabah) yang telah dipisah dari sekam. Sekam (Jawa merang) secara anatomi disebut ''palea'' (bagian yang ditutupi) dan ''lemma'' (bagian yang menutupi).', 10, 0, 0), +('BRG002', 'Daging', 'img/items/daging.jpg', 20000, '', 'Daging ialah bagian lunak pada hewan yang terbungkus kulit dan melekat pada tulang yang menjadi bahan makanan. Daging tersusun sebagian besar dari jaringan otot, ditambah dengan lemak yang melekat padanya, urat, serta tulang rawan.', 10, 0, 0), +('BRG003', 'Telur', 'img/items/telur.jpg', 1000, '', 'Dalam kebanyakan burung dan reptilia, telur adalah zigot yang dihasilkan melalui fertilisasi sel telur dan berfungsi memelihara dan menjaga embrio. Telur-telur reptilia dan burung diselimuti kerak pelindung, yang memiliki lubang yang sangat kecil agar hewan yang belum lahir tersebut dapat bernapas.', 100, 0, 0), +('BRG004', 'Aqua', 'img/items/aqua.jpg', 2000, '', 'Aqua adalah sebuah merek air minum dalam kemasan (AMDK) yang diproduksi oleh PT Golden Mississippi Tbk di Indonesia sejak tahun 1973. Selain di Indonesia, Aqua juga dijual di Malaysia, Singapura, dan Brunei. Aqua adalah merek AMDK dengan penjualan terbesar di Indonesia dan merupakan salah satu merek AMDK yang paling terkenal di Indonesia, sehingga telah menjadi seperti merek generik untuk AMDK', 200, 1, 0), +('BRG005', 'Sirup', 'img/items/sirup.jpg', 10000, '', 'Sirup (dari Bahasa Arab ???? sharab, minuman) adalah cairan yang kental dan memiliki kadar gula terlarut yang tinggi, namun hampir tidak memiliki kecenderungan untuk mengendapkan kristal.', 200, 1, 0), +('BRG006', 'Bir', 'img/items/bir.jpg', 50000, '', 'Bir adalah segala minuman beralkohol yang diproduksi melalui proses fermentasi bahan berpati tanpa melalui proses penyulingan setelah fermentasi. Bir merupakan minuman beralkohol yang paling banyak dikonsumsi di dunia', 20, 1, 0), +('BRG007', 'Bolpoin', 'img/items/pen.jpg', 2000, '', 'Pena (bahasa Inggris: pen) adalah alat tulis yang menggunakan tinta. Ada berbagai warna tinta pen, yang paling umum adalah biru, hitam, dan merah. Ada berbagai macam pena, di antaranya pulpen, pena bulu, dan spidol.', 200, 2, 0), +('BRG008', 'Kertas', 'img/items/paper.jpg', 500, '', 'Kertas adalah bahan yang tipis dan rata, yang dihasilkan dengan kompresi serat yang berasal dari pulp. Serat yang digunakan biasanya adalah alami, dan mengandung selulosa dan hemiselulosa.', 1000, 2, 0), +('BRG009', 'Penggaris', 'img/items/ruler.jpg', 1000, '', 'Penggaris adalah sebuah alat pengukur dan alat bantu gambar untuk menggambar garis lurus. Terdapat berbagai macam penggaris, dari mulai yang lurus sampai yang berbentuk segitiga (biasanya segitiga siku-siku sama kaki dan segitiga siku-siku 30°–60°). Penggaris dapat terbuat dari plastik, logam, berbentuk pita dan sebagainya. Juga terdapat penggaris yang dapat dilipat.', 200, 2, 0), +('BRG010', 'Sapu', 'img/items/sapu.jpg', 5000, '', 'Sapu adalah salah satu alat pembersih yang terdiri dari bagian serat atau serabut kaku dan biasanya terpasang atau terikat kepada suatu pegangan silindris.', 3, 3, 0), +('BRG011', 'Serokan', 'img/items/serokan.jpg', 20000, '', 'Hanya sebuah serokan', 10, 3, 0), +('BRG012', 'Kemoceng', 'img/items/kemoceng.jpg', 10000, '', 'Kemoceng adalah salah satu alat pembersih yang terdiri dari bagian bulu-bulu dan biasanya terpasang atau terikat menjadi satu bagian bulat.', 5, 3, 0), +('BRG013', 'Obat flu : Mixagrip', 'img/items/obatflu.jpg', 1000, '', 'MIXAGRIP merupakan obat flu yang dapat menghilangkan gejala-gejala pada penyakit flu, influenza, dan rhinitis alergi seperti demam, sakit kepala, hidung tersumbat, dan bersin-bersin.', 100, 4, 0), +('BRG014', 'Kondom Sutra', 'img/items/kondom.jpg', 5000, '', 'Dirancang dengan teknologi super-tipis, kondom Sutra OK memberikan Anda pengalaman sentuhan langsung yang alami. Supaya lebih nikmat, tambahkan dua tetes Sutra Lubricant yang berbahan dasar air dibagian dalam kondom. \r\n\r\nKondom Sutra OK 100% lulus uji elektronis dan diproduksi sesuai dengan standar mutu international (ISO 4074) yang paling tinggi demi keamanan dan kenikmatan puncak. Bila digunakan secara benar, kondom akan mencegah kehamilan dan infeksi menular seksual, termasuk HIV/AIDS. ', 100, 4, 0), +('BRG015', 'Obat nyamuk Baygon', 'img/items/baygon.jpg', 15000, '', 'Baygon adalah merek pestisida produksi S. C. Johnson & Son. Kegunaannya adalah sebagai pembasmi dan pengendali hama rumah tangga, seperti nyamuk, kecoa, lipan, dan semut. Merek ini sangat populer di Indonesia sehingga sudah menjadi nama generik bagi produk sejenis.', 10, 4, 0); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `card` +-- + +CREATE TABLE IF NOT EXISTS `card` ( + `username` varchar(15) NOT NULL, + `field_card_num` varchar(10) NOT NULL, + `card_name` text NOT NULL, + `exdate` date NOT NULL, + PRIMARY KEY (`field_card_num`), + UNIQUE KEY `username` (`username`), + UNIQUE KEY `field_card_num_2` (`field_card_num`), + KEY `field_card_num` (`field_card_num`), + KEY `field_card_num_3` (`field_card_num`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `card` +-- + + +-- -------------------------------------------------------- + +-- +-- Table structure for table `cart` +-- + +CREATE TABLE IF NOT EXISTS `cart` ( + `id_cart` int(10) NOT NULL AUTO_INCREMENT, + `username` varchar(15) NOT NULL, + `id_barang` varchar(10) NOT NULL, + `jumlah` int(5) NOT NULL, + `permintaan` text NOT NULL, + `paid` int(1) NOT NULL, + PRIMARY KEY (`id_cart`), + KEY `username` (`username`), + KEY `id_barang` (`id_barang`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; + +-- +-- Dumping data for table `cart` +-- + +INSERT INTO `cart` (`id_cart`, `username`, `id_barang`, `jumlah`, `permintaan`, `paid`) VALUES +(1, 'azon04', 'BRG014', 2, '', 0), +(2, 'azon04', 'BRG014', 2, '', 0), +(3, 'azon04', 'BRG014', 1, '', 0), +(4, 'azon04', 'BRG014', 1, '', 0), +(5, 'azon04', 'BRG003', 5, '', 0), +(6, 'azon04', 'BRG002', 1, 'Dagingnya di giles', 0); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `login_cache` +-- + +CREATE TABLE IF NOT EXISTS `login_cache` ( + `key` varchar(42) NOT NULL, + `username` varchar(15) NOT NULL, + `expdate` datetime NOT NULL, + PRIMARY KEY (`key`), + KEY `username` (`username`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `login_cache` +-- + +INSERT INTO `login_cache` (`key`, `username`, `expdate`) VALUES +('e418ddc0bdf58306bc36e801dbc27d62d7670768', 'azon04', '2013-11-28 13:03:59'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `user` +-- + +CREATE TABLE IF NOT EXISTS `user` ( + `username` varchar(15) NOT NULL, + `password` varchar(40) NOT NULL, + `nama_lengkap` text NOT NULL, + `email` varchar(30) NOT NULL, + `jumlah_transaksi` int(10) DEFAULT '0', + `alamat` text, + `provinsi` text, + `kota` text, + `kodepos` varchar(10) DEFAULT '', + `nohp` varchar(12) DEFAULT '', + PRIMARY KEY (`username`), + UNIQUE KEY `email` (`email`), + UNIQUE KEY `username_2` (`username`), + KEY `username` (`username`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `user` +-- + +INSERT INTO `user` (`username`, `password`, `nama_lengkap`, `email`, `jumlah_transaksi`, `alamat`, `provinsi`, `kota`, `kodepos`, `nohp`) VALUES +('azon04', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Ahmad Fauzan', 'azon04@gmail.com', 0, 'Jl. Pelesiran 61 Bandung', 'Jawa Barat', 'Bandung', '40116', '081996892112'), +('azon041', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'Ahmad Fauzan', 'azon041@gmail.com', 0, 'p', 'p', '1111', '', '1'), +('fauzan04', 'a7d9d974e0e60524f1d89bbf49bfe8eed51bc2d7', 'Ahmad Fauzan', 'ahmad.fauzan@gmail.com', 0, 'Pelesiran', 'Jawa Barat', 'Bandung', '40116', '0819'); + +-- +-- Constraints for dumped tables +-- + +-- +-- Constraints for table `card` +-- +ALTER TABLE `card` + ADD CONSTRAINT `card_ibfk_1` FOREIGN KEY (`username`) REFERENCES `user` (`username`); + +-- +-- Constraints for table `cart` +-- +ALTER TABLE `cart` + ADD CONSTRAINT `cart_ibfk_1` FOREIGN KEY (`username`) REFERENCES `user` (`username`), + ADD CONSTRAINT `cart_ibfk_2` FOREIGN KEY (`id_barang`) REFERENCES `barang` (`id_barang`); + +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/doc/List Kategori.txt b/doc/List Kategori.txt new file mode 100644 index 0000000..844e16e --- /dev/null +++ b/doc/List Kategori.txt @@ -0,0 +1,6 @@ +Kategori : +Makanan +Minuman +Alat Tulis +Alat Kebersihan +Obat-obatan diff --git a/src/alattulis.php b/src/alattulis.php new file mode 100644 index 0000000..44e404b --- /dev/null +++ b/src/alattulis.php @@ -0,0 +1,65 @@ + + + + RuSerBa + + + + + + +
+

Alat Tulis

+
+ +
+ +

Mekanisme Belanja

+
+

Mekanisme pembelian di RuSerBa : +

    +
  1. Login sebagai pengguna. Jika belum punya akun silahkan register.
  2. +
  3. Pilih barang-barang yang akan dibeli. Barang akan masuk ke shopping bag.
  4. +
  5. Masuk ke shopping bag, klik tombol beli.
  6. +
  7. Masukan data kartu kredit anda.
  8. +
  9. Barang anda akan dikirim ke alamat anda.
  10. +

+

+
+ + \ No newline at end of file diff --git a/src/barang.php b/src/barang.php new file mode 100644 index 0000000..7c9d9a2 --- /dev/null +++ b/src/barang.php @@ -0,0 +1,143 @@ + + + + RuSerBa + + + + + + +
+

Makanan

+
+ +
+

Minuman

+
+ +
+

Alat Tulis

+
+ +
+

Kebersihan

+
+ +
+

Obat

+
+ +
+

Mekanisme Belanja

+
+

Lorem Insum Dolor Sit Amer.Lorem Insum Dolor Sit Amer.Lorem Insum Dolor Sit Amer.Lorem Insum Dolor Sit Amer. + Lorem Insum Dolor Sit Amer.Lorem Insum Dolor Sit Amer.Lorem Insum Dolor Sit Amer. + Lorem Insum Dolor Sit Amer.Lorem Insum Dolor Sit Amer. + Lorem Insum Dolor Sit Amer.Lorem Insum Dolor Sit Amer.

+

+
+ + \ No newline at end of file diff --git a/src/css/style.css b/src/css/style.css new file mode 100644 index 0000000..29f0ce1 --- /dev/null +++ b/src/css/style.css @@ -0,0 +1,372 @@ +body,h3 +{ + margin:0; + padding:0; + border:0; + outline:0; + vertical-align:baseline; + background:transparent; +} + +#header +{ + color : white; + background-color:#dddddd; + font-family:"Arial"; + width:100%; + height:45px; + box-shadow: 0px 5px 5px #888888; +} + +#navigation +{ + margin-left:15px; + margin-right:5px; +} + +#navCategory +{ + float:left; + height:45px; + margin : 0px; + padding : 0px; +} + +#search +{ + float:right; + height:45px; + line-height: 45px; +} + +#navMember +{ + float:right; + margin-left : 5px; + margin-right : 5px; + height : 45px; + line-height: 45px; +} + +#logo +{ + float:left; +} + +#welcome +{ + color:#000000; + background-color : #bbbbbb; + height : 45px; + line-height : 45px; + display:inline-block; + padding-left:5px; + padding-right:5px; +} + +.header_item +{ + height:45px; + line-height: 45px; + vertical-align:middle; + display:inline-block; + padding-left:5px; + padding-right:5px; + text-decoration: none; + color: #111111; + border-right:1px solid #999999; + margin:0px; +} + +.header_item:hover +{ + background-color:#bbbbbb; + height:45px; + line-height: 45px; + vertical-align:middle; + display:inline-block; + padding-left:5px; + padding-right:5px; + text-decoration: none; + margin:0px; +} + +.button +{ + height:25px; + line-height: 25px; + vertical-align:middle; + display:inline-block; + padding-left:5px; + padding-right:5px; + text-decoration: none; + color: #111111; + border:1px solid #777777; + margin:0px; + border-radius:5px; + box-shadow: 1px 1px 1px #888888; + background-color: #eeeeee; + margin-right : 5px; +} + +.button:active +{ + height:25px; + line-height: 25px; + vertical-align:middle; + display:inline-block; + padding-left:5px; + padding-right:5px; + text-decoration: none; + color: #111111; + border:1px solid #777777; + margin:0px; + border-radius:5px; + box-shadow: -1px -1px 1px #888888; + background-color: #dddddd; + margin-right : 5px; +} + +.text_input +{ + border-radius:10px; + height: 25px; + padding-left:5px; + padding-right:5px; + margin : 5px; +} + +#login +{ + position : relative; + float : right; + right : 100px; + top : 100px; + top : 5px; + padding : 10px; + border-radius:5px; + background-color:#efefef; + box-shadow: 1px 1px 1px #888888; + border:1px solid #777777; + visibility : hidden; +} + +#content_body +{ + width : 75%; + margin-left : auto; + margin-right : auto; + margin-top : 50px; + margin-bottom : 50px; + padding : 25 px; + border:1px solid #777777; + box-shadow: -1px -1px 5px #888888; + font-family:Arial, Helvetica, sans-serif; +} + +#content_body h3 +{ + position:relative; + width : 25%; + background-color : #0077fd; + padding : 5px; + left : -25px; + margin : 10px; + font-family:Arial, Helvetica, sans-serif; +} + +.horizontal_list +{ + width : 80%; + height : 30%; + margin-left : auto; + margin-right : auto; + text-align : center; +} + +.horizontal_list li +{ + display : inline; + list-style-type : none; + + margin-right : 1%; +} + +.content_item +{ + padding : 10px; +} + +#detail_barang +{ + padding : 10px; +} + + +#detail_barang .desc +{ + width : 100%; + margin : 10px; +} + +#detail_barang h4 +{ + width : 20%; + padding : 5px; +} + +#detail_barang label +{ + margin : 10px; + font-size : 20px; +} + +#detail_barang .textbox +{ + height: 10%; + width : 50%; + margin : 10px; +} + +#detail_barang .quantity +{ + width : 10%; + margin : 10px; +} + +#detail_barang .button +{ + width : 10%; + margin : 10px; + margin : 10px; +} + +.barang +{ + width:30%; + height:100%; + float:left; + border-radius:5px; + box-shadow: 1px 1px 1px #888888; + border:1px solid #777777; + margin : 0.5%; + padding : 0.5%; + text-align:center; +} + +.barang img +{ + height:75%; + max-width : 100%; + margin-left:auto; + margin-right:auto; +} + + +.barang a +{ + text-decoration : none; +} + +.barang h4 { + margin : 0; + padding : 0; +} + +.barang:hover +{ + box-shadow: -1px -1px 5px #888888; +} + +#alert +{ + color : red; + font-size : 20px; +} + +#hargaSatuan +{ + color : blue; +} + +#totalHarga +{ + color : blue; +} + +#alert_login +{ + color : red; +} + +#searchBox +{ + height : 10%; +} + +#searchBox .input_harga +{ + +} + +#paginasi .horizontal_list +{ + height : auto; +} + +.search_item_result +{ + margin:auto; + width : 70%; +} + +.search_item_result img +{ + height : 10%; +} + +.search_item_result h4 +{ + padding:0; + margin:0; +} + +.search_item_result p +{ + padding:0; + margin:0; + color : #333333; +} + +.search_item_result a +{ + text-decoration:none; +} + +#paginasi a +{ + text-decoration : none; +} + +#registerform +{ + width : 75%; + margin-top: 5%; + margin-bottom: 5%; + margin-left : auto; + margin-right : auto; + vertical-align:text-top; +} + +#registerform label +{ + display: inline-block; + width : 150px; + margin-bottom : 10px; +} + +textarea +{ + vertical-align:text-top; +} + diff --git a/src/detail.php b/src/detail.php new file mode 100644 index 0000000..c5151f8 --- /dev/null +++ b/src/detail.php @@ -0,0 +1,116 @@ + + + + RuSerBa + + + + + 0) { + $query = "INSERT INTO cart (username,id_barang,jumlah,permintaan) + VALUES ('$username','$barang',$jumlah,'$permintaan')"; + $res = mysql_query($query,$link); + + if($res == null) { + //echo '
Pembelian Gagal
'; + } else { + //echo '
Barang berhasil masuk Cart
'; + } + } else { + //echo '
Barang tidak boleh kurang dari sama dengan 0
'; + } + } + + $id = $_GET['id']; + $query = "SELECT * FROM barang WHERE id_barang='$id'"; + + $result = mysql_query($query, $link); + $barang = mysql_fetch_array($result); + + + ?> + + + +
+ '.$barang['nama_barang'].''; + ?> +
+
+
    + "; + echo ''; + echo ""; + $i++; + } + ?> +
+
+
+ +
+
+ + + +
+ +
+
+ + + +
+ +
+ +
+ +
+
+
+ + \ No newline at end of file diff --git a/src/formkredit.php b/src/formkredit.php new file mode 100644 index 0000000..338e289 --- /dev/null +++ b/src/formkredit.php @@ -0,0 +1,67 @@ + diff --git a/src/formprofil.js b/src/formprofil.js new file mode 100644 index 0000000..4ec7a72 --- /dev/null +++ b/src/formprofil.js @@ -0,0 +1,136 @@ +/** + * @author Dimas + */ + + +function validusername(username) +{ + console.log(username); + var xmlhttp; + if (username.length==0) + { + document.getElementById("validHint").innerHTML=""; + return true; + } else if (username.length<5){ + document.getElementById("validHint").innerHTML="username must be 5 char in minimum"; + return true; + } + if (window.XMLHttpRequest) + {// code for IE7+, Firefox, Chrome, Opera, Safari + xmlhttp=new XMLHttpRequest(); + } + else + {// code for IE6, IE5 + xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); + } + xmlhttp.open("GET","validate.php?username="+username,false); + xmlhttp.send(); + console.log(xmlhttp.responseText); + var data = JSON.parse(xmlhttp.responseText); + document.getElementById("validHint").innerHTML=data.response; + if(data.result == "true") { + return true; + } else { + return false; + } +} + +function valid_password(password) +{ + var xmlhttp; + if (password.length==0) + { + document.getElementById("validPaswordHint").innerHTML=""; + return true; + } else if (password.length < 8 ) { + document.getElementById("validPaswordHint").innerHTML="Password must be 8 chars minimum"; + return false; + } else { + document.getElementById("validPaswordHint").innerHTML="Password OK"; + return true; + } +} + +function valid_email(email) +{ + var xmlhttp; + var password = document.forms["register"]["password"].value; + if (email.length==0) + { + document.getElementById("validEmailHint").innerHTML=""; + return true; + } else if(password == email) { + document.getElementById("validEmailHint").innerHTML="tidak boleh sama dengan password"; + return false; + } + if (window.XMLHttpRequest) + {// code for IE7+, Firefox, Chrome, Opera, Safari + xmlhttp=new XMLHttpRequest(); + } + else + {// code for IE6, IE5 + xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); + } + + xmlhttp.open("GET","validate.php?email="+email,false); + xmlhttp.send(); + console.log(xmlhttp.responseText); + var data = JSON.parse(xmlhttp.responseText); + document.getElementById("validEmailHint").innerHTML=data.response; + if(data.result == "true") { + return true; + } else { + return false; + } +} + +function valid_confirmpassword(confirmpassword) +{ + var xmlhttp; + var password = document.forms["register"]["password"].value; + if (confirmpassword.length==0) + { + document.getElementById("validConfirmPasswordHint").innerHTML=""; + return true; + } + else if(confirmpassword == password) { + document.getElementById("validConfirmPasswordHint").innerHTML="Password's confirmed"; + return true; + } else { + document.getElementById("validConfirmPasswordHint").innerHTML="Password not same"; + return false; + } +} + +function valid_fullname(fullname) +{ + var regex = /^[a-z]+\s[a-z ]+$/i; + + if(fullname.length == 0) { + document.getElementById("validNameHint").innerHTML= ""; + return true; + } else if (regex.test(fullname)) { + document.getElementById("validNameHint").innerHTML= "Full name valid"; + return true; + } + else { + document.getElementById("validNameHint").innerHTML= "Full name invalid"; + return false; + } +} + +function validation() { + var _validusername = validusername(document.forms["register"]["username"].value); + + var _valid_fullname = valid_fullname(document.forms["register"]["nama"].value); + + var _valid_confirmpassword = valid_confirmpassword(document.forms["register"]["confimrpassword"].value); + + var _valid_email = valid_email(document.forms["register"]["email"].value); + + var _valid_password = valid_password(document.forms["register"]["password"].value); + console.log(_validusername && _valid_fullname && _valid_confirmpassword && _valid_email && _valid_password); + document.forms["register"]["button"].disabled = !(_validusername && _valid_fullname && _valid_confirmpassword && _valid_email && _valid_password); + + console.log(document.forms["register"]["button"].disabled); +} \ No newline at end of file diff --git a/src/formprofil.php b/src/formprofil.php new file mode 100644 index 0000000..e2216c3 --- /dev/null +++ b/src/formprofil.php @@ -0,0 +1,171 @@ +=8)&&($pass1 != $uname)&&($pass1 != $email)){ + return true; + + } + else { + return false; + + } + + +} + +function checkuname(){ + global $uname; + global $pass1; + global $nama; + global $email; + global $alamat; + global $provinsi; + global $kota; + global $kodepos; + global $hp; + global $conf; + if ((strlen($uname) >= 5) && ($uname != $pass1)) { + return true; + + } + else { + return false; + + } +} + +function checkfname(){ + global $uname; + global $pass1; + global $nama; + global $email; + global $alamat; + global $provinsi; + global $kota; + global $kodepos; + global $hp; + global $conf; + $fname = explode(" ", $nama); //memecah string full name dengan parameter spasi, fname[1] adalah kata kedua setelah spasi, kalau kosong berarti fullname hanya 1 kata + if(isset($fname[1])) { + return true; + + } + else { + return false; + + } +} + +function checkemail(){ + global $uname; + global $pass1; + global $nama; + global $email; + global $alamat; + global $provinsi; + global $kota; + global $kodepos; + global $hp; + global $conf; + $mail = str_split($email); + $j=0; //lokasi "." + $k=0;// lokasi "@" + for ($i=0;$i= 1) && (($i-$j)>=2)&&($k >= 1)&&($email!=$pass1)){ + return true; + + } + else { + return false; + + } +} + +connectsql(); + +if (checkemail()&&checkfname()&&checkpass()&&checkuname()){ + insertsql(); +} +else { + die('Error'); +} +closesql() + +?> + diff --git a/src/header.php b/src/header.php new file mode 100644 index 0000000..83b83d4 --- /dev/null +++ b/src/header.php @@ -0,0 +1,215 @@ + + + +
+
+
+
+
+ +
+Login +Member ? Daftar +
\ No newline at end of file diff --git a/src/img/items/aqua.jpg b/src/img/items/aqua.jpg new file mode 100644 index 0000000..b9adbef Binary files /dev/null and b/src/img/items/aqua.jpg differ diff --git a/src/img/items/baygon.jpg b/src/img/items/baygon.jpg new file mode 100644 index 0000000..d0f8ba4 Binary files /dev/null and b/src/img/items/baygon.jpg differ diff --git a/src/img/items/beras.jpg b/src/img/items/beras.jpg new file mode 100644 index 0000000..9407d72 Binary files /dev/null and b/src/img/items/beras.jpg differ diff --git a/src/img/items/beras_1.jpg b/src/img/items/beras_1.jpg new file mode 100644 index 0000000..b0c7613 Binary files /dev/null and b/src/img/items/beras_1.jpg differ diff --git a/src/img/items/beras_2.jpg b/src/img/items/beras_2.jpg new file mode 100644 index 0000000..07b085f Binary files /dev/null and b/src/img/items/beras_2.jpg differ diff --git a/src/img/items/bir.jpg b/src/img/items/bir.jpg new file mode 100644 index 0000000..6300db5 Binary files /dev/null and b/src/img/items/bir.jpg differ diff --git a/src/img/items/daging.jpg b/src/img/items/daging.jpg new file mode 100644 index 0000000..e661a0f Binary files /dev/null and b/src/img/items/daging.jpg differ diff --git a/src/img/items/kemoceng.jpg b/src/img/items/kemoceng.jpg new file mode 100644 index 0000000..08d4663 Binary files /dev/null and b/src/img/items/kemoceng.jpg differ diff --git a/src/img/items/kondom.jpg b/src/img/items/kondom.jpg new file mode 100644 index 0000000..d9a388c Binary files /dev/null and b/src/img/items/kondom.jpg differ diff --git a/src/img/items/obatflu.jpg b/src/img/items/obatflu.jpg new file mode 100644 index 0000000..5e95d15 Binary files /dev/null and b/src/img/items/obatflu.jpg differ diff --git a/src/img/items/paper.jpg b/src/img/items/paper.jpg new file mode 100644 index 0000000..df80a20 Binary files /dev/null and b/src/img/items/paper.jpg differ diff --git a/src/img/items/pen.jpg b/src/img/items/pen.jpg new file mode 100644 index 0000000..114cd42 Binary files /dev/null and b/src/img/items/pen.jpg differ diff --git a/src/img/items/ruler.jpg b/src/img/items/ruler.jpg new file mode 100644 index 0000000..482dde2 Binary files /dev/null and b/src/img/items/ruler.jpg differ diff --git a/src/img/items/sapu.jpg b/src/img/items/sapu.jpg new file mode 100644 index 0000000..4646562 Binary files /dev/null and b/src/img/items/sapu.jpg differ diff --git a/src/img/items/serokan.jpg b/src/img/items/serokan.jpg new file mode 100644 index 0000000..c54b3c0 Binary files /dev/null and b/src/img/items/serokan.jpg differ diff --git a/src/img/items/sirup.jpg b/src/img/items/sirup.jpg new file mode 100644 index 0000000..972fab6 Binary files /dev/null and b/src/img/items/sirup.jpg differ diff --git a/src/img/items/telur.jpg b/src/img/items/telur.jpg new file mode 100644 index 0000000..f6e4c2f Binary files /dev/null and b/src/img/items/telur.jpg differ diff --git a/src/img/logo.png b/src/img/logo.png new file mode 100644 index 0000000..613111f Binary files /dev/null and b/src/img/logo.png differ diff --git a/src/index.php b/src/index.php new file mode 100644 index 0000000..c719114 --- /dev/null +++ b/src/index.php @@ -0,0 +1,148 @@ + + + + RuSerBa + + + + + + +
+

Makanan

+
+ +
+

Minuman

+
+ +
+

Alat Tulis

+
+ +
+

Kebersihan

+
+ +
+

Obat

+
+ +
+ +

Mekanisme Belanja

+
+

Mekanisme pembelian di RuSerBa : +

    +
  1. Login sebagai pengguna. Jika belum punya akun silahkan register.
  2. +
  3. Pilih barang-barang yang akan dibeli. Barang akan masuk ke shopping bag.
  4. +
  5. Masuk ke shopping bag, klik tombol beli.
  6. +
  7. Masukan data kartu kredit anda.
  8. +
  9. Barang anda akan dikirim ke alamat anda.
  10. +

+

+
+ + \ No newline at end of file diff --git a/src/kebersihan.php b/src/kebersihan.php new file mode 100644 index 0000000..f7e3697 --- /dev/null +++ b/src/kebersihan.php @@ -0,0 +1,65 @@ + + + + RuSerBa + + + + + + +
+

Kebersihan

+
+ +
+ +

Mekanisme Belanja

+
+

Mekanisme pembelian di RuSerBa : +

    +
  1. Login sebagai pengguna. Jika belum punya akun silahkan register.
  2. +
  3. Pilih barang-barang yang akan dibeli. Barang akan masuk ke shopping bag.
  4. +
  5. Masuk ke shopping bag, klik tombol beli.
  6. +
  7. Masukan data kartu kredit anda.
  8. +
  9. Barang anda akan dikirim ke alamat anda.
  10. +

+

+
+ + \ No newline at end of file diff --git a/src/login.php b/src/login.php new file mode 100644 index 0000000..0b84b54 --- /dev/null +++ b/src/login.php @@ -0,0 +1,35 @@ + \ No newline at end of file diff --git a/src/login_again.php b/src/login_again.php new file mode 100644 index 0000000..0b13f04 --- /dev/null +++ b/src/login_again.php @@ -0,0 +1,28 @@ + \ No newline at end of file diff --git a/src/logout.php b/src/logout.php new file mode 100644 index 0000000..8fef61d --- /dev/null +++ b/src/logout.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/src/logout.txt b/src/logout.txt new file mode 100644 index 0000000..d7d3016 --- /dev/null +++ b/src/logout.txt @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/src/makanan.php b/src/makanan.php new file mode 100644 index 0000000..91049f8 --- /dev/null +++ b/src/makanan.php @@ -0,0 +1,66 @@ + + + + RuSerBa + + + + + + +
+

Makanan

+
+ +
+ + +

Mekanisme Belanja

+
+

Mekanisme pembelian di RuSerBa : +

    +
  1. Login sebagai pengguna. Jika belum punya akun silahkan register.
  2. +
  3. Pilih barang-barang yang akan dibeli. Barang akan masuk ke shopping bag.
  4. +
  5. Masuk ke shopping bag, klik tombol beli.
  6. +
  7. Masukan data kartu kredit anda.
  8. +
  9. Barang anda akan dikirim ke alamat anda.
  10. +

+

+
+ + \ No newline at end of file diff --git a/src/minuman.php b/src/minuman.php new file mode 100644 index 0000000..6546a59 --- /dev/null +++ b/src/minuman.php @@ -0,0 +1,66 @@ + + + + RuSerBa + + + + + + +
+ +

Minuman

+
+ +
+ +

Mekanisme Belanja

+
+

Mekanisme pembelian di RuSerBa : +

    +
  1. Login sebagai pengguna. Jika belum punya akun silahkan register.
  2. +
  3. Pilih barang-barang yang akan dibeli. Barang akan masuk ke shopping bag.
  4. +
  5. Masuk ke shopping bag, klik tombol beli.
  6. +
  7. Masukan data kartu kredit anda.
  8. +
  9. Barang anda akan dikirim ke alamat anda.
  10. +

+

+
+ + \ No newline at end of file diff --git a/src/obat.php b/src/obat.php new file mode 100644 index 0000000..5aa1a57 --- /dev/null +++ b/src/obat.php @@ -0,0 +1,64 @@ + + + + RuSerBa + + + + + + +
+

Obat

+
+ +
+

Mekanisme Belanja

+
+

Mekanisme pembelian di RuSerBa : +

    +
  1. Login sebagai pengguna. Jika belum punya akun silahkan register.
  2. +
  3. Pilih barang-barang yang akan dibeli. Barang akan masuk ke shopping bag.
  4. +
  5. Masuk ke shopping bag, klik tombol beli.
  6. +
  7. Masukan data kartu kredit anda.
  8. +
  9. Barang anda akan dikirim ke alamat anda.
  10. +

+

+
+ + \ No newline at end of file diff --git a/src/profile.php b/src/profile.php new file mode 100644 index 0000000..403c1a3 --- /dev/null +++ b/src/profile.php @@ -0,0 +1,61 @@ + + + + RuSerBa + + + + + +
+

Profile

+
+
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ +
+
+ + \ No newline at end of file diff --git a/src/register.php b/src/register.php new file mode 100644 index 0000000..be059f0 --- /dev/null +++ b/src/register.php @@ -0,0 +1,96 @@ + + + + RuSerBa + + + + + + +
+
+ + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + +
+ +
+
+ + \ No newline at end of file diff --git a/src/registrasiprofil.html b/src/registrasiprofil.html new file mode 100644 index 0000000..b4e0ac6 --- /dev/null +++ b/src/registrasiprofil.html @@ -0,0 +1,73 @@ + + + + + + + Registrasi Profil + + + + + + + + +
+ + +
+
+ + + +
+ + + +
+ + + +
+ + + +
+ + + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + + + +
+ +
+
+
+ + + diff --git a/src/resgistrasikredit.html b/src/resgistrasikredit.html new file mode 100644 index 0000000..51d3176 --- /dev/null +++ b/src/resgistrasikredit.html @@ -0,0 +1,50 @@ + + + + + + Registrasi Profil + + + + + + +
+ + +
+
+ + + + + + +
+ + + +
+ + + + + + + + + + +
+ +
+
+
+ + + + diff --git a/src/ruserba.sql b/src/ruserba.sql new file mode 100644 index 0000000..09a8692 --- /dev/null +++ b/src/ruserba.sql @@ -0,0 +1,142 @@ +-- phpMyAdmin SQL Dump +-- version 3.5.2.2 +-- http://www.phpmyadmin.net +-- +-- Host: 127.0.0.1 +-- Generation Time: Oct 27, 2013 at 03:07 PM +-- Server version: 5.5.27 +-- PHP Version: 5.4.7 + +SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; +SET time_zone = "+00:00"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; + +-- +-- Database: `ruserba` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `barang` +-- + +CREATE TABLE IF NOT EXISTS `barang` ( + `id_barang` varchar(10) NOT NULL, + `nama_barang` text NOT NULL, + `url_gambar` text NOT NULL, + `harga` double DEFAULT '0', + `url_link` text NOT NULL, + `detail` text NOT NULL, + `stok` int(5) DEFAULT '0', + `kategori` int(11) NOT NULL, + PRIMARY KEY (`id_barang`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `barang` +-- + + +-- -------------------------------------------------------- + +-- +-- Table structure for table `card` +-- + +CREATE TABLE IF NOT EXISTS `card` ( + `username` varchar(15) NOT NULL, + `field_card_num` varchar(10) NOT NULL, + `card_name` text NOT NULL, + `exdate` date NOT NULL, + `security` varchar(3) NOT NULL, + PRIMARY KEY (`field_card_num`), + UNIQUE KEY `username` (`username`), + UNIQUE KEY `field_card_num_2` (`field_card_num`), + KEY `field_card_num` (`field_card_num`), + KEY `field_card_num_3` (`field_card_num`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `card` +-- + + + +-- -------------------------------------------------------- + +-- +-- Table structure for table `cart` +-- + +CREATE TABLE IF NOT EXISTS `cart` ( + `id_cart` varchar(10) NOT NULL, + `username` varchar(15) NOT NULL, + `id_barang` varchar(10) NOT NULL, + `jumlah` int(5) NOT NULL, + PRIMARY KEY (`id_cart`), + KEY `id_cart` (`id_cart`), + KEY `id_cart_2` (`id_cart`), + KEY `username` (`username`), + KEY `id_barang` (`id_barang`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `cart` +-- + + + +-- -------------------------------------------------------- + +-- +-- Table structure for table `user` +-- + +CREATE TABLE IF NOT EXISTS `user` ( + `username` varchar(15) NOT NULL, + `password` varchar(20) NOT NULL, + `nama_lengkap` text NOT NULL, + `email` varchar(30) NOT NULL, + `jumlah_transaksi` int(10) DEFAULT '0', + `alamat` text, + `provinsi` text, + `kota` text, + `kodepos` varchar(10) DEFAULT '', + `nohp` varchar(12) DEFAULT '', + PRIMARY KEY (`username`), + UNIQUE KEY `email` (`email`), + UNIQUE KEY `username_2` (`username`), + KEY `username` (`username`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `user` +-- + + +-- +-- Constraints for dumped tables +-- + +-- +-- Constraints for table `card` +-- +ALTER TABLE `card` + ADD CONSTRAINT `card_ibfk_1` FOREIGN KEY (`username`) REFERENCES `user` (`username`); + +-- +-- Constraints for table `cart` +-- +ALTER TABLE `cart` + ADD CONSTRAINT `cart_ibfk_2` FOREIGN KEY (`id_barang`) REFERENCES `barang` (`id_barang`), + ADD CONSTRAINT `cart_ibfk_1` FOREIGN KEY (`username`) REFERENCES `user` (`username`); + +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/src/search.php b/src/search.php new file mode 100644 index 0000000..92e4a0a --- /dev/null +++ b/src/search.php @@ -0,0 +1,151 @@ + + + + Search for : <?php echo $_GET['name']; ?> + + + + $min_harga AND harga<$max_harga"; + } + } else { + if($min_harga <= 0 && $max_harga <= 0) { + $query = "SELECT * FROM barang WHERE nama_barang LIKE '%$name%' AND kategori='$kategori'"; + } else { + $query = "SELECT * FROM barang WHERE nama_barang LIKE '%$name%' AND kategori='$kategori' AND harga>$min_harga AND harga<$max_harga"; + } + } + if($start_idx >= 0) { + $query = $query." LIMIT $start_idx,10"; + } + + $res = mysql_query($query, $link); + } + ?> + +
+

SEARCH

+ +
+
    + + 0) { + if(isset($_GET['idx'])) { + $start_idx = $_GET['idx']; + } else { + $start_idx = -1; + } + + + + $name = ""; + if(isset($_GET['name'])){ + $name = $_GET['name']; + } + if(isset($_GET['count'])) { + $count = $_GET['count']; + } else { + $count = mysql_num_rows($res); + $count = ($count - $count%10) / 10; + } + + echo '
  • '; + echo '<<'; + echo '
  • '; + echo '
  • '; + $idx = $start_idx - 10; + if($idx <= 0) $idx = 0; + echo '<'; + echo '
  • '; + for($iter = 0; $iter <= $count; $iter++) { + echo '
  • '.$iter.'
  • '; + } + echo '
  • '; + $idx = $start_idx + 10; + if($idx >= $count*10) $idx = $count*10; + echo '>'; + echo '
  • '; + echo '
  • '; + echo '>>'; + echo '
  • '; + + } + ?> +
+
+
+ 0) { + $count = 0; + while($row = mysql_fetch_array($res)) { + if($count >= 10) break; + echo '
'; + $count++; + } + } else { + echo '
'; + echo 'There\'s No Result'; + echo '
'; + } + ?> +
+
+ + \ No newline at end of file diff --git a/src/shopping_bag.php b/src/shopping_bag.php new file mode 100644 index 0000000..bb6cef7 --- /dev/null +++ b/src/shopping_bag.php @@ -0,0 +1,96 @@ + + + + RuSerBa + + + + + + + + +
+

Shopping Bag

+
+
    + 0) { + $counter = 0; + while($row = mysql_fetch_array($result)) { + echo '
  • '; + echo '
    '; + echo ''; + $array = explode(',',$row['url_gambar']); + echo ''; + echo '

    '.$row['nama_barang'].'

    '; + echo '
    '; + echo ' * '; + echo ''; + $total += $row['harga'] * $row['jumlah']; + echo ' = '; + echo '
    '; + echo '
  • '; + $counter++; + } + echo '
  • '; + echo '
    '; + echo 'TOTAL = '; + echo '
    + +
    '; + if (isset($_POST['beli'])) { + for($i=0;$i'; + echo '
  • '; + echo ''; + } else { + echo '
  • '; + echo '
    '; + echo 'TIDAK ADA SHOPPING BAG YANG BELUM DIBAYAR'; + echo '
    '; + echo ''; + } + } else { + echo ''; + echo '
    '; + echo 'TIDAK ADA SHOPPING BAG'; + echo '
    '; + echo ''; + } + ?> +
+
+
+ + \ No newline at end of file diff --git a/src/template.php b/src/template.php new file mode 100644 index 0000000..e0c2f41 --- /dev/null +++ b/src/template.php @@ -0,0 +1,22 @@ + + + + RuSerBa + + + + + + +
+ +
+ + \ No newline at end of file diff --git a/src/validate.php b/src/validate.php new file mode 100644 index 0000000..b904327 --- /dev/null +++ b/src/validate.php @@ -0,0 +1,68 @@ += 8) { + $response ="password valid"; + } + else { + $response="password must be 8 length"; + } + return $response; + } + + function checkconfirmpassword($password,$confirm_password){ + if (strlen($confirm_password) >= 8 && strcmp($password,$confirm_password)==0) { + $response ="password confirmed"; + } + else { + $response= "password not same"; + } + return $response; + } + + function checkemail($email){ + $link = mysql_connect("localhost","root","") or die("Can't connect to database. Contact Your Administrator."); + mysql_select_db("ruserba") or die("Cannot select DB. Contact your web administrator."); + + $query = "SELECT * FROM user WHERE email='$email'"; + $res = mysql_query($query, $link); + + if (filter_var($email, FILTER_VALIDATE_EMAIL)) { + if (mysql_num_rows($res)==0) { + $response ='{"result" : "true", "response" : "email is available"}'; + } else { + $response ='{"result" : "false", "response" : "email is used"}'; + } + } + else { + $response ='{"result" : "true", "response" : "email not valid"}'; + } + return $response; + } + + if(isset($_GET["username"])) { + echo checkuname($username); + } else if(isset($_GET["email"])) { + echo checkemail($_GET["email"]); + } +?> \ No newline at end of file