You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
940 B
PHP
31 lines
940 B
PHP
<?php
|
|
session_start();
|
|
if($_SESSION['validUser'] !== TRUE)
|
|
{
|
|
header("location: ./index.php");
|
|
exit();
|
|
}
|
|
|
|
if(isset($_POST['kbarang']) && isset($_POST['nomor']) && isset($_POST['jumlah']) && isset($_POST['idtransfer']))
|
|
{
|
|
require_once("../db_login.inc.php");
|
|
$kode = $_POST['kbarang'];
|
|
$jumlah = $_POST['jumlah'];
|
|
$harga = $_POST['harga'];
|
|
$no = $_POST['nomor'];
|
|
$transfer_id = $_POST['idtransfer'];
|
|
$hasil = 0;
|
|
$mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE);
|
|
if(!mysqli_connect_errno())
|
|
{
|
|
$stmt = $mysqli->prepare("DELETE FROM d_transfer WHERE id_transfer = ? AND kode_barang_nota = ? AND jumlah = ? AND harga_satuan = ? AND nomor = ? LIMIT 1");
|
|
$stmt->bind_param("isiis",$transfer_id, $kode, $jumlah, $harga, $no);
|
|
$stmt->execute();
|
|
if($stmt->affected_rows > 0) $hasil = 1;
|
|
else $hasil = 0;
|
|
$stmt->close();
|
|
}
|
|
$harray = array('hasil' => $hasil);
|
|
echo json_encode($harray);
|
|
}
|
|
/* end file */ |