<?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.');
}
?>	
<script>
function ShowHide(){
	if($('#goinap').val() == "Card"){
		$('#napdientu').hide();
		$('#napcard').show();
	} else if($('#goinap').val() == "Bank" || $('#goinap').val() == "MoMo"){
		$('#napcard').hide();
		$('#napdientu').show();
	} 
}
</script>
		    <label>Loại</label>
		    <div class="form-group pass_show"> 
               <select class="form-control" id="goinap" onChange="ShowHide();">
			   	<option value="Card">-- Card --</option>
			   <option value="Bank">--Ngân Hàng --</option>
			   <option value="MoMo">-- MoMo --</option>
			   </select>
            </div> 
			<div id="napcard">
		    <label>Chọn Mệnh giá</label>
		    <div class="form-group pass_show"> 
               <select class="form-control" id="menhgia">
			   <option value="0">-- Chọn Mệnh Giá --</option>
			   <option value="50000">50.000VNĐ</option>
			   <option value="100000">100.000VNĐ</option>
			   <option value="200000">200.000VNĐ</option>
			   <option value="500000">500.000VNĐ</option>
			   <option value="1000000">1.000.000VNĐ</option>
			   </select>
            </div> 
			</div>
			<div id="napdientu" style="display:none">
		    <label>Số Tiền</label>
		    <div class="form-group pass_show"> 
               <input type="text" class="form-control" id="menhgiatunhap"/>
            </div> 
        </div>
        <!-- Modal footer -->
        <div class="modal-footer">
          <button type="button" class="btn btn-danger" onClick="ChuyenNapTK();">Chuyển ngay</button>
        </div>
        <Script>
		function ChuyenNapTK(){
			$.post('ajax/ajax_chuyennap.php', {user:'<?=$_POST['user']?>',id:$('#nhanvat').val(),sv:'<?=$_POST['sv']?>',goinap:$('#goinap').val(),menhgia:$('#menhgia').val(),menhgiatunhap:$('#menhgiatunhap').val()}, function(data){
		if(data['type'] == 0){
toastr.success(data['text'], 'Chú ý', {timeOut: 5000});
		} else {
toastr.info(data['text'], 'Chú ý', {timeOut: 5000});
		}
	},'json');
		}
		</script>
				   