<?php
session_start();
include_once("../../../../../lib/konfig.php");
include_once("../../../../../lib/function.php");
$MySQLi = new MySQLi($strDBHostName, $strDBUsername, $strDBPassword, $strDBName);
//if (isset($_GET['data'])) {
$query = "UPDATE tpc_d_lpbj 
			SET stsAktif=0, 
				dtUpdate=NOW(), 
				usrUpdate='" . $_SESSION['strEmailREQ'] . "'
			WHERE ID='" . $_POST['rowid'] . "'
			";
$MySQLi->query($query);
if ($MySQLi->affected_rows == 1) {
    $strBuffer = str_replace('"', '`', str_replace("'", "`", $query));
    $query = "INSERT INTO tpc_log 
				SET strPCHostname='" . gethostbyaddr(getIPv4()) . "', 
					strIPv4='" . getIPv4() . "', 
					strPort='" . $_SERVER['REMOTE_PORT'] . "', 
					strTable='tpc_d_lpbj', 
					strQuery='" . $strBuffer . "', 
					strKeterangan='" . $_SESSION['strEmail'] . " Berhasil menghapus detail LPBJ : " . $_SESSION['strKdLPBJ'] . "', 
					dtCreate=NOW(), 
					usrCreate='" . $_SESSION['strEmail'] . "' 
				";
    $MySQLi->query($query);
    echo '<script type="text/javascript">';
    echo 'alert(\'berhasil dihapus \');';
    echo 'location.href = \'http://' . $strNmDomain . '/home/index.php?menu=tambah-lpbj&lpbj=' . $_SESSION['strKdLPBJ'] . '\';';
    echo '</script>';
}
//}
