CK php function berakás

Started by Nexus™, 2017-06-04, 10:12:00

2017-06-04, 10:12:00 Last Edit: 2017-06-04, 10:30:39 by Nexus™
Üdv. Azt szeretném megoldani a CK rendszerbe, hogy ha kiválasztok 1 optot, akkor a mellette lévő négyzetbe azonnal bele tegye a maximum beállított értéket. (Ezzel azt szeretném elérni, hogy ne tudjanak mások valamilyen ismeretlen buggal, nagyobb optot bele tenni.)

Erre gondolok:



És ilyen nekem:



Nos ezt valami ilyesmivel kellene megcsinálni, kilestem a FreeMetin2 CK Lite "view-source" -ből, és ilyet találtam:

<script language="JavaScript1.2">
function updateInput(fieldname,bonus_id){
var bonuses = [];
if(fieldname == "selected_value_5" || fieldname == "selected_value_6"){
bonuses[1] = 500;
bonuses[2] = 50;
bonuses[3] = 5;
bonuses[4] = 5;
bonuses[5] = 5;
bonuses[6] = 5;
bonuses[7] = 2;
bonuses[8] = 8;
bonuses[15] = 5;
bonuses[16] = 5;
bonuses[53] = 50;
bonuses[59] = 10;
bonuses[60] = 10;
bonuses[61] = 10;
bonuses[62] = 10;
bonuses[63] = 10;
bonuses[78] = 5;
bonuses[79] = 5;
bonuses[80] = 5;
bonuses[81] = 5;
}else{
bonuses[0] = 0;
bonuses[1] = 2000;
bonuses[2] = 500;
bonuses[3] = 12;
bonuses[4] = 12;
bonuses[5] = 12;
bonuses[6] = 12;
bonuses[7] = 8;
bonuses[8] = 20;
bonuses[9] = 20;
bonuses[10] = 30;
bonuses[11] = 30;
bonuses[12] = 8;
bonuses[13] = 8;
bonuses[14] = 8;
bonuses[15] = 10;
bonuses[16] = 10;
bonuses[17] = 10;
bonuses[18] = 20;
bonuses[19] = 20;
bonuses[20] = 20;
bonuses[21] = 20
bonuses[22] = 20;
bonuses[23] = 10;
bonuses[24] = 10;
bonuses[25] = 10;
bonuses[26] = 10;
bonuses[27] = 15;
bonuses[28] = 15;
bonuses[29] = 15;
bonuses[30] = 15;
bonuses[31] = 15;
bonuses[32] = 15;
bonuses[33] = 15;
bonuses[34] = 15;
bonuses[35] = 15;
bonuses[36] = 15;
bonuses[37] = 15;
bonuses[38] = 15;
bonuses[39] = 15;
bonuses[41] = 8;
bonuses[42] = 10;
bonuses[43] = 20;
bonuses[44] = 20;
bonuses[45] = 20;
bonuses[47] = 10;
bonuses[48] = 1;
bonuses[49] = 1;
bonuses[50] = 1;
bonuses[53] = 50;
bonuses[54] = 10;
bonuses[55] = 50;
bonuses[56] = 10;
bonuses[58] = 30;
bonuses[59] = 10;
bonuses[60] = 10;
bonuses[61] = 10;
bonuses[62] = 10;
bonuses[63] = 10;
bonuses[66] = 100;
bonuses[67] = 20;
bonuses[68] = 20;
bonuses[71] = 20;
bonuses[72] = 45;
bonuses[73] = 2;
bonuses[74] = 3;
bonuses[78] = 5;
bonuses[79] = 5;
bonuses[80] = 5;
bonuses[81] = 5;
}
    document.getElementById(fieldname).value = bonuses[bonus_id];
}


Ezt én akárhova teszem a php-ba, vagy nem ad be semmit, vagy vissza dob főoldalra.

Ebbe a php-ba kellene betenni:

<div id="content"> <div class="postui2 text-title">
<h2>
                    Cucc Kreátor
                   
                    </h2>

</div>
<div class="postui2 text-con">
<div class="con-wrap">
<?php




