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

Kelompok "okapandecahyo" #32

Open
wants to merge 56 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
7ff8381
Github test drive.
okaswara-p Oct 25, 2013
ed8d8b3
Adding some product images.
okaswara-p Oct 26, 2013
27e90ca
Adding another product images.
okaswara-p Oct 26, 2013
542945a
Adding more product images.
13510082 Oct 27, 2013
04a636c
delete some images.
13510082 Oct 27, 2013
b1f803e
Deleting some stuff.
okaswara-p Oct 27, 2013
b436c82
Adding database file.
okaswara-p Oct 27, 2013
548463a
Adding initial template.
okaswara-p Oct 27, 2013
a3e6605
HOTFIX: Database scheme updated.
okaswara-p Oct 27, 2013
e8645fd
HOTFIX: Database typo fixed.
okaswara-p Oct 27, 2013
66fbd80
Adding database getter functionality.
okaswara-p Oct 27, 2013
436ce49
Adding interface document.
okaswara-p Oct 27, 2013
fbdc6e6
Adding authentication functions, and a (very) small content example.
okaswara-p Oct 27, 2013
5b6205a
buah+bumbu.
aiothealchemist Oct 28, 2013
deb009f
+bumbu_ketumbar.jpg
aiothealchemist Oct 28, 2013
257ca10
Modifying database entry for apple product (real apple, not Steve Job…
okaswara-p Oct 28, 2013
9dec5ef
Adding header + some core functionality, with example (sample.php)
okaswara-p Oct 28, 2013
f2e70d6
Changing format from XHTML 1.0 Strict into HTML5.
okaswara-p Oct 28, 2013
3b60f15
Fixing copyright symbol.
okaswara-p Oct 28, 2013
c884cdb
Adding login menu.
okaswara-p Oct 28, 2013
cf50c80
Adding login functionality.
okaswara-p Oct 28, 2013
21a4bf4
Adding contents to tabs.
okaswara-p Oct 28, 2013
dd3bb5f
Adding product images.
okaswara-p Oct 28, 2013
29cb090
Modifying a product image.
okaswara-p Oct 28, 2013
166400e
coba-coba 1
aiothealchemist Oct 29, 2013
a1efd23
Merge branch 'master' of https://github.com/okaswara-p/IF3110-Tubes-I
okaswara-p Oct 29, 2013
e2829c9
coba-coba 2
aiothealchemist Oct 29, 2013
157d96c
Merge branch 'master' of https://github.com/okaswara-p/IF3110-Tubes-I
okaswara-p Oct 29, 2013
47e85e1
Adding thumbnails.
okaswara-p Oct 29, 2013
b3efd68
Adding shopping bag internal functionality (access to LocalStorage).
okaswara-p Oct 29, 2013
d447ee9
Merge branch 'master' of https://github.com/okaswara-p/IF3110-Tubes-I
okaswara-p Oct 29, 2013
2895a05
coba-coba 3
aiothealchemist Oct 29, 2013
39a5508
Deleting thumbnails (there was some problems when uploading). Reuploa…
okaswara-p Oct 29, 2013
d3dcc1d
Readding thumbnails.
okaswara-p Oct 29, 2013
8bf6671
coba-coba 4
aiothealchemist Oct 29, 2013
37ffa62
Merge branch 'master' of https://github.com/okaswara-p/IF3110-Tubes-I
aiothealchemist Oct 29, 2013
4d0a85b
Updating database entry.
okaswara-p Oct 29, 2013
bc6a88b
tambah product.js & product.php
13510082 Oct 29, 2013
047d688
coba-coba 5
aiothealchemist Oct 29, 2013
ddf6f3b
Merge branch 'master' of https://github.com/okaswara-p/IF3110-Tubes-I
aiothealchemist Oct 29, 2013
5d157fd
Fixing some bug in localstorage.
okaswara-p Oct 29, 2013
108d80c
product.js sudah fix
13510082 Oct 29, 2013
93d3c84
Updating document.
okaswara-p Oct 29, 2013
68abcea
+register
aiothealchemist Oct 29, 2013
820b3d0
Merge branch 'master' of https://github.com/okaswara-p/IF3110-Tubes-I
aiothealchemist Oct 29, 2013
e08ab05
+register.js
aiothealchemist Oct 29, 2013
dcfcd42
card.php belum di-styling
13510082 Oct 29, 2013
bfb9df7
Merge branch 'master' of https://github.com/okaswara-p/IF3110-Tubes-I
13510082 Oct 29, 2013
ce2cc16
Adding main page.
okaswara-p Oct 29, 2013
a3949d3
Adding category page and updating database.
okaswara-p Oct 29, 2013
543d5f6
betulin register
aiothealchemist Oct 29, 2013
6af0bd9
Merge branch 'master' of https://github.com/okaswara-p/IF3110-Tubes-I
aiothealchemist Oct 29, 2013
c964267
INSTALL.MD
okaswara-p Oct 29, 2013
6768541
final(?)
aiothealchemist Oct 29, 2013
2280e2f
Merge branch 'master' of https://github.com/okaswara-p/IF3110-Tubes-I
okaswara-p Oct 29, 2013
3a6ef43
db.php
aiothealchemist Oct 29, 2013
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
5 changes: 5 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Langkah-langkah Instalasi:
- Buat database "ruserba" pada MySQL.
- Lakukan source pada file database dump "ruserba.sql".
- Ubah properti username/password dari database pada "db.sql" jika diperlukan.
- Lakukan instalasi sistem pada folder src/ ke server (lokal).
5 changes: 5 additions & 0 deletions db/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Gunakan file ruserba.sql sebagai source pembuatan database, BUKAN ruserba_original.sql.
Lakukan create database terlebih dahulu dengan nama database: "ruserba".

Tambahan:
Password untuk user John Smith: "letmein" (dalam database disimpan dalam bentuk MD5)
122 changes: 122 additions & 0 deletions db/ruserba.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
-- MySQL dump 10.13 Distrib 5.5.27, for Win32 (x86)
--
-- Host: localhost Database: ruserba
-- ------------------------------------------------------
-- Server version 5.5.27

/*!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 `barang`
--

DROP TABLE IF EXISTS `barang`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `barang` (
`id_barang` int(11) NOT NULL AUTO_INCREMENT,
`id_kategori` int(11) NOT NULL,
`nama_barang` varchar(256) NOT NULL,
`harga` int(11) NOT NULL,
`satuan` varchar(32) NOT NULL,
`deskripsi` varchar(1024) DEFAULT NULL,
`jumlah_pembelian` int(11) DEFAULT '0',
`jumlah_stok` int(11) DEFAULT '0',
`nama_gambar` varchar(256) NOT NULL,
`nama_gambar_thumb` varchar(256) NOT NULL,
PRIMARY KEY (`id_barang`),
KEY `id_kategori` (`id_kategori`),
CONSTRAINT `barang_ibfk_1` FOREIGN KEY (`id_kategori`) REFERENCES `kategori` (`id_kategori`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `barang`
--

LOCK TABLES `barang` WRITE;
/*!40000 ALTER TABLE `barang` DISABLE KEYS */;
INSERT INTO `barang` VALUES (1,4,'Apel',3390,'100 gram','Buah yang berkhasiat untuk menjauhkan dokter dari Anda.',43,73,'buah_apel.jpg','buah_apel_thumb.jpg'),(2,3,'Brokoli',1390,'100 gram','Sayuran yang mengandung banyak vitamin C dan serat. Menurut Wikipedia, sebaiknya diolah dengan cara dikukus agar nutrisinya tetap terjaga.',24,16,'sayur_brokoli.jpg','sayur_brokoli_thumb.jpg'),(3,1,'Beras',8900,'kilogram','Makanan pokok',53,134,'beras_putih.jpg','beras_putih_thumb.jpg'),(4,4,'Ceri',2300,'100 gram','Deskripsi ceri disini.',85,41,'buah_cherry.jpg','buah_cherry_thumb.jpg'),(5,4,'Durian',2900,'100 gram','Deskripsi durian disini.',41,42,'buah_durian.jpg','buah_durian_thumb.jpg'),(6,4,'Jambu batu',2490,'100 gram','Deskripsi jambu batu disini.',35,31,'buah_jambubatu.jpg','buah_jambubatu_thumb.jpg'),(7,4,'Jeruk',3280,'100 gram','Deskripsi jeruk disini.',53,31,'buah_jeruk.jpg','buah_jeruk_thumb.jpg'),(8,4,'Kiwi',5190,'100 gram','Deskripsi kiwi disini.',56,56,'buah_kiwi.jpg','buah_kiwi_thumb.jpg'),(9,4,'Mangga',2390,'100 gram','Deskripsi mangga disini.',73,76,'buah_mangga.jpg','buah_mangga_thumb.jpg'),(10,4,'Manggis',2290,'100 gram','Deskripsi manggis disini.',86,24,'buah_manggis.jpg','buah_manggis_thumb.jpg'),(11,4,'Melon',2470,'100 gram','Deskripsi melon disini.',41,41,'buah_melon.jpg','buah_melon_thumb.jpg'),(12,4,'Nanas',3190,'100 gram','Deskripsi nanas disini.',96,67,'buah_nanas.jpg','buah_nanas_thumb.jpg'),(13,4,'Pisang',2340,'100 gram','Deskripsi pisang disini.',45,87,'buah_pisang.jpg','buah_pisang_thumb.jpg'),(14,4,'Semangka',3500,'100 gram','Deskripsi semangka disini.',65,31,'buah_semangka.jpg','buah_semangka_thumb.jpg'),(15,4,'Stroberi',4120,'100 gram','Deskripsi stroberi disini.',32,41,'buah_stroberi.jpg','buah_stroberi_thumb.jpg'),(16,4,'Zaitun',2340,'100 gram','Deskripsi zaitun disini.',52,23,'buah_zaitun.jpg','buah_zaitun_thumb.jpg'),(17,1,'Kacang hijau',2320,'100 gram','Kacang hijau baik untuk kesehatan.',41,49,'kacang_hijau.jpg','kacang_hijau_thumb.jpg'),(18,1,'Beras merah',3890,'100 gram','Deskripsi untuk beras merah disini',34,41,'beras_merah.jpg','beras_merah_thumb.jpg'),(19,5,'Bawang putih',2340,'100 gram','Deskripsi untuk bawang putih disini',34,41,'bumbu_bawangputih.jpg','bumbu_bawangputih_thumb.jpg'),(20,5,'Bawang merah',2190,'100 gram','Deskripsi untuk bawang merah disini',41,87,'bumbu_bawangmerah.jpg','bumbu_bawangmerah_thumb.jpg'),(21,5,'Kayu manis',3430,'100 gram','Deskripsi untuk kayu manis disini',12,32,'bumbu_kayumanis.jpg','bumbu_kayumanis_thumb.jpg'),(22,2,'Daging ayam',4290,'100 gram','Deskripsi untuk daging ayam disini',76,46,'daging_ayam.jpg','daging_ayam_thumb.jpg'),(23,2,'Daging sapi',6890,'100 gram','Deskripsi untuk daging sapi disini',32,21,'daging_sapi.jpg','daging_sapi_thumb.jpg'),(24,2,'Daging ikan',5470,'100 gram','Deskripsi untuk daging ikan disini',67,32,'daging_ikan.jpg','daging_ikan_thumb.jpg'),(25,3,'Bayam',3290,'100 gram','Deskripsi untuk bayam disini',58,32,'sayur_bayam_hijau.jpg','sayur_bayam_hijau_thumb.jpg'),(26,3,'Buncis',2990,'100 gram','Deskripsi untuk buncis disini',46,31,'sayur_buncis.jpg','sayur_buncis_thumb.jpg');
/*!40000 ALTER TABLE `barang` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `kategori`
--

DROP TABLE IF EXISTS `kategori`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `kategori` (
`id_kategori` int(11) NOT NULL AUTO_INCREMENT,
`nama_kategori` varchar(256) NOT NULL,
PRIMARY KEY (`id_kategori`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `kategori`
--

LOCK TABLES `kategori` WRITE;
/*!40000 ALTER TABLE `kategori` DISABLE KEYS */;
INSERT INTO `kategori` VALUES (1,'Beras dan kacang-kacangan'),(2,'Daging dan telur'),(3,'Sayur-mayur'),(4,'Buah-buahan'),(5,'Bumbu dapur');
/*!40000 ALTER TABLE `kategori` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `user`
--

DROP TABLE IF EXISTS `user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user` (
`id_user` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(256) NOT NULL,
`email` varchar(256) NOT NULL,
`password` varchar(256) NOT NULL,
`nama_lengkap` varchar(256) NOT NULL,
`provinsi` varchar(256) DEFAULT NULL,
`kota` varchar(256) DEFAULT NULL,
`alamat` varchar(32) DEFAULT NULL,
`kode_pos` varchar(32) DEFAULT NULL,
`kontak` varchar(32) DEFAULT NULL,
`nomor_kartu` varchar(256) DEFAULT NULL,
`nama_kartu` varchar(256) DEFAULT NULL,
`ekspirasi_kartu` date DEFAULT NULL,
PRIMARY KEY (`id_user`),
UNIQUE KEY `username` (`username`),
UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `user`
--

LOCK TABLES `user` WRITE;
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
INSERT INTO `user` VALUES (1,'john','[email protected]','0d107d09f5bbe40cade3de5c71e9e9b7','John Smith','Jawa Barat','Bandung','Jl. Ganeca No.42A','14562','081347556202','3141-5156-1425-5421','John Smith','2016-09-01');
/*!40000 ALTER TABLE `user` 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 21:51:21
39 changes: 39 additions & 0 deletions db/ruserba_original.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
create table user(
id_user int auto_increment,
username varchar(256) not null,
email varchar(256) not null,
password varchar(256) not null,
nama_lengkap varchar(256) not null,
provinsi varchar(256) default null,
kota varchar(256) default null,
alamat varchar(32) default null,
kode_pos varchar(32) default null,
kontak varchar(32) default null,
nomor_kartu varchar(256) default null,
nama_kartu varchar(256) default null,
ekspirasi_kartu date default null,
primary key(user_id),
unique(username),
unique(email)
);

create table kategori(
id_kategori int auto_increment,
nama_kategori varchar(256) not null,
primary key(id_kategori)
);

create table barang(
id_barang int auto_increment,
id_kategori int not null,
nama_barang varchar(256) not null,
harga int not null,
satuan varchar(32) not null,
deskripsi varchar(1024) default null,
jumlah_pembelian int default 0,
jumlah_stok int default 0,
nama_gambar varchar(256) not null,
nama_gambar_thumb varchar(256) not null,
primary key(id_barang),
foreign key(id_kategori) references kategori(id_kategori) on delete cascade on update cascade
);
Binary file added doc/interface.docx
Binary file not shown.
43 changes: 43 additions & 0 deletions src/auth.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
require_once('db.php');

$login_user_id = null;

// Fungsi untuk memeriksa apakah user sudah login.
function isLoggedIn() {
global $login_user_id;
return isset($login_user_id);
}

function clearClientCookie() {
setcookie('hash', '', time()-100000);
setcookie('id', '', time()-100000);
}

if (isset($_COOKIE['hash']) || isset($_COOKIE['id'])) {

// Dua-duanya harus di-set.
if (!isset($_COOKIE['hash']) || !isset($_COOKIE['id'])) clearClientCookie();
else {
databaseConnect();
$client_hash = $_COOKIE['hash'];
$client_id = $_COOKIE['id'];

$user = getUserData($client_id);
if (is_null($user)) clearClientCookie();
else {
// Periksa kebenaran nilai hash pada client.
$server_hash = getLoginHash($user['username'], $user['password']);

// Cookie tidak konsisten/dipalsukan, hapus semua informasi di cookie.
if ($client_hash != $server_hash) {
clearClientCookie();
} else {
// Cookie valid, buat user ID.
$login_user_id = $_COOKIE['id'];
}
}
databaseDisconnect();
}
}
?>
28 changes: 28 additions & 0 deletions src/begin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
if (!isset($page_title)) $page_title = "";
if (!isset($css_file)) $css_file = array();
else if (!is_array($css_file)) $css_file = [ $css_file ];
if (!isset($js_file)) $js_file = array();
else if (!is_array($js_file)) $js_file = [ $js_file ];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title><?php echo $page_title; ?></title>
<link rel="stylesheet" type="text/css" href="styles/global.css" />
<script type="text/javascript" src="scripts/global.js"></script>
<?php
// Masukkan seluruh file css yang direfer.
foreach ($css_file as $css_f) {
echo '<link rel="stylesheet" type="text/css" href="' . $css_f . '" />';
}
// Masukkan seluruh file javascript yang direfer.
foreach ($js_file as $js_f) {
echo '<script type="text/javascript" src="' . $js_f . '"></script>';
}
?>
</head>
<body>
<div id="popuplayer"></div>
<?php include_once('core_begin.php'); ?>
82 changes: 82 additions & 0 deletions src/card.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?php
// Contoh dari file content.

// Selalu include ini di awal.
require_once('ref.php');

// Include auth.php, untuk memeriksa user sudah login atau belum.
require_once('auth.php');

// Include begin.
require_once('begin.php');
?>
<?php
databaseConnect();
?>

<?php
// define variables and set to empty values
$cardnumber = $cardname = $cardexpired = "";
$numberErr = $nameErr = $expiredErr = "";

if ($_SERVER["REQUEST_METHOD"] == "POST")
{
if(empty($_POST["cardnumber"]))
{$numberErr = "*Harus diisi";}
else
{
$cardnumber = test_input($_POST["cardnumber"]);
if (!preg_match("/^[0-9]*$/", $cardnumber))
{
$numberErr = "*Hanya angka yang diperbolehkan";
}
}

if(empty($_POST["cardname"]))
{$nameErr = "*Harus diisi";}
else
{$cardname = test_input($_POST["cardname"]);}

if(empty($_POST["cardexpired"]))
{$expiredErr = "*Harus diisi";}
else
{$cardexpired = test_input($_POST["cardexpired"]);}
}

function test_input($data)
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}

if($referrer_page == 'bag.php')
{
writeWarningSmall('Anda harus registrasi kartu kredit terlebih dahulu');
}

if(isLoggedIn()){
echo' <h2>Registrasi Kartu Kredit</h2>
<form method="post" action="'.htmlspecialchars($_SERVER["PHP_SELF"]).'">
Nomor Kartu: <input type="text" name="cardnumber">
<span class = "error">'.$numberErr.'</span>
<br><br>
Nama Pada Kartu: <input type="text" name="cardname">
<span class = "error">'.$nameErr.'</span>
<br><br>
Tanggal Ekspirasi: <input type="date" name="cardexpired">
<span class = "error">'.$expiredErr.'</span>
<br><br>
<button type="submit" >Submit</button>
</form>
';
}else{
writeWarningSmall('Anda harus login terlebih dahulu');
}
if($referrer_page == 'register.php')
{
echo '<a href = "'.$refferer_page.'"> Skip registration </a>';
}
require_once('end.php');
?>
58 changes: 58 additions & 0 deletions src/category.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php
// Selalu include ini di awal.
require_once('ref.php');

// Include auth.php, untuk memeriksa user sudah login atau belum.
require_once('auth.php');

// Redirect user jika tidak ada category_id.
if (!isset($_GET['category_id'])) header('Location: index.php');

// Set kategori.
$category_id = $_GET['category_id'];

databaseConnect();
$category = getCategoryData($category_id);

// Redirect user jika tidak ada category_id tidak valid.
if (is_null($category)) header('Location: index.php');

$category_name = $category['nama_kategori'];

$page_title = 'RuSerBa - Daftar kategori ' . $category_name;
$css_file = 'styles/browse_product.css';

// Include begin.
require_once('begin.php');

// Include custom library.
require_once('category_function.php');
?>
<?php
echo '<h1>' . $category_name . '</h1>';

// Membuat konfigurasi search.
$search = array();
$search['search_category_id'] = $category_id;
$search['sort_id'] = ORDERBY_PRODUCTNAME;
$search['sort_method'] = SORT_ASCENDING;
$search['count'] = 10;

$reslst = getProductSearchResult($search);

//var_dump($reslst);

echo '<div class="browseproduct">';
if ($reslst != null) {
foreach ($reslst as $res) {
echo '<div>' . getProductBrowse($res) . '</div>';
}
} else {
echo '<p>Tidak ada data.</p>';
}
echo '</div>';

?>
<?php
require_once('end.php');
?>
Loading