NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

Write a note in this area. It's reall<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="bootstrap-3.3.7/dist/css/bootstrap.css">
<script src="assets/jquery.min.js"></script>
<script src="assets/bootstrap.min.js"></script>
<style>
.navbar {
margin-bottom: 0;
border-radius: 0;
}

footer {
background-color: #f2f2f2;
padding: 25px;
}
</style>
</head>
<body>
<?php
include_once("koneksi.php");
// Check If form submitted, insert form data into users table.
if(isset($_POST['Submit'])) {
$kat = $_POST['kategori'];

// Insert user data into table
$result = mysqli_query($mysqli, "INSERT INTO kategori(kategori,flag) VALUES('$kat','1')");
if($result){
echo"<script>
alert('Data Tersimpan');
window.location='index.php';</script>";
}
}
//Proses Edit
if(isset($_GET['id'])){
$id = $_GET['id'];

// Fetech user data based on id
$result = mysqli_query($mysqli, "SELECT * FROM kategori WHERE id=$id");

while($editdata = mysqli_fetch_array($result))
{
$kat = $editdata['kategori'];
}
}else{
$kat="";
}
//Update Data
if(isset($_POST['Update']))
{
$id = $_POST['id'];

$kat=$_POST['kategori'];

// update
$result = mysqli_query($mysqli, "UPDATE kategori SET kategori='$kat' WHERE id=$id");

// Redirect to homepage to display updated user in list
echo"<script>
alert('Data Terupdate');
window.location='index.php';</script>";
}
//Hapus Data
if(isset($_GET['del'])){
// Get id from URL to delete that user
$id = $_GET['id'];

// Delete user row from table based on given id
$xresult = mysqli_query($mysqli, "DELETE FROM kategori WHERE id=$id");

// After delete redirect to Home, so that latest user list will be displayed.
if($xresult){
echo"<script>
alert('Data Terhapus');
window.location='index.php';</script>";
}

}
?>
<div class="container">
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">Inventory</a>
</div>
<ul class="nav navbar-nav">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Data Master
<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Kategori</a></li>
<li><a href="#">Barang</a></li>
<li><a href="#">Supplier</a></li>
<li><a href="#">Customer</a></li>
</ul>
</li>
<li><a href="#">Page 2</a></li>
<li><a href="#">Page 3</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="#"><span class="glyphicon glyphicon-log-in"></span> Logout</a></li>
</ul>
</div>
</nav>
<h3>Kategori Barang</h3>
<form name="fkategori" method="post" action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']);?>">
<div class="form-group">
<label for="exampleInputEmail1">Nama Kategori</label>
<input type="Text" class="form-control" placeholder="Kategori Barang" name="kategori" value="<?php echo $kat;?>">
</div>
<?php
if(isset($_GET['id'])){
$nameButton="Update";
?>
<input type="hidden" name="id" value=<?php echo $_GET['id'];?>>
<?
}else{
$nameButton="Submit";
}?>
<input type="submit" class="btn btn-default" value="Simpan" name="<?php echo $nameButton;?>">
</form>
<div class="bs-example" data-example-id="bordered-table">
<?php
$result = mysqli_query($mysqli, "SELECT * FROM kategori ORDER BY id DESC");
?>
<table class="table table-bordered">
<thead>
<tr>
<th>#</th>
<th>Kategori Barang</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
<?php
$no=0;
while($data = mysqli_fetch_array($result)){
$no++;
?>
<tr>
<th scope="row"><?php echo $no;?></th>
<td><?php echo $data["kategori"];?></td>
<td>[<a href="?id=<?php echo $data["id"];?>">Edit</a>][<a href="?del=1&id=<?php echo $data["id"];?>">Hapus</a>]</td>
</tr>
<?php }?>
</tbody>
</table>
</div>
<footer class="container-fluid text-center">
<p>Aplikasi Inventory PT ABC by : web22019</p>
</footer>
</div>

</body>
</html>
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.