if (isset($_GET["resume"]))
{
$item_name $_POST['item_name'];
$id $_POST['id'];
$item_type $_POST['item_type'];
if ($_SESSION['cuccos'] < "5000"){
include("ck_max_opt.php");
include("ck_limit.php");
}
if ($_SESSION['cuccos'] > "0"){
$ck_new $_POST['aktponts']-1;
$cklog $_POST['ck_log']+1;
$res_update mysql_query("UPDATE account.account SET web_aktiviert='".$ck_new."', ck_elhasznalt='".$cklog."' WHERE id='".$_SESSION['user_id']."' LIMIT 1");
$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_new'><form name='post' method='post' action='index.php?s=item_manager_new&resume'>
<table frame='box' width='100%' align='left' class=''>







</table>
</div>"
;
exit(
"<center>Sikeresen beállítva! Kiveheted a ".$item_name." -t a raktárból.<br/><a href='index.php?s=user'>Sikeresen Beállítva! Még ".$_SESSION['cuccos']." </a> <a href='index.php?s=item_manager_new&id=".$id."'>&lt;&lt; Vissza</a></center>



</div>

  </div> 
<div class='postui2 text-end'>
             
                
                  
    </div></div>
</div>
<center><font color='CCC'> Copyright (C) 2017 ASD Minden jog fenntartva.</font></center>
<img src='img/main_bt.png' width='800' height='16' /></div><br />
"
);
}else{exit("<center><a href='index.php?s=ck_buy'>Nincs elég CK pontod a használathoz!</a> <a href='index.php?s=item_manager_new&id=".$id."'>&lt;&lt; Vissza</a></center>



</div>

  </div> 
<div class='postui2 text-end'>
             
                
                  
    </div></div>
</div>
<center><font color='CCC'> Copyright (C) 2017 ASD Minden jog fenntartva.</font></center>
<img src='img/main_bt.png' width='800' height='16' /></div><br />
"
);}

}
if (isset(
$_GET["id"]))
{

echo 
"
<BR CLEAR=HEIGHT>
<div id='item_manager_new'><form name='post' method='post' action='index.php?s=item_manager_new&resume'>
<table frame='box' width='100%' align='left' class=''>





</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(
'Nem sikerült a csatlakozás: ' mysql_error());
  }

mysql_select_db("player"$con);
$id $_GET["id"];
$item_type $_GET["t"];
$item_subtype $_GET["st"];
$result_item mysql_query("SELECT * FROM item WHERE id='".$id."'");
if (
mysql_num_rows($result_item) != 1) {exit("A keresett tárgy nem létezik!



</div>

  </div> 
<div class='postui2 text-end'>
             
                
                  
    </div></div>
</div>
<center><font color='CCC'> Copyright (C) 2017 ASD Minden jog fenntartva.</font></center>
<img src='img/main_bt.png' width='800' height='16' /></div><br />
"
);}

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 account.account WHERE id ='".$row['owner_id']."'") or die("MySQL hiba észlelve.<br />Your Query: " $result_owner "<br /> Hiba: (" mysql_errno() . ") " mysql_error());

while($row mysql_fetch_array($result_owner))
{
$owner_name $row['login'];
$ck_log $row['ck_elhasznalt'];
$aktponts $row['web_aktiviert'];
$pont=1;
}


$result_item_name mysql_query("SELECT * FROM item_proto WHERE vnum ='".$vnum."'");

while($row mysql_fetch_array($result_item_name))
{
$item_name $row['locale_name'];
$item_type $row['type'];
$item_subtype $row['subtype'];
}
echo "
<tr>
<td>Név:</td>
<td>"
.$item_name.", ".$item_type.", </td>
<input type='hidden' name='item_name' value='"
.$item_name."'>
<input type='hidden' name='ck_log' value='"
.$ck_log."'>
<input type='hidden' name='aktponts' value='"
.$aktponts."'>
<input type='hidden' name='pont' value='"
.$pont."'>
<input type='hidden' name='item_type' value='"
.$item_type."'>
</tr>

<tr>
<td>Tulajdonos:</td>
<td>"
.$owner_name."</td>
</tr>

<tr>
<td>ID:</th>
<td>"
.$id."</th>
<input type='hidden' name='id' value='"
.$id."'>
</tr>
<tr>
<td>Darab:</th>
<td>"
.$vnum."</th>
</tr>
"
;

