<?php
session_start();
include_once('../../config/#Config.php');
if(!$_SESSION['UserName']){
die('<script>window.location.href=\''.$config['site']['url'].'index.php\';</script>');
}
$get_AD = mysqli_query($conn, "Select * From config_admin WHERE Account = '".$_SESSION['UserName']."'");
if(!mysqli_num_rows($get_AD)){
	die('Không đủ quyền.');
}
$getinfo = mysqli_query($conn, "Select * From duatop_setting WHERE ID = '".$_POST['idevent']."'");
?>
<style>
.discount {
    position: absolute;
    margin-left: 30px;
    margin-top: -25px;
    border: 2px solid #f15a21;
    border-radius: 100px 0 0 100px;
    padding: 2px;
    width: 50px;
    height: 23.5px;
}
.discount p {
    background: #f15a21;
    border-radius: 100px 0 0 100px;
    text-align: center;
    line-height: 0!important;
    font-size: .9em!important;
    padding: 7px;
}
.discount span {
    color: #fff;
    font-size: 11px;
    text-align: center;
    display: inline-block;
    font-weight: 700;
}
</style>
		    <label>Vị Trí Bắt Đầu</label>
            <div class="form-group pass_show"> 
                <input type="text" value=""  id="duatop_vitri_a" class="form-control datepicker hasDatepicker" placeholder="1"> 
            </div>
			<label>Vị Trí Kết Thúc</label>
            <div class="form-group pass_show"> 
                <input type="text" value=""  id="duatop_vitri_b" class="form-control datepicker hasDatepicker" placeholder="1"> 
            </div>
			
		       <label>Phần Thưởng</label>
            <div class="form-group pass_show"> 
                <input type="text" value=""  id="duatop_vatpham" class="form-control datepicker hasDatepicker" placeholder="vatpham,soluong"> 
            </div>			
			            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Tắt</button>
                <button type="button" class="btn btn-primary" onClick="TaoViTriTOP();">Tạo</button>
            </div>
			<script>
			function TaoViTriTOP(){
				$.post('ajax/duatop_taovitri.php', {id:'<?=$_POST['idevent']?>',start:$('#duatop_vitri_a').val(),end:$('#duatop_vitri_b').val(),phanthuong:$('#duatop_vatpham').val()}, function(data){
					if(data == 0){
						                toastr.success("Thêm thành công.", 'Thông Báo');
					} else {
						                toastr.info(data, 'Thông Báo');
					}
$.post('from/panel_list_duatop_vitri.php', {idevent:'<?=$_POST['idevent']?>'}, function(data){
$('#infoUserLogs').html(data);
});
				});
			}
			</script>
					   