3 // cheatfix, moznost prelievania user_k a k_walletu.
5 global $db,$node,$error;
6 $user_id=$_SESSION['user_id'];
7 $k_request=mysql_real_escape_string($_POST['k_wallet']);
9 $kset=$db->query("select user_k from users where user_id='$user_id'");
11 $user_k=$kset->getString('user_k');
13 $kset=$db->query("select k_wallet from users where user_id='$user_id'");
15 $k_wallet=$kset->getString('k_wallet');
17 $k_request = (int) $k_request; //integer only..
21 if (($k_wallet+(-1*$k_request)) < 0 or ($user_k-(-1*$k_request)) < 0 or (!$k_request)) {
22 $error="Chybne zadanie alebo na to proste nemas:-)";
26 $db->query("update users set k_wallet=k_wallet+(-1*$k_request) , user_k=user_k-(-1*$k_request) where user_id='$user_id'");