По принцип модула не е готов на 100% и макар и да работи ще продължа да го развивам когато имам време, защото идеята е съвсем друга и трябва да работи и за нови версии и ресурси/джевели, които в бъдеще да си добавите само с въвеждане на хекса и името на колонката, в която да депозира през админ панел за управление.
Всички, които искат да се включат с ъпдейти са добре дошли за общото фри-благо
Всички, които искат да се включат с ъпдейти са добре дошли за общото фри-благо
PHP:
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="bank.css">
</head>
<center>
<?php
////////////////////////////////////////////////////////
//////////////////////////////// Created /////////////
// Jewels Depositor v0.2 ///// for ////////////////
////// by r00tme //////////// DarkSteam///////////////
////// 01/09/2015 //////////////////////////////////////
//////////////////////////http://darksteam.net///
include('jewel_funcs.php');
$your_table = '[DPWeb_JewelDeposit]';
$your_acc = 'memb___id';
$your_session = 'dt_username';
//*Important => The whole script works with this base and needs to be filled correctly!
$jewels_base = array(/* Jewel Name*/ /*Jewel Hex*/ /* Jewel Column*/ /*first four*/
array('bless', 'CD00FF00000000800000', 'bless', 'CD00' ),
array('soul' , 'CE00FF00000000800000', 'soul', 'CE00' ),
array('life', 'D601FF00000000800000', 'life', 'D601' ),
array('creation', 'D001FF00000000800000', 'creation', 'D001' ),
array('rena', 'D500FF00000000800000', 'rena', 'D500' ),
array('chaos', '8F00FF00000000800000', 'chaos', '8F00' ),
array('guardian', 'DF00FF00000000800000', 'guardian', 'DF00' ),
array('stone', 'D508FF00000000800000', 'stone', 'D508' ),
array('secret', '9A00FF00000000800000', 'secret', '9A00' ),
array('blessmix1', '9E00FF00000000800000', 'blessmix1', '9E00' ),
array('blessmix2', '9E08FF00000000800000', 'blessmix2', '9E08' ),
array('blessmix3', '9E10FF00000000800000', 'blessmix3', '9E10' ),
array('soulmix1', '9F00FF00000000800000', 'soulmix1', '9F00' ),
array('soulmix2', '9F08FF00000000800000', 'soulmix2', '9F08' ),
array('soulmix3', '9F10FF00000000800000', 'soulmix3', '9F10' )
);
define('ITEM_LENGTH', 20);
define('WAREHOUSE_LENGTH', 1200);
$type = secure($_POST["type"]);
$count = secure($_POST["count"]);
$username = $_SESSION[''.$your_session.''];
$queryonline = mssql_num_rows(mssql_query("Select * from MEMB_STAT where memb___id='{$username}' and connectstat='1'"));
for( $i= 0 ; $i <= count($jewels_base)-1 ; $i++ ){
if ($type == $jewels_base[$i][0]){
$jewels_name =$jewels_base[$i][0];
$jewels_hex = $jewels_base[$i][1];
$jewels_column = $jewels_base[$i][2];
$jewels_4 = $jewels_base[$i][3];
}
}
echo "<div class='general'>";
if($_POST['deposit']){
if( $queryonline == 1){
echo "You can't deposit now, leave the game first";
}
else{
$warehouse = market_warehouse($username);
foreach($warehouse as $item){
for( $i= 0 ; $i <= count($jewels_base)-1 ; $i++ ){
if ($type == $jewels_base[$i][0]){
$jewels_name =$jewels_base[$i][0];
$jewels_hex = $jewels_base[$i][1];
$jewels_column = $jewels_base[$i][2];
$jewels_4 = $jewels_base[$i][3];
if($item['hex'] == $jewels_4){
$jewela++;
}
}
}
}
if($type == $jewels_name && $jewela>= $count && $jewela>0 && $count>0){
$warehouse = market_warehouse($username);
$counter = 0;
foreach($warehouse as $item){
if($item['hex'] == $jewels_4){
$item_position = $item['item_position'];
$item_length = ITEM_LENGTH;
$current_items = warehouse_items($username);
$items = substr($current_items,2);
$i = -1;
$num=0;
while($i < 119){
$i++;
if($i == $item_position && $num==0)
{
$items= substr_replace($items,str_repeat('F',$item_length),($i*$item_length), $item_length);
$num++;
}
}
mssql_query("UPDATE [warehouse] SET [items]=0x".$items." WHERE [AccountId]='".$username."'");
$counter++;
if($counter == $count)
{
break;
}
}
}
mssql_query("UPDATE ".$your_table." SET ".$jewels_column."=".$jewels_column."+".$count." WHERE ".$your_acc."='".$username."'");
echo "<span class='success'>Your deposit was sucessfull</span>";
}
elseif(empty($count)){
echo"<span class='error'>Do not leave empty fields!</span>";
}
else {
echo "<span class='error'>You dont have these jewels!</span>";
}
}
}
if($_POST['withdraw']){
if( $queryonline == 1){
echo "You can't withraw now, leave the game first";
}
else{
$jewels = mssql_fetch_array(mssql_query("select * from ".$your_table." where ".$your_acc."='".$username."'"));
if($type==$jewels_name && $jewels[''.$jewels_name.'']>=$count && $jewels[''.$jewels_name.'']>0 && $count > 0){
for($i = 0;$i<$count;$i++)
{
$item_length = ITEM_LENGTH;
$query = mssql_fetch_row(mssql_query("exec WZ_GetItemSerial"));
$serial = sprintf("%08X", $query[0], 00000000);
$mycuritems = warehouse_items($username);
$newitems = $jewels_hex;
$newitem = str_replace("00000000", $serial, $newitems);
$slot = smartsearch($mycuritems,1,1);
$test = $slot * $item_length;
if ($slot==1337)
{
echo "<span class='error'>Not enough free space in the vault!</span>";
break;
}
else
{
$mynewitems = substr_replace($mycuritems, $newitem, ($test+2), $item_length);
mssql_query("
UPDATE [warehouse] SET [Items]=".$mynewitems." WHERE [AccountId]='".$username."';
UPDATE ".$your_table." set ".$jewels_column."= ".$jewels_column."-1 WHERE ".$your_acc."='".$username."';");
}
}
echo "<span class='success'>Your withdrawal was sucessfull</span>";
}
elseif(empty($count)){
echo"<span class='error'>Do not leave empty fields!</span>";
}
else{
echo "<span class='error'>You dont have these jewels!</span>";
}
}
}
echo "<div class='relative'>";
echo "<table class='table' border='1' align='left'>
<tr>
<td class='tdhead' colspan='2'>Web Bank Jewels</td>
</tr>";
for( $i= 0 ; $i <= count($jewels_base)-1 ; $i++ ){
$jewels_name = $jewels_base[$i][0];
$jewels_column = $jewels_base[$i][2];
$jewel_count = 0;
$select_bank = mssql_fetch_array(mssql_query("select * from ".$your_table." where ".$your_acc."='".$username."'"));
if ($select_bank[''.$jewels_column.''] == null ){
$select_bank[''.$jewels_column.''] = 0;
}
else {
$select_bank[''.$jewels_column.'']= $select_bank[''.$jewels_column.''];
}
echo "
<tr><td class='td'>" . $jewels_name . " </td><td class='tdinf'>".$select_bank[''.$jewels_column.'']."</td></tr>";}
echo "
</table>
<table align='left' class='table_mid' >
<form method='post'>
<tr>
<td class='tdhead' width='50px'>Count</td>
<td class='tdhead' width='100px'>Jewel</td>
<td class='tdhead' colspan='2' width='100px'>Action</td>
</tr>
<tr><td class='td'><input type='number' min='1' max='500' name='count'/></td>
<td class='td'> <select name='type' id='type'> ";
for( $i= 0 ; $i <= count($jewels_base)-1 ; $i++ ){
$jewels_name = $jewels_base[$i][0];
echo "<option value='".$jewels_name."'> Jewel Of ".$jewels_name." </option>";}
echo "</select>
<td class='td'>
<input type='submit' class='putoni' name='deposit' value='Deposit'/></td>
<td class='td'>
<input type='submit' class='putoni' name='withdraw' value='Withdraw'/></td>
</tr>
</form>
</table>
<table class='table' border='1' align='left'>
<tr><td class='tdhead' colspan='2'>Warehouse Jewels</td></tr>";
for( $i= 0 ; $i <= count($jewels_base)-1 ; $i++ ){
$jewels_name = $jewels_base[$i][0];
$jewels_4 = $jewels_base[$i][3];
$jewel_count = 0;
$warehouse = market_warehouse($username);
foreach($warehouse as $item){
if($item['hex'] == $jewels_4){
$jewel_count++;
}
}
echo "<tr><td class='td'>".$jewels_name."</td><td class='tdinf'> ".$jewel_count."</td></tr>";
}
echo "</table>";
echo "</div>";
?>
<style>
.general{
position:absolute;
margin-top:10px;
background:#000000;
border-radius:10px 10px 10px 10px;
width:600px;
height:500px;
border:2px solid #555;
text-align:center;
}
.relative{
margin-top:10px;
margin-left:15px;
}
</style>
Attachments
Last edited: