Non ci capisco niente
Questo è il codice completo della pagina:
codice:
<?php
include 'zzz.inc';
include 'update.inc';
include 'top.inc';
include 'punti.inc';
include 'nav1.inc';
include 'alto.inc';
?>
<script type="text/javascript" language="JavaScript">
function aumenta(nome, value) {
strValori = document.getElementById(nome+"_val").value.split(","); //Recupera i valori minimo e massimo per ogni gruppo
strValoreMin = strValori[0];
strValoreMax = strValori[1];
tot_input = document.getElementById("tot");
changed_input = document.getElementById(nome);
tot = 1*tot_input.value;
changed = 1*changed_input.value;
if ((tot - value)<0) {
alert("Hai esaurito le risorse a disposizione")
} else {
if ((changed + value)>=strValoreMax) {
document.getElementById(nome+"_plus").disabled="disabled";
tot_input.value = tot - value;
changed_input.value = changed + value;
} else if ((changed + value)<(parseInt(strValoreMin)+1)) {
document.getElementById(nome+"_minus").disabled="disabled";
tot_input.value = tot - value;
changed_input.value = changed + value;
} else {
document.getElementById(nome+"_plus").disabled=false;
document.getElementById(nome+"_minus").disabled=false;
tot_input.value = tot - value;
changed_input.value = changed + value;
}
}
}
</script>
<center><div id=bigboxalto><center>[b]Distribuisci risorse</div><div id=bigboxcentro><table border=0 width=610><tr><td align=justify>Qui puoi ditribuire le tue risorse come ritieni piu' opportuno. Pensa attentamente a come distribuire i punti di cui disponi. Cliccando su "Accetta" non sara' possibile annullare l'operazione.
</td></tr><tr><td>
<form name=modulo method=post action=distr2.php>
<?php
$_nome=$_SESSION['nome'];
$_id=$_SESSION['codice'];
$_all='';
$query1=mysql_query("select * from users where username='$_nome'") or die(mysql_error());
while ($row1=mysql_fetch_assoc($query1))
{
$_id=$row1['codice'];
$_squadra=$row1['squadra'];
$query10=mysql_query("select * from risorse where user='$_id'") or die(mysql_error());
while ($row10=mysql_fetch_assoc($query10))
{
$_totris=$row10['punti'];
echo '<center>Punti disponibili: <input type="text" id="tot" name="tot" value="'.$_totris.'" style="width: 40px;" readonly>';
echo '
Giocatori attuali:
</center>';
echo '<table border=0 width=600><tr>';
$query2=mysql_query("select * from giocatori where squadra='$_squadra'") or die(mysql_error());
$_x=0;
$_y=1;
while ($row2=mysql_fetch_assoc($query2))
{
$_ruolo=$row2['ruolo'];
$_nome1=$row2['nome'];
$_p1=$row2['p1'];
$_p2=$row2['p2'];
$_p3=$row2['p3'];
$_p4=$row2['p4'];
$query3=mysql_query("select * from ruoli where ruolo='$_ruolo'") or die(mysql_error());
while ($row3=mysql_fetch_assoc($query3))
{
$_p1n=$row3['p1'];
$_p2n=$row3['p2'];
$_p3n=$row3['p3'];
$_p4n=$row3['p4'];
echo '<td><div id=smallboxalto2><center>[b]'.$_nome1.' - '.$_ruolo.'</div><div id=smallboxcentro2>';
echo '<table border=0 width=295>';
echo '<tr><td witdh=183>'.$_p1n.'</td><td width=110>';
echo '<input type="hidden" id="gioc" name="gioc" value="'.$_nome1.'" style="width: 20px;">';
echo '<input type="button" id="'.$_nome1.'_p1_minus" name="'.$_nome1.'_p1_minus" value="-" onclick="aumenta(\''.$_nome1.'_p1\', -1)" disabled=disabled>';
echo '<input type="text" id="'.$_nome1.'_p1" name="p1" value="'.$_p1.'" style="width: 50px;" readonly=readonly>';
echo '<input type="button" id="'.$_nome1.'_p1_plus" name="'.$_nome1.'_p1_plus" value="+" onclick="aumenta(\''.$_nome1.'_p1\', 1)">';
echo '<input type="hidden" id="'.$_nome1.'_p1_val" name="'.$_nome1.'_p1_val" value="'.$_p1.',10000" />';
echo '</td></tr>';
echo '<tr><td witdh=183>'.$_p2n.'</td><td width=110>';
echo '<input type="hidden" id="gioc" name="gioc" value="'.$_nome1.'" style="width: 20px;">';
echo '<input type="button" id="'.$_nome1.'_p2_minus" name="'.$_nome1.'_p2_minus" value="-" onclick="aumenta(\''.$_nome1.'_p2\', -1)" disabled=disabled>';
echo '<input type="text" id="'.$_nome1.'_p2" name="p2" value="'.$_p2.'" style="width: 50px;" readonly=readonly>';
echo '<input type="button" id="'.$_nome1.'_p2_plus" name="'.$_nome1.'_p2_plus" value="+" onclick="aumenta(\''.$_nome1.'_p2\', 1)">';
echo '<input type="hidden" id="'.$_nome1.'_p2_val" name="'.$_nome1.'_p2_val" value="'.$_p2.',10000" />';
echo '</td></tr>';
echo '<tr><td witdh=183>'.$_p3n.'</td><td width=110>';
echo '<input type="hidden" id="gioc" name="gioc" value="'.$_nome1.'" style="width: 20px;">';
echo '<input type="button" id="'.$_nome1.'_p3_minus" name="'.$_nome1.'_p3_minus" value="-" onclick="aumenta(\''.$_nome1.'_p3\', -1)" disabled=disabled>';
echo '<input type="text" id="'.$_nome1.'_p3" name="p3" value="'.$_p3.'" style="width: 50px;" readonly=readonly>';
echo '<input type="button" id="'.$_nome1.'_p3_plus" name="'.$_nome1.'_p3_plus" value="+" onclick="aumenta(\''.$_nome1.'_p3\', 1)">';
echo '<input type="hidden" id="'.$_nome1.'_p3_val" name="'.$_nome1.'_p3_val" value="'.$_p3.',10000" />';
echo '</td></tr>';
echo '<tr><td witdh=183>'.$_p4n.'</td><td width=110>';
echo '<input type="hidden" id="gioc" name="gioc" value="'.$_nome1.'" style="width: 20px;">';
echo '<input type="button" id="'.$_nome1.'_p4_minus" name="'.$_nome1.'_p4_minus" value="-" onclick="aumenta(\''.$_nome1.'_p4\', -1)" disabled=disabled>';
echo '<input type="text" id="'.$_nome1.'_p4" name="p4" value="'.$_p4.'" style="width: 50px;" readonly=readonly>';
echo '<input type="button" id="'.$_nome1.'_p4_plus" name="'.$_nome1.'_p4_plus" value="+" onclick="aumenta(\''.$_nome1.'_p4\', 1)">';
echo '<input type="hidden" id="'.$_nome1.'_p4_val" name="'.$_nome1.'_p4_val" value="'.$_p4.',10000" />';
echo '</td></tr>';
echo '</table></div><div id=smallboxbasso2></div></td>';
$_y=$_y+1;
}
if ($_y==3) {
echo "</tr><tr>";
$_y=1;
}
$_x=$_x+1;
}
//
}
echo '</table>';
$_SESSION['all']=$_all;
$_SESSION['x']=$_x;
}
echo '<center><input type=submit value=Accetta></form></td></tr></table></div><div id=bigboxbasso></div>';
include 'basso.inc';
?>
Da tutto questo a me serve recuperare i valori di gioc,p1,p2,p3,p4.