Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submit tubes IF3110 #20

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added INSTALL.md
Empty file.
91 changes: 91 additions & 0 deletions db/progin_13510025.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
-- MySQL dump 10.13 Distrib 5.5.8, for Win32 (x86)
--
-- Host: localhost Database: progin_13510025
-- ------------------------------------------------------
-- Server version 5.5.8

/*!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 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `customer_table`
--

DROP TABLE IF EXISTS `customer_table`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `customer_table` (
`id` int(6) NOT NULL AUTO_INCREMENT,
`username` varchar(100) NOT NULL,
`password` varchar(100) NOT NULL,
`nama_lengkap` varchar(100) NOT NULL,
`email` varchar(100) NOT NULL,
`alamat` varchar(200) NOT NULL,
`provinsi` varchar(100) NOT NULL,
`kecamatan` varchar(100) NOT NULL,
`kode_pos` varchar(5) NOT NULL,
`nomor_hp` varchar(100) NOT NULL,
`jumlah_transaksi` int(8) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `customer_table`
--

LOCK TABLES `customer_table` WRITE;
/*!40000 ALTER TABLE `customer_table` DISABLE KEYS */;
INSERT INTO `customer_table` VALUES (1,'dummy_is_me','dumdumdummy','Dummy bin Dammi','[email protected]','Jl. Dummy Selatan no. 13 Kota Dummy','Dummiez','Dummies','00000','0800110011',0);
/*!40000 ALTER TABLE `customer_table` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `item_table`
--

DROP TABLE IF EXISTS `item_table`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `item_table` (
`id` varchar(6) NOT NULL,
`img` varchar(100) NOT NULL,
`kategori` varchar(100) NOT NULL,
`nama` varchar(100) NOT NULL,
`harga` decimal(3,2) NOT NULL,
`deskripsi` varchar(300) NOT NULL,
`req_user` varchar(300) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `img` (`img`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `item_table`
--

LOCK TABLES `item_table` WRITE;
/*!40000 ALTER TABLE `item_table` DISABLE KEYS */;
INSERT INTO `item_table` VALUES ('BD001','imagesBD001.png','BumbuDapur','Kecap Manis',9.99,'Kecap manis tradisional yang manisnya memabukkan. Dijual dalam satuan botolan',''),('BD002','imagesBD002.png','BumbuDapur','Kecap Asin',9.99,'Kecap asin impor yang diproduksi secara mutakhir. Dijual dalam satuan botolan',''),('BD003','imagesBD003.png','BumbuDapur','Gula',9.99,'Gula yang sangat manis seperti senyummu, tapi tidak membuat diabetes. Dijual dalam satuan kilogram',''),('BD004','imagesBD004.png','BumbuDapur','Garam',9.99,'Garam yang diproses secara modern dari air laut. Rasanya asin. Dijual dalam satuan sachet',''),('BD005','imagesBD005.png','BumbuDapur','Merica',9.99,'Merica. Apabila ditambahkan pada makanan akan menjadi terasa seperti ditambahkan merica. Dijual dalam satuan sachet',''),('BE001','imagesBE001.png','Beras','Beras Rojolele',9.99,'Beras Rojolele. Kualitas unggul, dijual dalam satuan kilo',''),('BE002','imagesBE002.png','Beras','Beras C4',9.99,'Beras C4 yang kualitas sedikit di bawah Rojolele. Dijual dalam satuan kilogram',''),('BE003','imagesBE003.png','Beras','Beras Menthik Wangi',9.99,'Beras yang apabila ditanak menjadi nasi mengeluarkan aroma yang menggoda. Dijual dalam satuan kilogram',''),('BE004','imagesBE004.png','Beras','Beras Basmati',9.99,'Beras impor dari Bangladesh. Dijual dalam satuan kilogram',''),('BE005','imagesBE005.png','Beras','Beras Cianjur',9.99,'Beras lokal dari Cianjur dengan kualitas yang unggul. Dijual dalam satuan kilogram',''),('DA001','imagesDA001.png','Daging','Daging Sapi',9.99,'Daging sapi yang rasanya seperti daging sapi. Dijual dalam satuan kilogram',''),('DA002','imagesDA002.png','Daging','Daging Kambing',9.99,'Daging kambing yang rasanya seperti daging kambing. Dijual dalam satuan kilogram',''),('DA003','imagesDA003.png','Daging','Daging Ayam',9.99,'Daging ayam yang rasanya seperti daging ayam. Dijual dalam satuan kilogram',''),('DA004','imagesDA004.png','Daging','Daging Babi',9.99,'Daging babi yang rasanya seperti daging babi. Awas mengandung babi! Dijual dalam satuan kilogram',''),('DA005','imagesDA005.png','Daging','Daging Kerbau',9.99,'Daging kerbau yang rasanya seperti daging kerbau. Dijual dalam satuan kilogram',''),('FF001','imagesFF001.png','FrozenFood','Chicken Nugget',9.99,'Chicken nugget yang dibekukan. Dijual per kemasan',''),('FF002','imagesFF002.png','FrozenFood','Sosis sapi',9.99,'Sosis sapi yang dibekukan. Dijual per kemasan',''),('FF003','imagesFF003.png','FrozenFood','Sosis ayam',9.99,'Sosis ayam yang dibekukan. Dijual per kemasan',''),('FF004','imagesFF004.png','FrozenFood','Korned sapi',9.99,'Korned sapi yang dibekukan. Dijual per kemasan',''),('FF005','imagesFF005.png','FrozenFood','Sarden Kalengan',9.99,'Sarden kalengan yang dibekukan. Dijual per kemasan',''),('MN001','imagesMN001.png','Minuman','Teh',9.99,'Minuman teh siap saji. Rasanya seperti teh. Dijual per kemasan',''),('MN002','imagesMN002.png','Minuman','Kopi',9.99,'Minuman kopi siap saji. Rasanya seperti kopi. Dijual per kemasan',''),('MN003','imagesMN003.png','Minuman','Susu',9.99,'Minuman susu siap saji. Rasanya seperti susu. Dijual per kemasan',''),('MN004','imagesMN004.png','Minuman','Sirup',9.99,'Minuman sirup siap saji. Rasanya seperti sirup. Dijual per kemasan',''),('MN005','imagesMN005.png','Minuman','Air Mineral',9.99,'Air mineral siap saji. Rasanya seperti air mineral. Dijual per kemasan','');
/*!40000 ALTER TABLE `item_table` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!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 */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2013-10-29 19:07:25
25 changes: 25 additions & 0 deletions src/Profile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
function editProfile(){
var address = document.getElementById("atributaddress");
var fullname = document.getElementById("atributfullname");
var provinsi = document.getElementById("atributprovinsi");
var kota = document.getElementById("atributkota");
var kodepos = document.getElementById("atributkodepos");
var noHP = document.getElementById("atributHP");
var button = document.getElementById("editProfilebutton");

var ava = document.getElementById("atributavatar");
var password = document.getElementById("atributpassword");
var confirmpassword = document.getElementById("atributconfirmpassword");

fullname.innerHTML="<input type='text'>";
address.innerHTML="<input type='text'>";
provinsi.innerHTML="<input type='text'>";
kota.innerHTML="<input type='text'>";
noHP.innerHTML="<input type='text'>";

button.value="Save Changes";

ava.innerHTML="<input type='text'>";
password.innerHTML="<input type='tag'>";
confirmpassword.innerHTML="<input type='tag'>";
}
24 changes: 24 additions & 0 deletions src/ajax/addtocart.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
define('INCLUDE_CHECK',1);
require "../connect.php";

