<?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.');
}
?>
                  <h4 class="card-title">Cập nhật Rank</h4>
				          <select id="sv" class="form-control">
							<?php
							    $get_Maychu = mysqli_query($conn, "Select * From config_server");
    if (mysqli_num_rows($get_Maychu)) {
		while($row = mysqli_fetch_array($get_Maychu, MYSQLI_ASSOC)){
		echo '<option value="'.$row['ServerID'].'">'.$row['ServerName'].'</option>';
	}
	}
		?>						  
						  </select>
<hr />							
                             <input type="submit" class="form-control" onClick="ajax_rank()" value="Gửi" style="width:120px;float:right">						
<script>
function ajax_rank(){
		$.post('ajax_rank.php', {
		sv:$('#sv').val()
		}, function(data){
			if(data == 0){
Lobibox.notify('success', {size: 'mini',msg: "Thành công."});							
			} else {
Lobibox.notify('error', {size: 'mini',msg: data});							
			}
		});
}
</script>				  
		   