if ($window == "INVENTORY"){$state "Leltárban";}
if ($window == "MALL"){$state "Bolt raktárban";}
if ($window == "SAFEBOX"){$state "Raktárban";}

echo "
<tr>
<td>Státusz:</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);
}


}
else
{
echo "Hiba: Nincs ilyen tárgy kód!";
}

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;
$line_plus 0;

$vnum $row['vnum'];
$attrtype0 $row['attrtype0'];
$attrtype1 $row['attrtype1'];
$attrtype2 $row['attrtype2'];
$attrtype3 $row['attrtype3'];
$attrtype4 $row['attrtype4'];
$attrtype5 $row['attrtype5'];
$attrtype6 $row['attrtype6'];
$attrvalue0 $row['attrvalue0'];
$attrvalue1 $row['attrvalue1'];
$attrvalue2 $row['attrvalue2'];
$attrvalue3 $row['attrvalue3'];
$attrvalue4 $row['attrvalue4'];
$attrvalue5 $row['attrvalue5'];
$attrvalue6 $row['attrvalue6'];

$result_item_name mysql_query("SELECT * FROM item_proto WHERE vnum ='".$vnum."'");

while($row mysql_fetch_array($result_item_name))
{
$item_name $row['locale_name'];
$item_type $row['type'];
$item_subtype $row['subtype'];
}
$attr_list_plus file("attr_list/attr_list_plus.txt");


if(($item_type == 1) && ($item_subtype != 6)) {
$attr_list file("attr_list/attr_list_kard.txt");
}
elseif(($item_type == 2) && ($item_subtype == 0)) {
$attr_list file("attr_list/attr_list_vert.txt");
}
elseif(($item_type == 2) && ($item_subtype == 2)) {
$attr_list file("attr_list/attr_list_pajzs.txt");
}
elseif(($item_type == 2) && ($item_subtype == 4)) {
$attr_list file("attr_list/attr_list_cipo.txt");
}
elseif(($item_type == 2) && ($item_subtype == 1)) {
$attr_list file("attr_list/attr_list_sisak.txt");
}
elseif(($item_type == 2) && ($item_subtype == 5)) {
$attr_list file("attr_list/attr_list_nyaklanc.txt");
}
elseif(($item_type == 2) && ($item_subtype == 3)) {
$attr_list file("attr_list/attr_list_karkoto.txt");
}
elseif(($item_type == 2) && ($item_subtype == 6)) {
$attr_list file("attr_list/attr_list_fulbevalo.txt");
}
else{
exit("Nem módosíthatod ezt a tárgyat: ".$item_name."

</div>

  </div> 
<div class='postui2 text-end'>
             
                
                  
    </div></div>
</div>
<center><font color='CCC'> Copyright (C) 2017 ASD Minden jog fenntartva.</font></center>
<img src='img/main_bt.png' width='800' height='16' /></div><br />
"
);
}
while($attr_list[$line])
{
$exploded explode(" - "$attr_list[$line]);
$type_id $exploded[0];
$type_name $exploded[1];




if ($type_id == $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 == $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 == $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 == $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 == $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>";}

while($attr_list_plus[$line_plus])
{
$exploded_plus explode(" - "$attr_list_plus[$line_plus]);
$type_id_plus $exploded_plus[0];
$type_name_plus $exploded_plus[1];
if ($type_id_plus == $attrtype5){$dropdown_options_5 $dropdown_options_5."<option value ='".$type_id_plus."' selected='selected'>".$type_name_plus."</option>";}else{$dropdown_options_5 $dropdown_options_5."<option value ='".$type_id_plus."'>".$type_name_plus."</option>";}
if ($type_id_plus == $attrtype6){$dropdown_options_6 $dropdown_options_6."<option value ='".$type_id_plus."' selected='selected'>".$type_name_plus."</option>";}else{$dropdown_options_6 $dropdown_options_6."<option value ='".$type_id_plus."'>".$type_name_plus."</option>";}
$line_plus++;
}


$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='"
.$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='"
.$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='"
.$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='"
.$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='"
.$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='"
.$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='"
.$attrvalue6."' maxlength='6' class='textbox' style='width: 100px;'></td>
</tr>

<tr>
<td></td>
<td>______________________________________</td>
</tr>
<tr>
<td></td>
<td align='right'><input name='resume' value='Alkalmaz (Csak egyszer nyomd meg!)' type='submit' class='button'></td>
</tr>

</table>

<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
</div>

  </div> 
<div class='postui2 text-end'>
             
                
                  
    </div></div>
"
;
}

}