if(!$_POST['img']) die("There is no such product!");

$img=mysql_real_escape_string(end(explode('/',$_POST['img'])));
$row=mysql_fetch_assoc(mysql_query("SELECT * FROM item_table WHERE img='".$img."'"));

echo '{
status:1,id:'.$row['id'].',price:'.$row['harga'].',txt:\'\
\
<table width="100%" id="table_'.$row['id'].'">\
<tr>\
<td width="60%">'.$row['nama'].'</td>\
<td width="10%">'.$row['harga'].'</td>\
<td width="15%"><select name="'.$row['id'].'_cnt" id="'.$row['id'].'_cnt" onchange="change('.$row['id'].');">\
<option value="1">1</option>\
<option value="2">2</option>\
<option value="3">3</option></select>\
\
</td>\
<td width="15%"><a href="#" onclick="remove('.$row['id'].');return false;" class="remove">remove</a></td>\
</tr>\
</table>\'}';
13 changes: 13 additions & 0 deletions src/ajax/tips.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
define('INCLUDE_CHECK',1);
require "../connect.php"

if(!$_POST['img']) die("There is no such product!");

$img=mysql_fetch_assoc(mysql_query("SELECT * FROM internet_shop WHERE img='".$img"'"));

if(!$row) die("There is no such product!");

