Sie sind auf Seite 1von 6

Css.

css background-color: #45a049;

body{ }

margin: auto; input[type=text]{

} display: inline-block;

#wrap{ border: 1px solid #ccc;

margin : auto; border-radius: 4px;

width : 100%; box-sizing: border-box;

height : 100%; padding: 12px 20px;

padding-top:10px; margin: 8px 0;

} }

#input{ table#tbl2{

position:relative; border-collapse: collapse;

background-color:white; border:1px solid #32b714;

border-radius: 15px;
} }

#tampil{ tr#tr{

position:absolute; height:50px;

margin-left: 30%; background-color: #32b714;

background-color:white; }
td{

} text-align:center;

input[type=submit]{ }

background-color: #32b714; td.td{

height:4%;
color: white; width:75px;

border: 0px; }

width: 5%;
border-radius:10px;
}
input[type=submit]:hover {
Join.php $count =
mysqli_num_rows($query);
<?php
if($count == 0 ){
include "connect.php";
echo "<script
$Query = type='text/javascript'>alert('Data
mysqli_query($conn,"SELECT * from Tidak Ada');</script>";}else{
tblpelanggan INNER JOIN tblinventory
ON tblpelanggan.No = while($row =
tblinventory.No"); mysqli_fetch_array($query)){

$RecordSet = $brg = $row['Nama_Barang'];


mysqli_fetch_array($Query); $kd = $row['Kode'];
echo "No: $un = $row['Unit'];
$RecordSet[No]<br>";
$hrg = $row['Harga'];
echo "id pelanggan:
$RecordSet[id_pelanggan]<br>"; $ds = $row['Diskon'];

echo "nama pelanggan: $tampil = '


$RecordSet[nama_pelanggan]<br>";
<body> <form method="post"
echo "nama barang: action="search.php" >
$RecordSet[Nama_Barang]<br>";
<center>
?>
<input type="text" name="search"
Search.php placeholder="...">

<link rel="stylesheet" type="text/css" <input type="submit" name="submit"


href="../css/css.css"> value="Search">

<?php </center>

include "connect.php"; </form>

$cari = $_POST['search']; <div id="wrap">

if($cari == ''){ <div id="tampil">


<center> <table id="tbl2"
header('Location:form.php'); border="1px solid">

}else{ <tr id="tr">

$cari = <td class="td">Nama Barang</td>


preg_replace("#[^0-9a-z]#i","",$cari); <td class="td">Kode</td>
$query = <td class="td">Unit</td>
mysqli_query($conn,"SELECT * FROM
tblinventory WHERE Nama_Barang <td class="td">Harga</td>
LIKE '%$cari%'");
<td class="td">Diskon</td>
<td class="td">Edit</td> <input type="text" name="unit"
size="15"/>
<td class="td">Hapus</td>
<br/> <br/> Harga <br/> <br/>
<td class="td">Beli</td> </tr>
<input type="text" name="harga"
<tr>
size="15"/>
<td>'.$brg.'</td>
<br/> <br/> Diskon <br/> <br/>
<td>'.$kd.'</td>
<input type="text" name="diskon"
<td>'.$un.'</td> size="15"/>

<td>'.$hrg.'</td> <br/> <br/> <input type="submit"


name="submit" value="SAVE"
<td>'.$ds.'</td> size="15">
<td><a href=edit.php?id=<?php </center></form></div>
echo $data[0]; ?>Edit Data</a></td>
Insert.php
<td><a href=hapus.php?id=<?php
echo $data[0]; ?>Hapus <?php
Data</a></td>
include "connect.php";
<td><a href=beli.php?id=<?php echo
$data[0]; ?>Beli</a></td> $nama = $_POST['nama'];

</tr> </table></center> $kode = $_POST['kode'];

</div> </body>'; print("$tampil"); $unit = $_POST['unit'];

}}} ?> $harga = $_POST['harga'];


$diskon = $_POST['diskon'];
Tambah.php
if($nama == '' || $kode == '' || $unit
<div id="input">
== ''|| $harga == ''){
<form method="POST"
echo "<script
action="insert.php">
type='text/javascript'>alert('Data
<center> Tidak Boleh Kosong');</script>";

Nama Barang <br/> <br/> }else{

<input type="text" name="nama" $sql = "insert into tblinventory


size="15"/> values('','$nama','$kode','$unit','$harg
a','$diskon')";
<br/> <br/>
$query = mysqli_query($conn, $sql);
Kode <br/> <br/>
echo "<script
<input type="text" name="kode" type='text/javascript'>alert('Data
size="15"/> Berhasil Disimpan');</script>"; }
<br/> <br/> Unit <br/> <br/> include"form.php"; ?>
Hapus.php <input type="submit" name="submit"
value="Search">
<?php
</center>
include"connect.php";
</form>
$id=$_GET['id'];
<div id="tampil">
$del = mysqli_query($conn,"delete
from tblinventory where No = '$id'"); <table id="tbl2" border="1px
solid">
if($del){
<tr id="tr">
echo "<script
type='text/javascript'>alert('Data <td
Berhasil Dihapus');</script>"; class="td">No</td>

}else{ echo "Gagal"; } <td class="td">Nama Barang</td>

include"form.php"; ?> <td class="td">Kode</td>


<td class="td">Edit</td>

FORM.php <td class="td">Hapus</td>


<td class="td">Beli</td>
<?php
</tr>
include "connect.php";
<?php
$query2 = "SELECT * FROM
tblinventory"; $BatasAwal = 3;
$sql2 = mysqli_query($conn, if (!empty($_GET['page'])) {
$query2);
$hal = $_GET['page'] - 1;
?>
$MulaiAwal = $BatasAwal * $hal;
<html>
} else if (!empty($_GET['page']) and
<head> <title>...</title> $_GET['page'] == 1) {
<link rel="stylesheet" type="text/css" $MulaiAwal = 0;
href="../css/css.css">
} else if (empty($_GET['page'])) {
</head> <body>
$MulaiAwal = 0; }
<div id="wrap">
$query2 = "SELECT * FROM
<form method="post" tblinventory LIMIT $MulaiAwal,
action="search.php" > $BatasAwal ";
<center> $result = $conn->query($query2);
<input type="text" name="search" while($query_row =
placeholder="..."> mysqli_fetch_assoc($result)){
?> if ($_GET['page'] == $i) {
<tr> }
<td><?php echo $query_row['No']; ? ?>
></td>
</table>
<td><?php echo
<a <?php echo ' href="?page=' . $i . '
$query_row['Nama_Barang']; ?></td>
" '?>><?php echo $i;?></a>
<td><?php echo
<?php
$query_row['Kode']; ?></td>
}}
<td><a href=edit.php?id=<?php
echo $query_row['No']; ?>>Edit ?>
Data</a></td>
</br>
<td><a href=hapus.php?id=<?php
echo $query_row['No']; ?>>Hapus </div></div></body></html>
Data</a></td>
EDIT.php
<td><a href=beli.php?id=<?php echo
<?php
$query_row['No']; ?>>Beli</a></td>
include "connect.php";
</tr>
$id=$_GET['id'];
<?php
$query = mysqli_query($conn,"select
}
* from tblinventory where No = '$id'");
?>
$r = mysqli_fetch_assoc($query);
<?php
?>
error_reporting(0);
<html>
$cekQuery =
<head><title>...</title>
mysqli_query($conn,"SELECT * FROM
tblinventory"); <link rel="stylesheet" type="text/css"
href="../css/csstambah.css">
$jumlahData =
mysqli_num_rows($cekQuery); </head><body>
if ($jumlahData > $BatasAwal) { <form name="editdata"
method="POST"
$a = explode(".", $jumlahData /
action="update.php">
$BatasAwal);
<center>
$b = $a[0];
<input type="hidden" name="id"
$c = $b + 1 ;
value=<?php echo $r['No']; ?> >
for ($i = 1; $i <= $c; $i++) {
<br/> <br/> Nama Barang
echo ' '; <br/> <br/>
<input type="text" name="nama2" $nama=$_POST['nama2'];
value=<?php echo $r['Nama_Barang'];
$kode=$_POST['kode2'];
?>>
$unit=$_POST['unit2'];
<br/> <br/> Kode <br/><br/>
$harga=$_POST['harga2'];
<input type="text" name="kode2"
value=<?php echo $r['Kode']; ?>> $disc=$_POST['diskon2'];
<br/> <br/> Unit <br/> <br/> $id=$_POST['id'];
<input type="text" name="unit2"
value=<?php echo $r['Unit'];?>>
$update =
<br/> <br/> Harga <br/> mysqli_query($conn,"UPDATE
<br/> tblinventory SET Nama_Barang =
'$nama', Kode = '$kode', Unit =
<input type="text" name="harga2"
'$unit', Harga= '$harga', Diskon =
value=<?php echo $r['Harga'];?>>
'$disc' where No = '$id'");
<br/> <br/> Diskon<br/><br/>
if($update){
<input type="text" name="diskon2"
echo "<script
value=<?php echo $r['Diskon'];?>
type='text/javascript'>alert('Data
<br/> <br/> Berhasil Disimpan');</script>";
<input type="submit" name="submit" }else{
value="save" size="15">
echo "<script
</center></form></body></html> type='text/javascript'>alert('Gagal
Memperbaharui');</script>";
UPDATE.php
}
<?php
include "form.php"
include "connect.php";
?>

Das könnte Ihnen auch gefallen