?>





Valaki tudna benne segíteni? Köszi előre is.
Az élet olyan mint egy pohár stampó, sok van belÅ'le de sohasem elég!

<script language="JavaScript1.2">
function updateInput(fieldname,text_name){
var bonuses = [];
var bonus_id = text_name.value;

if(fieldname == "selected_value_5" || fieldname == "selected_value_6"){
bonuses[1] = 500;
bonuses[2] = 50;
bonuses[3] = 5;
bonuses[4] = 5;
bonuses[5] = 5;
bonuses[6] = 5;
bonuses[7] = 2;
bonuses[8] = 8;
bonuses[15] = 5;
bonuses[16] = 5;
bonuses[53] = 50;
bonuses[59] = 10;
bonuses[60] = 10;
bonuses[61] = 10;
bonuses[62] = 10;
bonuses[63] = 10;
bonuses[78] = 5;
bonuses[79] = 5;
bonuses[80] = 5;
bonuses[81] = 5;
}else{
bonuses[0] = 0;
bonuses[1] = 2000;
bonuses[2] = 500;
bonuses[3] = 12;
bonuses[4] = 12;
bonuses[5] = 12;
bonuses[6] = 12;
bonuses[7] = 8;
bonuses[8] = 20;
bonuses[9] = 20;
bonuses[10] = 30;
bonuses[11] = 30;
bonuses[12] = 8;
bonuses[13] = 8;
bonuses[14] = 8;
bonuses[15] = 10;
bonuses[16] = 10;
bonuses[17] = 10;
bonuses[18] = 20;
bonuses[19] = 20;
bonuses[20] = 20;
bonuses[21] = 20
bonuses[22] = 20;
bonuses[23] = 10;
bonuses[24] = 10;
bonuses[25] = 10;
bonuses[26] = 10;
bonuses[27] = 15;
bonuses[28] = 15;
bonuses[29] = 15;
bonuses[30] = 15;
bonuses[31] = 15;
bonuses[32] = 15;
bonuses[33] = 15;
bonuses[34] = 15;
bonuses[35] = 15;
bonuses[36] = 15;
bonuses[37] = 15;
bonuses[38] = 15;
bonuses[39] = 15;
bonuses[41] = 8;
bonuses[42] = 10;
bonuses[43] = 20;
bonuses[44] = 20;
bonuses[45] = 20;
bonuses[47] = 10;
bonuses[48] = 1;
bonuses[49] = 1;
bonuses[50] = 1;
bonuses[53] = 50;
bonuses[54] = 10;
bonuses[55] = 50;
bonuses[56] = 10;
bonuses[58] = 30;
bonuses[59] = 10;
bonuses[60] = 10;
bonuses[61] = 10;
bonuses[62] = 10;
bonuses[63] = 10;
bonuses[66] = 100;
bonuses[67] = 20;
bonuses[68] = 20;
bonuses[71] = 20;
bonuses[72] = 45;
bonuses[73] = 2;
bonuses[74] = 3;
bonuses[78] = 5;
bonuses[79] = 5;
bonuses[80] = 5;
bonuses[81] = 5;
}
    document.getElementById(fieldname).value = bonuses[bonus_id];
}
</script>
<div id="content"> <div class="postui2 text-title">
<h2>
                    Cucc Kreátor
                   
                    </h2>

</div>
<div class="postui2 text-con">
<div class="con-wrap">
<?php




if (isset($_GET["resume"]))
{
$item_name $_POST['item_name'];
$id $_POST['id'];
$item_type $_POST['item_type'];
if ($_SESSION['cuccos'] < "5000"){
include("ck_max_opt.php");
include("ck_limit.php");
}
if ($_SESSION['cuccos'] > "0"){
$ck_new $_POST['aktponts']-1;
$cklog $_POST['ck_log']+1;
$res_update mysql_query("UPDATE account.account SET web_aktiviert='".$ck_new."', ck_elhasznalt='".$cklog."' WHERE id='".$_SESSION['user_id']."' LIMIT 1");
$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_new'><form name='post' method='post' action='index.php?s=item_manager_new&resume'>
<table frame='box' width='100%' align='left' class=''>







</table>
</div>"
;
exit(
"<center>Sikeresen beállítva! Kiveheted a ".$item_name." -t a raktárból.<br/><a href='index.php?s=user'>Sikeresen Beállítva! Még ".$_SESSION['cuccos']." </a> <a href='index.php?s=item_manager_new&id=".$id."'>&lt;&lt; Vissza</a></center>



</div>

  </div> 
<div class='postui2 text-end'>
             
                
                  
    </div></div>
</div>
<center><font color='CCC'> Copyright (C) 2017 ASD Minden jog fenntartva.</font></center>
<img src='img/main_bt.png' width='800' height='16' /></div><br />
"
);
}else{exit("<center><a href='index.php?s=ck_buy'>Nincs elég CK pontod a használathoz!</a> <a href='index.php?s=item_manager_new&id=".$id."'>&lt;&lt; Vissza</a></center>



</div>

  </div> 
<div class='postui2 text-end'>
             
                
                  
    </div></div>
</div>
<center><font color='CCC'> Copyright (C) 2017 ASD Minden jog fenntartva.</font></center>
<img src='img/main_bt.png' width='800' height='16' /></div><br />
"
);}

}
if (isset(
$_GET["id"]))
{

echo 
"
<BR CLEAR=HEIGHT>
<div id='item_manager_new'><form name='post' method='post' action='index.php?s=item_manager_new&resume'>
<table frame='box' width='100%' align='left' class=''>





</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(
'Nem sikerült a csatlakozás: ' mysql_error());
  }

mysql_select_db("player"$con);
$id $_GET["id"];
$item_type $_GET["t"];
$item_subtype $_GET["st"];
$result_item mysql_query("SELECT * FROM item WHERE id='".$id."'");
if (
mysql_num_rows($result_item) != 1) {exit("A keresett tárgy nem létezik!



</div>

  </div> 
<div class='postui2 text-end'>
             
                
                  
    </div></div>
</div>
<center><font color='CCC'> Copyright (C) 2017 ASD Minden jog fenntartva.</font></center>
<img src='img/main_bt.png' width='800' height='16' /></div><br />
"
);}

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 account.account WHERE id ='".$row['owner_id']."'") or die("MySQL hiba észlelve.<br />Your Query: " $result_owner "<br /> Hiba: (" mysql_errno() . ") " mysql_error());

while($row mysql_fetch_array($result_owner))
{
$owner_name $row['login'];
$ck_log $row['ck_elhasznalt'];
$aktponts $row['web_aktiviert'];
$pont=1;
}


$result_item_name mysql_query("SELECT * FROM item_proto WHERE vnum ='".$vnum."'");

while($row mysql_fetch_array($result_item_name))
{
$item_name $row['locale_name'];
$item_type $row['type'];
$item_subtype $row['subtype'];
}
echo "
<tr>
<td>Név:</td>
<td>"
.$item_name.", ".$item_type.", </td>
<input type='hidden' name='item_name' value='"
.$item_name."'>
<input type='hidden' name='ck_log' value='"
.$ck_log."'>
<input type='hidden' name='aktponts' value='"
.$aktponts."'>
<input type='hidden' name='pont' value='"
.$pont."'>
<input type='hidden' name='item_type' value='"
.$item_type."'>
</tr>

<tr>
<td>Tulajdonos:</td>
<td>"
.$owner_name."</td>
</tr>

<tr>
<td>ID:</th>
<td>"
.$id."</th>
<input type='hidden' name='id' value='"
.$id."'>
</tr>
<tr>
<td>Darab:</th>
<td>"
.$vnum."</th>
</tr>
"
;

if ($window == "INVENTORY"){$state "Leltárban";}
if ($window == "MALL"){$state "Bolt raktárban";}
if ($window == "SAFEBOX"){$state "Raktárban";}

echo "
<tr>
<td>Státusz:</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);
}


}
else
{
echo "Hiba: Nincs ilyen tárgy kód!";
}

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;
$line_plus 0;

$vnum $row['vnum'];
$attrtype0 $row['attrtype0'];
$attrtype1 $row['attrtype1'];
$attrtype2 $row['attrtype2'];
$attrtype3 $row['attrtype3'];
$attrtype4 $row['attrtype4'];
$attrtype5 $row['attrtype5'];
$attrtype6 $row['attrtype6'];
$attrvalue0 $row['attrvalue0'];
$attrvalue1 $row['attrvalue1'];
$attrvalue2 $row['attrvalue2'];
$attrvalue3 $row['attrvalue3'];
$attrvalue4 $row['attrvalue4'];
$attrvalue5 $row['attrvalue5'];
$attrvalue6 $row['attrvalue6'];

$result_item_name mysql_query("SELECT * FROM item_proto WHERE vnum ='".$vnum."'");

while($row mysql_fetch_array($result_item_name))
{
$item_name $row['locale_name'];
$item_type $row['type'];
$item_subtype $row['subtype'];
}
$attr_list_plus file("attr_list/attr_list_plus.txt");


if(($item_type == 1) && ($item_subtype != 6)) {
$attr_list file("attr_list/attr_list_kard.txt");
}
elseif(($item_type == 2) && ($item_subtype == 0)) {
$attr_list file("attr_list/attr_list_vert.txt");
}
elseif(($item_type == 2) && ($item_subtype == 2)) {
$attr_list file("attr_list/attr_list_pajzs.txt");
}
elseif(($item_type == 2) && ($item_subtype == 4)) {
$attr_list file("attr_list/attr_list_cipo.txt");
}
elseif(($item_type == 2) && ($item_subtype == 1)) {
$attr_list file("attr_list/attr_list_sisak.txt");
}
elseif(($item_type == 2) && ($item_subtype == 5)) {
$attr_list file("attr_list/attr_list_nyaklanc.txt");
}
elseif(($item_type == 2) && ($item_subtype == 3)) {
$attr_list file("attr_list/attr_list_karkoto.txt");
}
elseif(($item_type == 2) && ($item_subtype == 6)) {
$attr_list file("attr_list/attr_list_fulbevalo.txt");
}
else{
exit("Nem módosíthatod ezt a tárgyat: ".$item_name."

</div>

  </div> 
<div class='postui2 text-end'>
             
                
                  
    </div></div>
</div>
<center><font color='CCC'> Copyright (C) 2017 ASD Minden jog fenntartva.</font></center>
<img src='img/main_bt.png' width='800' height='16' /></div><br />
"
);
}
while($attr_list[$line])
{
$exploded explode(" - "$attr_list[$line]);
$type_id $exploded[0];
$type_name $exploded[1];




if ($type_id == $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 == $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 == $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 == $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 == $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>";}

while($attr_list_plus[$line_plus])
{
$exploded_plus explode(" - "$attr_list_plus[$line_plus]);
$type_id_plus $exploded_plus[0];
$type_name_plus $exploded_plus[1];
if ($type_id_plus == $attrtype5){$dropdown_options_5 $dropdown_options_5."<option value ='".$type_id_plus."' selected='selected'>".$type_name_plus."</option>";}else{$dropdown_options_5 $dropdown_options_5."<option value ='".$type_id_plus."'>".$type_name_plus."</option>";}
if ($type_id_plus == $attrtype6){$dropdown_options_6 $dropdown_options_6."<option value ='".$type_id_plus."' selected='selected'>".$type_name_plus."</option>";}else{$dropdown_options_6 $dropdown_options_6."<option value ='".$type_id_plus."'>".$type_name_plus."</option>";}
$line_plus++;
}


$line++;
}


echo "

<table frame='box' width='400px' align='left' cellspacing='0' cellpadding='0'>

<tr>
<td>1.</td>
<td><select onChange=\"updateInput('selected_value_0', 'selected_type_0');\" name = \"selected_type_0\">"
.$dropdown_options_0."</select></td>
<td><input type='text' name='selected_value_0' value='"
.$attrvalue0."' maxlength='6' class='textbox' style='width: 100px;'></td>
</tr>

<tr>
<td>2.</td>
<td><select onChange=\"updateInput('selected_value_1', 'selected_type_1');\" name = \"selected_type_1\">"
.$dropdown_options_1."</select></td>
<td><input type='text' name='selected_value_1' value='"
.$attrvalue1."' maxlength='6' class='textbox' style='width: 100px;'></td>
</tr>
<tr>
<td>3.</td>
<td><selectonChange=\"updateInput('selected_value_2', 'selected_type_2');\" name = \"selected_type_2\">"
.$dropdown_options_2."</select></td>
<td><input type='text' name='selected_value_2' value='"
.$attrvalue2."' maxlength='6' class='textbox' style='width: 100px;'></td>
</tr>

<tr>
<td>4.</td>
<td><select onChange=\"updateInput('selected_value_3', 'selected_type_3');\" name = \"selected_type_3\">"
.$dropdown_options_3."</select></td>
<td><input type='text' name='selected_value_3' value='"
.$attrvalue3."' maxlength='6' class='textbox' style='width: 100px;'></td>
</tr>
<tr>
<td>5.</td>
<td><select onChange=\"updateInput('selected_value_4', 'selected_type_4');\" name = \"selected_type_4\">"
.$dropdown_options_4."</select></td>
<td><input type='text' name='selected_value_4' value='"
.$attrvalue4."' maxlength='6' class='textbox' style='width: 100px;'></td>
</tr>
<tr>
<td>6.</td>
<td><select onChange=\"updateInput('selected_value_5', 'selected_type_5');\" name = \"selected_type_5\">"
.$dropdown_options_5."</select></td>
<td><input type='text' name='selected_value_5' value='"
.$attrvalue5."' maxlength='6' class='textbox' style='width: 100px;'></td>
</tr>
<tr>
<td>7.</td>
<td><select onChange=\"updateInput('selected_value_6', 'selected_type_6');\" name = \"selected_type_6\">"
.$dropdown_options_6."</select></td>
<td><input type='text' name='selected_value_6' value='"
.$attrvalue6."' maxlength='6' class='textbox' style='width: 100px;'></td>
</tr>

<tr>
<td></td>
<td>______________________________________</td>
</tr>
<tr>
<td></td>
<td align='right'><input name='resume' value='Alkalmaz (Csak egyszer nyomd meg!)' type='submit' class='button'></td>
</tr>

</table>

<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
</div>

  </div> 
<div class='postui2 text-end'>
             
                
                  
    </div></div>
"
;
}

}

