<?php
include "../../inc/inc.koneksi.php";

session_start();

date_default_timezone_set('Asia/Jakarta');

$kode	= $_POST['kode'];
$user	= $_SESSION['username'];
$tgllap	=date('d-m-Y');
$jam	=date('H:i:s');

$sql =mysql_query("SELECT * FROM stock WHERE kode_st= '$kode'");
$r	 =mysql_fetch_assoc($sql);
$namast=$r['nama_st'];

mysql_query("DELETE FROM stock WHERE kode_st='$kode'");

mysql_query("INSERT INTO log_history (user,tanggal,jam,aktivitas,no_bukti,nama_st,keterangan) VALUES('$user','$tgllap','$jam','HAPUS DATA BARANG','','$namast','')");
?>