Vreau sa caut item dupa bns care este pe el
Multumesc.
Cod: Selectaţi tot
<?php
$db_ip = "xxxxxxx"; //<--Aici v-a scrieti IP-ul pe care la-ti scris si la navicat
$db_login = "xxxxxx"; //<--Aici introduceti numele de logare folosit in navicat
$db_pw = "xxxxxxx"; //<--Aici introduceti parla folosita in navicat
echo "<title>Metin2 Item-Manager</title>";
if (isset($_GET["resume"]))
{
$id = $_POST['vnum'];
if ($_POST['password'] == "pune parola"){ //<-- In loc de "ParolaLaAlegere" alegeti o alta parola pe care doar dumneavoastra sa o stiti!
$con = mysql_connect($db_ip, $db_login, $db_pw);
mysql_select_db("player", $con);
$res_update = mysql_query("UPDATE item SET
attrtype0 = '".$_POST['selected_type_0']."',
attrtype1 = '".$_POST['selected_type_1']."',
attrtype2 = '".$_POST['selected_type_2']."',
attrtype3 = '".$_POST['selected_type_3']."',
attrtype4 = '".$_POST['selected_type_4']."',
attrtype5 = '".$_POST['selected_type_5']."',
attrtype6 = '".$_POST['selected_type_6']."',
attrvalue0 = '".$_POST['selected_value_0']."',
attrvalue1 = '".$_POST['selected_value_1']."',
attrvalue2 = '".$_POST['selected_value_2']."',
attrvalue3 = '".$_POST['selected_value_3']."',
attrvalue4 = '".$_POST['selected_value_4']."',
attrvalue5 = '".$_POST['selected_value_5']."',
attrvalue6 = '".$_POST['selected_value_6']."'
WHERE id = '".$id."'");
echo "
<BR CLEAR=HEIGHT>
<div id='item_manager'><form name='post' method='post' action='item_manager.php?resume'>
<table frame='box' width='100%' align='left' class=''>
<tr>
<td colspan='2'><h2 style='color:#A4A4A4' align='left'><b>Metin2 Item-Manager</b></h1></td>
</tr>
</table>
</div>";
exit("<center>Toate schimbarile au fost actualizate! <a href='item_manager.php?id=".$id."'><< zurück</a></center>");
}else{exit("<center>Parola introdusa nu este corecta! <a href='item_manager.php?id=".$id."'><< zurück</a></center>");}
}
if (isset($_GET["id"]))
{
echo "
<BR CLEAR=HEIGHT>
<div id='item_manager'><form name='post' method='post' action='item_manager.php?resume'>
<table frame='box' width='100%' align='left' class=''>
<tr>
<td colspan='2'><h2 style='color:#A4A4A4' align='left'><b>Metin2 Item-Manager</b></h1></td>
</tr>
</table>
</div>
<br>
<table width='100%' align='left' border=0>
<tr>
<th align='left' height='25px'></th>
</tr>
</table>
<br>
";
$con = mysql_connect($db_ip, $db_login, $db_pw);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("player", $con);
$id = $_GET["id"];
$result_item = mysql_query("SELECT * FROM item WHERE id='".$id."'");
if (mysql_num_rows($result_item) != 1) {exit("ID-ul Itemului nu este valabil!");}
while($row = mysql_fetch_array($result_item))
{
echo "
<table frame='box' width='400px' align='left' cellspacing='0' cellpadding='0'>
";
$vnum = $row['vnum'];
$window = $row['window'];
$result_owner = mysql_query("SELECT * FROM player WHERE id ='".$row['owner_id']."'");
while($row = mysql_fetch_array($result_owner))
{
$owner_name = $row['name'];
}
$result_item_name = mysql_query("SELECT * FROM item_proto WHERE vnum ='".$vnum."'");
while($row = mysql_fetch_array($result_item_name))
{
$item_name = $row['hongkongname'];
}
echo "
<tr>
<td>Name:</td>
<td>".$item_name."</td>
</tr>
<tr>
<td>Besitzer:</td>
<td>".$owner_name."</td>
</tr>
<tr>
<td>ID:</th>
<td>".$id."</th>
<input type='hidden' name='id' value='".$id."'>
</tr>
<tr>
<td>vnum:</th>
<td>".$vnum."</th>
</tr
";
if ($window == "INVENTORY"){$state = "in Inventar";}
if ($window == "EQUIPMENT"){$state = "Echipat";}
if ($window == "SAFEBOX"){$state = "in Depozit";}
echo "
<tr>
<td>Status:</th>
<td>".$state."</th>
</tr
</table>
<br>
<table width='100%' align='left' border=0>
<tr>
<th align='left' height='25px'></th>
</tr>
</table>
<br>
";
show_bonipanel($id);
//echo "<table width='400px' align='right' cellspacing='0' cellpadding='0'><tr><td align='right'><input name='resume' value='Übernehmen' type='submit' class='button'></td></tr></table>";
}
}
else
{
echo "ERROR: Nici un Item-ID!";
}
function show_bonipanel($id)
{
$result_item = mysql_query("SELECT * FROM item WHERE id='".$id."'");
while($row = mysql_fetch_array($result_item))
{
$dropdown_options_0;
$dropdown_options_1;
$dropdown_options_2;
$dropdown_options_3;
$dropdown_options_4;
$dropdown_options_5;
$dropdown_options_6;
$line = 0;
$attr_list = file("attr_list.txt");
//while($line < key($attr_list)+1)
while($attr_list[$line])
{
$exploded = explode(" - ", $attr_list[$line]);
$type_id = $exploded[0];
$type_name = $exploded[1];
if ($type_id == $row['attrtype0']){$dropdown_options_0 = $dropdown_options_0."<option value ='".$type_id."' selected='selected'>".$type_name."</option>";}else{$dropdown_options_0 = $dropdown_options_0."<option value ='".$type_id."'>".$type_name."</option>";}
if ($type_id == $row['attrtype1']){$dropdown_options_1 = $dropdown_options_1."<option value ='".$type_id."' selected='selected'>".$type_name."</option>";}else{$dropdown_options_1 = $dropdown_options_1."<option value ='".$type_id."'>".$type_name."</option>";}
if ($type_id == $row['attrtype2']){$dropdown_options_2 = $dropdown_options_2."<option value ='".$type_id."' selected='selected'>".$type_name."</option>";}else{$dropdown_options_2 = $dropdown_options_2."<option value ='".$type_id."'>".$type_name."</option>";}
if ($type_id == $row['attrtype3']){$dropdown_options_3 = $dropdown_options_3."<option value ='".$type_id."' selected='selected'>".$type_name."</option>";}else{$dropdown_options_3 = $dropdown_options_3."<option value ='".$type_id."'>".$type_name."</option>";}
if ($type_id == $row['attrtype4']){$dropdown_options_4 = $dropdown_options_4."<option value ='".$type_id."' selected='selected'>".$type_name."</option>";}else{$dropdown_options_4 = $dropdown_options_4."<option value ='".$type_id."'>".$type_name."</option>";}
if ($type_id == $row['attrtype5']){$dropdown_options_5 = $dropdown_options_5."<option value ='".$type_id."' selected='selected'>".$type_name."</option>";}else{$dropdown_options_5 = $dropdown_options_5."<option value ='".$type_id."'>".$type_name."</option>";}
if ($type_id == $row['attrtype6']){$dropdown_options_6 = $dropdown_options_6."<option value ='".$type_id."' selected='selected'>".$type_name."</option>";}else{$dropdown_options_6 = $dropdown_options_6."<option value ='".$type_id."'>".$type_name."</option>";}
$line++;
}
echo "
<table frame='box' width='400px' align='left' cellspacing='0' cellpadding='0'>
<tr>
<td>1.</td>
<td><select name = selected_type_0>".$dropdown_options_0."</select></td>
<td><input type='text' name='selected_value_0' value='".$row['attrvalue0']."' maxlength='6' class='textbox' style='width: 100px;'></td>
</tr>
<tr>
<td>2.</td>
<td><select name = selected_type_1>".$dropdown_options_1."</select></td>
<td><input type='text' name='selected_value_1' value='".$row['attrvalue1']."' maxlength='6' class='textbox' style='width: 100px;'></td>
</tr>
<tr>
<td>3.</td>
<td><select name = selected_type_2>".$dropdown_options_2."</select></td>
<td><input type='text' name='selected_value_2' value='".$row['attrvalue2']."' maxlength='6' class='textbox' style='width: 100px;'></td>
</tr>
<tr>
<td>4.</td>
<td><select name = selected_type_3>".$dropdown_options_3."</select></td>
<td><input type='text' name='selected_value_3' value='".$row['attrvalue3']."' maxlength='6' class='textbox' style='width: 100px;'></td>
</tr>
<tr>
<td>5.</td>
<td><select name = selected_type_4>".$dropdown_options_4."</select></td>
<td><input type='text' name='selected_value_4' value='".$row['attrvalue4']."' maxlength='6' class='textbox' style='width: 100px;'></td>
</tr>
<tr>
<td>6.</td>
<td><select name = selected_type_5>".$dropdown_options_5."</select></td>
<td><input type='text' name='selected_value_5' value='".$row['attrvalue5']."' maxlength='6' class='textbox' style='width: 100px;'></td>
</tr>
<tr>
<td>7.</td>
<td><select name = selected_type_6>".$dropdown_options_6."</select></td>
<td><input type='text' name='selected_value_6' value='".$row['attrvalue6']."' maxlength='6' class='textbox' style='width: 100px;'></td>
</tr>
<tr>
<td></td>
<td align='right'>Parola: <input type='password' name='password' class='textbox' style='width: 100px;'></td>
<td align='right'><input name='resume' value='Accepta' type='submit' class='button'></td>
</tr>
</table>
";
}
}
?>