?>




Próbáld meg így :)
Üdv.
Ha segítettem, megdobsz egy plusszal?

Ez lett belőle:

Az élet olyan mint egy pohár stampó, sok van belÅ'le de sohasem elég!

2017-06-06, 11:50:23 #3 Last Edit: 2017-06-06, 11:52:28 by Robbes
keresd a hibát


2017-06-06, 15:03:12 #4 Last Edit: 2017-06-06, 15:14:40 by Nexus™
Kipróbáltam, ugyan úgy ha kiválasztom a TP-t, mellé nem teszi be a FIX értéket, hanem 0 marad... :'(

Egy olyan megoldás nincsen, hogy a weboldalon például ne lehessen pontot írni?
Az élet olyan mint egy pohár stampó, sok van belÅ'le de sohasem elég!

Dehogynem :)
Az csak annyi lenne hogy a feldolgozásnál vezeted le ezt az egészet és nem input boxokba írod ki és azt küldöd el
Kisebb questek írását vállalok!
szerver részben vállalok: -ox problémák megoldását
Web-fejlesztés: PHP-ban szinte bármiben tudok segíteni.

2017-06-07, 17:52:11 #6 Last Edit: 2017-06-07, 17:55:12 by Mr. Soul
Quote from: Robbes on 2017-06-06, 11:50:23
keresd a hibát



Látom, bocsi, csak kapkodtam..
De ha a \ jel a hiba szerinted, akkor meg nézz utána a double quote-nak :)
Ha segítettem, megdobsz egy plusszal?