<?php
session_start();
include_once('../config/#Config.php');
if(!$_SESSION['UserName']){
die('<script>window.location.href=\''.$config['site']['url'].'index.php\';</script>');
} else {
$get_AD = mysqli_query($conn, "Select * From config_admin WHERE Account = '".$_SESSION['UserName']."'");
if(!mysqli_num_rows($get_AD)){
	die('Không đủ quyền.');
}
$image = "";
if($_POST['c']){
	$image = $_POST['c'];
}
$money = 0;
$TienThat = 0;
if($_POST['d'] == 0){
	$money = $_POST['e'];
}
if($_POST['d'] == 1){
	$TienThat = $_POST['e'];
}
mysqli_query($conn, "INSERT INTO logs_user (ItemID,Count,Images,Money,TienThat) VALUES ('".$_POST['a']."','".$_POST['b']."','$image','$money','$TienThat')");
die('0');
}
?>