echo '<strong>'.$row['nama'].'</strong>
<p class="descr">'.$row['deskripsi'].'</p>
<strong>price: $'.$row['price'].'</strong>
<small>Geser ke shopping cart untuk membeli</small>;
39 changes: 39 additions & 0 deletions src/checklogin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

$host="localhost"; // Host name
$username=""; // Mysql username
$password=""; // Mysql password
$db_name="test"; // Database name
$tbl_name="members"; // Table name

// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");

// username and password sent from form
$myusername=$_POST['myusername'];
$mypassword=$_POST['mypassword'];

// To protect MySQL injection (more detail about MySQL injection)
$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);
$myusername = mysql_real_escape_string($myusername);
$mypassword = mysql_real_escape_string($mypassword);
$sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";
$result=mysql_query($sql);

// Mysql_num_row is counting table row
$count=mysql_num_rows($result);

// If result matched $myusername and $mypassword, table row must be 1 row
if($count==1){

// Register $myusername, $mypassword and redirect to file "login_success.php"
session_register("myusername");
session_register("mypassword");
header("location:login_success.php");
}
else {
echo "Wrong Username or Password";
}
?>
8 changes: 8 additions & 0 deletions src/connect.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

$con=mysqli_connect("localhost","root","progin_13510025");

if (mysqli_connect_errno($con)) {
echo "Failed to connect to MySQL: ".mysqli_connect_error();
}
?>
72 changes: 72 additions & 0 deletions src/halamanprofil.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

<title>Profil</title>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width; initial-scale=1.0" />
<!-- <link rel="stylesheet" href="style.css" type="text/css"/> -->
<script type="text/javascript" src="Profile.js"></script>

</head>
<body>
<div class ="header" id="headerother">
<p><a href="home.html" title="RuSerBa" target="blank">
<img src="image/logoPNG.png" alt="RuSerBa" title="Ruko Serba Ada" border="0"/>
</a></p>

<!-- <a href="dashboard.html">PRODUCTS</a> -->
<select>
<option value="Select">PRODUCTS</option>
<option value="product1">MosquitoMissile</option>
<option value="product2">WaspMissile</option>
<option value="product3">SilkwormMissile</option>
<option value="product4">DragonflyMissile</option>
<option value="product5">HornetMissile</option>
<option value="product6">FirestormTorpedo</option>
</select>
<input type="text" name="search" class="sfield" value="" align = "right">
<a href="javascript:win1()">LOGIN</a>
<a href=>REGISTER</a>
<a href=>SHOPPING BAG</a>
<a href="index.html">Logout</a></p>
</form>

</div>
<div class="body">
<div class="profile">
<p class="nama">Halaman Profil.</p>
<input type="submit" id="editprofilebutton" value="Edit Profile" onclick="editProfile()">
omgwat // @testing
<div class="atributprofile">Nama Lengkap</div>
<div id="atributfullname">herp derper mk-IV</div>
<br>

<div class="atributprofile">Address</div>
<div id="atributaddress">where </div>
<br>

<div class="atributprofile">Provinsi</div>
<div id="atributprovinsi"> omg</div>
<br>
<div class="atributprofile">Kota/Kabupaten</div>
<div id="atributkota"> wtf</div>
<br>
<div class="atributprofile">Kode Pos</div>
<div id="atributkodepos"> 999999</div>
<br>
<div class="atributprofile">No. HP</div>
<div id="atributHP"> 12351235123</div>
<br>

<div class="atributprofile">Password</div>
<div id="atributpassword">(tidak ditampilkan)</div>
<br>
<div class="atributprofile">Confirm Password</div>
<div id="atributconfirmpassword">(tidak ditampilkan)</div>
</div>
</body>

</html>
Binary file added src/image/Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/image/LogoPNG.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/image/item0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/image/item1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/image/item3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading