Пример #1
0
             case 5129:
                 $attrtype0 = 72;
                 $attrvalue0 = 1;
                 $attrtype1 = 71;
                 $attrvalue1 = 1;
                 break;
             default:
                 $attrtype0 = 0;
                 $attrvalue0 = 0;
                 $attrtype1 = 0;
                 $attrvalue1 = 0;
                 break;
         }
         $tot = $rows['prices'] - $rows['prices'] * $rows['rebate'] / 100;
         $precio_final = number_format($tot, 0);
         if ($class->get_coins($_SESSION['id']) >= $precio_final) {
             $insertar = mysqli_query($class->conexion(), "INSERT INTO player.item (id,vnum,owner_id,window,pos,socket0,socket1,socket2,count,attrtype0,attrvalue0,attrtype1,attrvalue1) values (" . $id . ",'" . $vnum . "','" . $_SESSION["id"] . "','MALL','" . $pos . "','" . $socket0 . "','" . $socket1 . "','" . $socket1 . "','" . $rows['count'] . "','" . $attrtype0 . "','" . $attrvalue0 . "','" . $attrtype1 . "','" . $attrvalue1 . "')");
             if ($insertar) {
                 //// INSERTAR LOG DE LA COMPRA
                 $log = mysqli_query($class->conexion(), "INSERT INTO player.logs (fecha,account_id,vnum,prices,ip) values ('" . $date . "','" . $_SESSION["id"] . "','" . $vnum . "','" . $precio_final . "','" . $ip . "')");
                 /// DESCONTAR COINS
                 $desc = mysqli_query($class->conexion(), "UPDATE account.account set coins = coins - '" . $precio_final . "' where id='" . $_SESSION["id"] . "' limit 1");
                 /// AUMENTAR JCOINS
                 $aume = mysqli_query($class->conexion(), "UPDATE account.account set jcoins = jcoins + '" . $precio_final . "' where id='" . $_SESSION["id"] . "' limit 1");
                 echo $class->get_coins_joins_json($_SESSION['id']);
             } else {
                 return false;
             }
         }
     }
 }