<?php
$pagename= "Give Credits";
if (!defined('IN_HK') || !IN_HK)
{
	exit;
}

if (!HK_LOGGED_IN || !$users->hasFuse(USER_ID, 'fuse_admin'))
{
	exit;
}

$data = null;
$u = 0;

if (isset($_POST['credits']))
{
	$user = filter($_POST['user']);
	$amount = filter($_POST['credits']);
	dbquery("UPDATE users SET credits = credits + ".$amount." WHERE username = '".$user."' LIMIT 1");
	
	$msg = "You gave ".$user." ".$amount." Credits.";
	
	$get = dbquery("SELECT * FROM users WHERE username = '".$user."' LIMIT 50");
	$user = mysql_fetch_assoc($get);
	$core->Mus('updateCredits', $user['id']);	

	

	}	
	


require_once "top.php";
?>
<h3><?php echo $pagename; ?></h3>
            <div class="box-content">

<?php if(isset($msg)){ ?><?php echo $msg; ?><?php } ?><br>
	
<form method='post' name'credits' action='index.php?_cmd=givecredits&do=give'>
	
		<h2>Username:</h2>
		<input type="text" name="user"><br />
		<br />
		<h2>Credits:</h2>
		<input type="text" name="credits">
								    </select><br />
		<br />
		<input type="submit" value="Give Credits">
	</form>

        
    </div>

<?php

require_once "bottom.php";

?>