index.php
<?php include('include/home/header.php'); ?>
<section>
<div class="container">
<div class="row">
<?php include('include/home/sidebar.php'); ?>
<div class="col-sm-9 padding-right">
<div class="features_items"><!--features_items-->
<h2 class="title text-center">Informasi Harga Pangan</h2>
<!--php starts here-->
<?php
//$filter = isset($_POST['filter']) ? $_POST['filter'] : '';
if(isset($_POST['filter']))
{
$filter = $_POST['filter'];
$result = mysql_query("SELECT * FROM products where Product like
'%$filter%' or Description like '%$filter%' or Category like
'%$filter%'");
}
else
{
$result = mysql_query("SELECT * FROM products");
}
if($result){
while($row=mysql_fetch_array($result)){
$prodID = $row["ID"];
echo '<ul class="col-sm-4">';
echo '<div class="product-image-wrapper">
<div class="productinfo text-center">
<a href="product-details.php?prodid='.$prodID.'" rel="bookmark"
title="'.$row['Product'].'"><img
src="reservation/img/products/'.$row['imgUrl'].'"
alt="'.$row['Product'].'" title="'.$row['Product'].'" width="150"
height="150" /></a>
</a>
<h2><a href="product-details.php?prodid='.$prodID.'"
rel="bookmark"
title="'.$row['Product'].'">'.$row['Product'].'</a></h2>
<h2>'.$row['Price'].'</h2>
<p>Pasar: '.$row['Category'].'</p>
<p>Status Harga: '.$row['Description'].'</p>
</div>';
echo '</ul>';
}
}
?>
<!--php ends here-->
</div>
</div>
</div>
</div>
</div>
</section>
<?php include('include/home/footer.php'); ?>
<?php include('include/home/header.php'); ?>
<section>
<div class="container">
<div class="row">
<?php include('include/home/sidebar.php'); ?>
<?php $filter = isset($_GET['filter']) ? $_GET['filter'] : '';?>
<div class="col-sm-9 padding-right">
<div class="features_items"><!--features_items-->
<h2 class="title text-center">Komoditi Pasar <?php echo
$filter;?></h2>
<br>
<!--php starts here-->
<?php
$result = mysql_query("SELECT * FROM products where Product like
'%$filter%' or Description like '%$filter%' or Category like
'%$filter%'");
if($result){
while($row=mysql_fetch_array($result)){
$prodID = $row["ID"];
echo '<ul class="col-sm-4">';
echo '<div class="product-image-wrapper">
<div class="single-products">
<div class="productinfo text-center">
<a href="product-details.php?prodid='.$prodID.'" rel="bookmark"
title="'.$row['Product'].'"><img
src="reservation/img/products/'.$row['imgUrl'].'"
alt="'.$row['Product'].'" title="'.$row['Product'].'" width="150"
height="150" />
<h2><a href="product-details.php?prodid='.$prodID.'"
rel="bookmark"
title="'.$row['Product'].'">'.$row['Product'].'</a></h2>
<h2>'.$row['Price'].'</h2>
<p>Category: '.$row['Category'].'</p>
<p>Status Harga: '.$row['Description'].'</p>
</div>';
echo '</ul>';
}
}
?>
<!--php ends here-->
</div>
</div>
</div>
</div>
</div>
</section>
<?php include('include/home/footer.php'); ?>
about.php
<?php include('include/home/header.php'); ?>
<section id="form"><!--form-->
<div class="container">
<div class="row">
<div class="col-sm-4 col-sm-offset-1">
<div class="login-form"><!--login form-->
<h2>About</h2>
<h2>08 Mei 2017 07:13</h2>
<address>
<p>Dengan mempertimbangkan bahwa inflasi nasional sebagian besar
dipengaruhi oleh inflasi daerah, maka dipandang perlu untuk
melakukan pemantauan dan pengendalian inflasi di Provinsi Sumatera
Utara. Oleh karena itu dibentuklah Tim Pengendalian Inflasi Daerah
(TPID) Provinsi Sumatera Utara berdasarkan SK Gubernur Sumut No.
188.44/37/KPTS/2010, tanggal 26 Januari 2010 tentang Pembentukan
Tim Pengendalian Inflasi Daerah (TPID) Provinsi Sumatera Utara.
TPID Provinsi Sumatera Utara bertugas untuk:</p>
<p>a. Melakukan pemantauan dan inventarisasi terhadap pelaksanaan
kebijakan yang ditempuh dalam rangka pengendalian inflasi</p>
<p>b. Mengevaluasi sumber-sumber dan potensi tekanan inflasi serta
dampaknya terhadap pencapaian sasaran inflasi</p>
<p>c. Merekomendasikan pilihan kebijakan yang mendukung pencapaian
sasaran inflasi kepada Gubernur Sumatera Utara</p>
<p>d. Melakukan sosialisasi mengenai sasaran dan upaya pencapaian
sasaran inflasi kepada masyarakat</p>
<p>e. Melakukan tugas-tugas lain sehubungan dengan pengendalian
inflasi</p>
<p>f. Menyampaikan laporan hasil pemantauan dan pengendalian
inflasi daerah kepada Gubernur Sumatera Utara</p>
</address>
</div><!--/login form-->
</div></div>
</div>
</section><!--/form-->
<?php include('include/home/footer.php'); ?>
<?php include('include/home/header.php'); ?>
<div id="contact-page" class="container">
<div class="bg">
<div class="row">
<div class="col-sm-12">
<h2 class="title text-center">Kontak <strong>kami</strong></h2>
</div>
</div>
<div class="row">
<div class="col-sm-8">
<div class="contact-form">
<h2 class="title text-center">Beri Komentar</h2>
<div class="status alert alert-success" style="display:
none"></div>
<form id="main-contact-form" class="contact-form row"
name="contact-form" method="post">
<div class="form-group col-md-6">
<input type="text" name="name" class="form-control" required
placeholder="Nama">
</div>
<div class="form-group col-md-6">
<input type="email" name="email" class="form-control" required
placeholder="Email">
</div>
<div class="form-group col-md-12">
<input type="text" name="subject" class="form-control" required
placeholder="Subject">
</div>
<textarea name="message" id="message" required
class="form-control" rows="8" placeholder="Isi pesan Anda disini"></textarea>
</div>
<div class="form-group col-md-12">
<input type="submit" name="submit" class="btn btn-primary
pull-right" value="Kirim">
</div>
</form>
</div>
</div>
<div class="col-sm-4">
<div class="contact-info">
<h2 class="title text-center">Kontak Info</h2>
<address>
<p>Dinas Perindustrian dan Perdagangan Sumatera Utara</p>
<p>Telp: (+6261)4150500</p>
<p>Alamat: Jl.Setia Budi No.10</p>
<p>Email: info@hargasumut.org</p>
</address>
<div class="social-networks">
<h2 class="title text-center">Social Networking</h2>
<ul>
<li>
<a href="#"><i class="fa fa-facebook"></i></a>
</li>
<li>
<a href="#"><i class="fa fa-twitter"></i></a>
</li>
<li>
</li>
<li>
<a href="#"><i class="fa fa-youtube"></i></a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div><!--/#contact-page-->
<?php include('include/home/footer.php'); ?>
login.php
<?php include('include/home/header.php'); ?>
<section id="form"><!--form-->
<div class="container">
<div class="row">
<div class="col-sm-4 col-sm-offset-1">
<div class="login-form"><!--login form-->
<div class="error"></div>
<h2>Administrative Login</h2>
<form>
<input type="text" name="username" placeholder="username"
id="username" required/>
<input type="password" name="password" placeholder="password"
<button type="button" name="submit" class="btn btn-default"
id="login">Login</button>
</form>
</div><!--/login form-->
</div>
</div>
</div>
</section><!--/form-->
<?php include('include/home/footer.php'); ?>
admin.php
<?php include('include/admin/header.php');?>
<section>
<div class="container">
<div class="row">
<?php include('include/admin/sidebar.php');?>
<div class="col-sm-9 padding-right">
<div class="features_items"><!--features_items-->
<h2 class="title text-center">Tabel Harga Komoditi Pasar</h2>
<label for="filter">Cari</label> <input type="text" name="filter"
value="" id="filter" />
<a rel="facebox" href="addproduct.php">Tambah Data</a>
<table cellpadding="1" cellspacing="1" id="resultTable">
<thead>
<tr>
<th style="border-left: 1px solid #C1DAD7"> No </th>
<th> Gambar </th>
<th> Status Harga</th>
<th> Harga Terakhir</th>
<th> Wilayah Pasar </th>
<th> Action </th>
</tr>
</thead>
<tbody>
<?php
include('db.php');
$result = mysql_query("SELECT * FROM products");
while($row = mysql_fetch_array($result))
{
echo '<tr class="record">';
echo '<td style="border-left: 1px solid
#C1DAD7;">'.$row['ID'].'</td>';
echo '<td><a rel="facebox"
href="editproductimage.php?id='.$row['ID'].'"><img
src="reservation/img/products/'.$row['imgUrl'].'" width="80"
height="50"></a></td>';
echo '<td><div align="right">'.$row['Product'].'</div></td>';
echo '<td><div align="right">'.$row['Description'].'</div></td>';
echo '<td><div align="right">'.$row['Price'].'</div></td>';
echo '<td><div align="right">'.$row['Category'].'</div></td>';
echo '<td><div align="center"><a rel="facebox"
href="editproductdetails.php?id='.$row['ID'].'"><i class="fa
fa-edit fa-lg text-success"></i></a> | <a href="#"
id="'.$row['ID'].'" class="delbutton" title="Click To Delete"><i
class="fa fa-times-circle fa-lg text-danger"></i></a></div></td>';
echo '</tr>';
?>
</tbody>
</table>
</section>
<?php include('include/admin/footer.php'); ?>
admincategory.php
<?php include('include/admin/header.php'); ?>
<?php
if(isset($_POST['addcategory'])){
$category = $_POST['category'];
$jim->addcategory($category);
}
?>
<section>
<div class="container">
<div class="row">
<?php include('include/admin/sidebar.php'); ?>
<div class="col-sm-9 padding-right">
<div class="features_items"><!--features_items-->
<h2 class="title text-center">Wilayah</h2>
<form method="POST" action="admincategory.php">
<div class="form-group">
<div class="input-group">
<div class="input-group-addon">Tambah Wilayah:</div>
<input name="category" class="form-control" type="text"
placeholder="...">
</div>
<div class="form-group">
<button type="submit" class="btn"
name="addcategory">Simpan</button>
</div>
</form>
<hr />
<table class="table table-bordered">
<thead class="bg-primary">
<th>Nama</th>
<th colspan="2">Action</th>
</thead>
<tbody>
<?php $category = $jim->getcategory();?>
<?php while($row = mysql_fetch_array($category)):?>
<tr>
<td><?php echo $row['title'];?></td>
<td><a href="editcategory.php?p=edit&&id=<?php echo $row['id'];
?>"><i class="fa fa-edit fa-lg
text-success"></i><small>Edit</small></a></td>
<td><a href="admincategory.php?p=delete&&table=category&&id=<?php
echo $row['id']; ?>" class="confirm"><i class="fa fa-times-circle
fa-lg text-danger"></i> <small>Remove</small></a></td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</section>
logout.php
<?php
session_start();
session_destroy();
header('location:login.php');
?>
addproduct.php
<script type="text/javascript">
function validateForm()
{
var a=document.forms["addproduct"]["pname"].value;
if (a==null || a=="")
{
alert("Pls. Enter the product name");
return false;
}
var b=document.forms["addproduct"]["desc"].value;
if (b==null || b=="")
{
alert("Pls. Enter the product description");
return false;
}
var c=document.forms["addproduct"]["price"].value;
if (c==null || c=="")
{
alert("Pls. enter the price");
}
var d=document.forms["addproduct"]["cat"].value;
if (d==null || d=="")
{
alert("Pls Enter the oroduct category");
return false;
}
var e=document.forms["addproduct"]["image"].value;
if (e==null || e=="")
{
alert("Pls. browse an image");
return false;
}
/*if (c.which!=8 && c.which!=0 && (c.which<48 || c.which>57))
{
alert("The input U enter in Quantity field is not valid, only
numbers are accepted (ex. 1, 2, 3, 4...)");
return false;
}
if (b.which!=8 && b.which!=0 && (b.which<48 || b.which>57))
{
alert("The input U enter in Quantity field is not valid, only
numbers are accepted (ex. 1, 2, 3, 4...)");
return false;
}*/
}
</script>
<style type="text/css">
<!--
border-style:solid;
border-width:thin;
border-color:#00CCFF;
padding:5px;
margin-bottom: 4px;
}
#button1{
text-align:center;
font-family:Arial, Helvetica, sans-serif;
border-style:solid;
border-width:thin;
border-color:#00CCFF;
padding:5px;
background-color:#00CCFF;
height: 34px;
}
-->
</style>
<!--sa input that accept number only-->
<SCRIPT language=Javascript>
<!--
function isNumberKey(evt)
{
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
}
//-->
<form action="addexec.php" method="post"
enctype="multipart/form-data" name="addproduct" onsubmit="return validateForm()">
Nama Barang<br />
<input name="pname" type="text" class="ed" /><br />
Status Harga<br />
<input name="desc" type="text" id="rate" class="ed" /><br />
Harga<br />
<input name="price" type="text" id="qty" class="ed"
onkeypress="return isNumberKey(event)" /><br />
Wilayah<br />
<select name="cat" class="ed">
<?php
include('db.php');
$r = mysql_query("select * from category");
while($row = mysql_fetch_array($r)){
echo '<option>'.$row['title'].'</option>';
}
?>
</select>
Pilih Gambar: <br /><input type="file" name="image" class="ed"><br
/>
<input type="submit" name="Submit" value="simpan" id="button1" />
</form>
deleteprod.php
<?php
// This is a sample code in case you wish to check the username
include('db.php');
if($_GET['id'])
{
$id=$_GET['id'];
$sql = "delete from products where id='$id'";
mysql_query( $sql);
}
?>
editcategory.php
<?php include('include/admin/header.php'); ?>
<?php
$categoryvalue = '';
$categoryID = isset($_GET['id']) ? $_GET['id'] : null;
if(isset($_POST['editcategory'])){
$category = $_POST['category'];
$id = $_GET['id'];
$jim->updatecategory($category,$id);
}
if(isset($_GET['id'])){
$id = $_GET['id'];
$categoryvalue = $jim->getcategorybyid($id);
}
?>
<section>
<div class="container">
<div class="row">
<div class="col-sm-9 padding-right">
<div class="features_items"><!--features_items-->
<h2 class="title text-center">Wilayah Pasar</h2>
<form method="POST" action="editcategory.php?id=<?php echo
$categoryID;?>">
<div class="form-group">
<div class="input-group">
<div class="input-group-addon">Nama Wilayah:</div>
<input name="category" value="<?php echo $categoryvalue; ?>"
class="form-control" type="text" placeholder="...">
</div>
</div>
<div class="form-group">
<button type="submit" class="btn"
name="editcategory">Update</button>
<a href="admincategory.php" class="btn btn-success">Tambah
Wilayah</a>
</div>
</form>
<hr />
<table class="table table-bordered">
<thead class="bg-primary">
<th>Nama Wilayah</th>
<th colspan="2">Action</th>
</thead>
<tbody>
<?php $category = $jim->getcategory();?>
<?php while($row = mysql_fetch_array($category)):?>
<tr>
<td><a href="editcategory.php?p=edit&&id=<?php echo $row['id'];
?>"><i class="fa fa-edit fa-lg
text-success"></i><small>Edit</small></a></td>
<td><a href="admincategory.php?p=delete&&table=category&&id=<?php
echo $row['id']; ?>" class="confirm"><i class="fa fa-times-circle
fa-lg text-danger"></i> <small>Remove</small></a></td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</section>
<?php include('include/admin/footer.php'); ?>
editproductdetails.php
<style type="text/css">
<!--
.ed{
border-style:solid;
border-width:thin;
border-color:#00CCFF;
padding:5px;
margin-bottom: 4px;
}
#button1{
text-align:center;
font-family:Arial, Helvetica, sans-serif;
border-style:solid;
border-color:#00CCFF;
padding:5px;
background-color:#00CCFF;
height: 34px;
}
-->
</style>
<?php
include('db.php');
$id=$_GET['id'];
$result = mysql_query("SELECT * FROM products where ID='$id'");
while($row = mysql_fetch_array($result))
{
$pname=$row['Product'];
$desc=$row['Description'];
$price=$row['Price'];
$cat=$row['Category'];
}
?>
<form action="execeditproduct.php" method="post">
<input type="hidden" name="prodid" value="<?php echo
$id=$_GET['id'] ?>">
Product Name:<br><input type="text" name="pname" value="<?php echo
$pname ?>" class="ed"><br>
Description:<br><input type="text" name="desc" value="<?php echo
$desc ?>" class="ed"><br>
Price:<br><input type="text" name="price" value="<?php echo $price
?>" class="ed"><br>
Category:<br>
<?php
include('db.php');
$r = mysql_query("select * from category");
while($row = mysql_fetch_array($r)){
$selected = ($cat == $row['title']) ? " selected='selected'" : "";
echo '<option '.$selected.'>'.$row['title'].'</option>';
}
?>
</select>
<br>
<input type="submit" value="Update" id="button1">
</form>
editproductimage.php
<?php
include('db.php');
$id=$_GET['id'];
$result = mysql_query("SELECT * FROM products where ID='$id'");
while($row = mysql_fetch_array($result))
{
$image=$row['imgUrl'];
}
?>
<img src="reservation/img/products/<?php echo $image ?>">
<form action="editpicexec.php" method="post"
enctype="multipart/form-data">
<input type="hidden" name="prodid" value="<?php echo
$id=$_GET['id']; ?>">
Select Image
<br>
<input type="file" name="image"><br>
<input type="submit" value="Upload">
</form>
product-details.php
<?php
include("db.php");
if(!empty($prodID)){
$sqlSelectSpecProd = mysql_query("select * from products where id
= '$prodID'") or die(mysql_error());
$getProdInfo = mysql_fetch_array($sqlSelectSpecProd);
$prodname= $getProdInfo["Product"];
$prodcat = $getProdInfo["Category"];
$prodprice = $getProdInfo["Price"];
$proddesc = $getProdInfo["Description"];
$prodimage = $getProdInfo["imgUrl"];
}
?>
<?php include('include/home/header.php'); ?>
<section>
<div class="container">
<div class="row">
<?php include('include/home/sidebar.php'); ?>
<div class="product-details"><!--product-details-->
<div class="col-sm-5">
<div class="view-product">
<img src="reservation/img/products/<?php echo $prodimage; ?>" />
</div>
</div>
<div class="col-sm-7">
<div class="product-information"><!--/product-information-->
<h2 class="product"><?php echo $prodname; ?></h2>
<p>Wilayah Pasar: <?php echo $prodcat; ?></p>
<p>Harga Terkini: <span class="price"><?php echo $prodprice;
?></span></p>
<p>Status Harga: </b><?php echo $proddesc; ?></p>
<br>
<p><b>Contact Info:</b>(+6261)4150500</p>
<p><b>Email:</b> info@hargasumut.org </p>
</div><!--/product-information-->
</div>
</div><!--/product-details-->
</div>
</div>
</div>
</div>
</section>
<?php include('include/home/footer.php'); ?>
<?php
header('Content-type: application/json');
$status = array(
'type'=>'success',
'message'=>'Thank you for contact us. As early as possible we
will contact you '
);
$name = @trim(stripslashes($_POST['name']));
$email = @trim(stripslashes($_POST['email']));
$subject = @trim(stripslashes($_POST['subject']));
$message = @trim(stripslashes($_POST['message']));
$email_from = $email;
$email_to = 'email@email.com';//replace with your email
$body = 'Name: ' . $name . "\n\n" . 'Email: ' . $email . "\n\n" .
'Subject: ' . $subject . "\n\n" . 'Message: ' . $message;
$success = @mail($email_to, $subject, $body, 'From:
<'.$email_from.'>');
echo json_encode($status);
die;
pre { font-family: monospace;}
#Cancel{
background: none repeat scroll 0 0 red;
color:#ffffff;
}
#Active{
background: none repeat scroll 0 0 #F5FAFA;
}
#pagewrap {
margin: 0 auto;
width: 85%;
}
#search {
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
background-color: white;
padding: 10px;
position: fixed;
right:8.8%;
top:3.5%;
display: none;
}
#body {
}
#resultTable {
background-color: white;
margin-top: 8px;
width: 100%;
}
#resultTable th.sortable {
background: url("coba_header.jpg") no-repeat scroll 0 0 #CAE8EA;
border-bottom: 1px solid #C1DAD7;
border-right: 1px solid #C1DAD7;
border-top: 1px solid #C1DAD7;
color: #4F6B72;
font: normal 11px "Trebuchet
MS",Verdana,Arial,Helvetica,sans-serif;
letter-spacing: 2px;
padding: 3px 3px 3px 6px;
text-align: left;
text-transform: uppercase;
color: #666;
cursor: pointer;
text-decoration: none;
}
#resultTable th.sortable:hover { color: black; }
#resultTable th {
background: url("coba_header.jpg") no-repeat scroll 0 0 #CAE8EA;
border-bottom: 1px solid #C1DAD7;
border-right: 1px solid #C1DAD7;
border-top: 1px solid #C1DAD7;
color: #4F6B72;
font: normal 11px "Trebuchet
MS",Verdana,Arial,Helvetica,sans-serif;
letter-spacing: 2px;
padding: 3px 3px 3px 6px;
text-align: left;
color: #666;
cursor: pointer;
text-decoration: none;
}
#resultTable th:hover { color: pink; }
#resultTable th.sorted-asc, th.sorted-desc { color: pink; }
#resultTable td {
border-bottom: 1px solid #C1DAD7;
border-right: 1px solid #C1DAD7;
padding: 3px 3px 3px 6px;
font: normal 11px "Trebuchet
MS",Verdana,Arial,Helvetica,sans-serif;
}
#resultTable td.odd {
font: normal 11px "Trebuchet
MS",Verdana,Arial,Helvetica,sans-serif;
}
#resultTable td.hovered {
background-color: lightblue;
color: #666;
}
#filter{
width: 230px;
border: 1px solid #C1DAD7;
border-left: 4px solid #C1DAD7;
padding:5px;
background-image:url('../images/filter.gif');
background-repeat:no-repeat;
background-position: 3px 5px;
}
#addq{
padding:3px;
text-decoration:none;
color:#000;
}
#mainwrapper{
background: none repeat scroll 0 0 #FFFFFF;
border: 8px solid #EEEEEE;
border-radius: 5px 5px 5px 5px;
box-shadow: 0 0 10px #4E707C;
margin: 5em auto;
position: relative;
text-align: left;
width: 500px;
font: normal 11px "Trebuchet
MS",Verdana,Arial,Helvetica,sans-serif;
}
#mainwrapper h1{
background: none repeat scroll 0 0 #0092C8;
border-bottom: 1px solid #007DAB;
color: #FFFFFF;
font-size: 14px;
margin: 0;
padding: 5px 10px;
text-shadow: 0 1px 0 #007DAB;
}
#mainwrapper h1 a{
color: #FFFFFF;
}
#homecontent{
margin:20px auto;
width:800px;
text-align:center;
}
.clearfix{
clear:both;