problema inserimento altre due statistiche
problema inserimento altre due statistiche postato il 19/09/2007 23:12:52 nel forum programmazione, open source e hosting
Oltre a forza e mente volevo inserire resistenza e destrezza. Ho creato le righe nel db ho copiato il codice delle altre 2 nei rispettivi spazi scheda(scheda.php e scheda3.php), ma al momeno di iscrivere il pg con una determinata razza questi presenta queste caratteristiche uguali a 0 mentre le altre due originali sono giuste. Dove sbaglio. Ecco i codici completi di scheda.php e scheda3.php:
scheda:
<? session_start();
include ('inc/parametri.inc.php');
include ('inc/open2.php');
If (($HTTP_GET_VARS["Login"] != "") or ($HTTP_POST_VARS["Login"] != "")) {$Login = "";};
$pg = trim(urldecode($pg));
$Modifica = trim($Modifica);
$upd = ((strtoupper($pg) == strtoupper($Login)) and (trim($pg) != "") and (strtoupper($Modifica) == strtoupper($pg)));
if (($_SESSION['Admin_S']=='1') AND ($par_Flag_AdminExt=='1')) {
$_SESSION['AdminExt_S'] = $_GET['AdminExt'];
}
function BottoneGestione($Gst_Titolo, $Gst_Sigla, $Gst_Link) {
return '<tr class=tScuro><td colspan=5 align=left Title="'.htmlspecialchars($Gst_Titolo).'"><a href="'.$Gst_Link.'"><img border=0 src="img/base.gif"> <font color=gold>'.htmlspecialchars($Gst_Titolo).'</font></a></font></td></tr>';
}
function formattadata($tim)
{
return strftime("%d/%m/%Y", strtotime($tim));
}
function barra($valore, $maxvalore)
{
$colore = "55FF55";
$colore1 = "FF4040";
$bar = '<table cellpadding=0 cellspacing=0 border=0 width="'.$valore.'" height=10>';
$bar .= '<tr><td align=right bgcolor="'.$colore.'" width=';
if ($valore > 100) {
$bar .= '100><font color=black>+</font>';
}
else
{
$bar .= $valore.'><img src='img/spacer.gif' width='.$valore.' height=1>';
};
$bar .= "</td>";
if (($maxvalore - $valore) > 0) {
$bar .= '<td align=right bgcolor="'.$colore1.'" width=';
$bar .= ($maxvalore - $valore).'><img src='img/spacer.gif' width='.($maxvalore-$valore).' height=1>';
$bar .= "</td>";
};
$bar .= "</tr>";
$bar .= "</table>
";
return $bar;
};
#----- pulisci avatar -----
If (($_SESSION['Esilio_S'] == 1) && ($_POST['Pulisci'] != '')) {
$Msg = "<b>L'avatar di ".htmlspecialchars($pg)." è stato pulito!</b>";
$MySql = "UPDATE Personaggio SET URLImg = 'img/spacer.gif', Descrizione='Scheda pulita', ICQ='', Affetti='', Capacita='' WHERE Nome = '$pg'";
mysql_query($MySql);
$MySql = "INSERT INTO Chat (Stanza, Mittente, Destinatario, Ora, Testo, Sesso, ImgGilda, DescGilda, ImgRazza, DescRazza, Tipo)";
$MySql .= "VALUES ('$Stanza', 'System Op', '$Login', NOW(), '".addslashes($Msg)."', '$Sesso_S', '$ImgGilda_S', '$DescGilda_S', '$ImgRazza_S', '$DescRazza_S', 'S')";
mysql_query($MySql);
echo $MySql;
$EsilioP = "";
echo "<font color=red>$Msg</font>";
}
#----- inizio prigione ed esilio -----
$EsilioP = "";
If (($_SESSION['Esilio_S'] == 1) && ($_POST['Esilia'] != '')) {
$Motivo = $_POST['Motivo_Esilio'];
$EsilioP = "'2037-12-31 00:00:00'";
if ($_POST['IP'] == 'on') {
$Msg = "<b>".htmlspecialchars($pg)." è stato esiliato + IP escluso!</b>";
$MySql = "SELECT * FROM LogEntrate WHERE Nome = '$pg' ORDER BY DataEvento DESC";
$Result = mysql_query($MySql);
$rs = mysql_fetch_array($Result);
$IPEscluso = $rs["IP"];
$rs->close;
$MySql = "INSERT INTO BlackList (IP, Nota, Ora) VALUES ";
$MySql .= "('$IPEscluso', '$pg (escluso da $Login)', Now())";
$Result = mysql_query($MySql);
} else {
$Msg = "<b>".htmlspecialchars($pg)." è stato esiliato!</b>";
}
if ($_POST['Grazia'] == 'on') {
$EsilioP = "'".strftime("%Y-%m-%d %H:%M:%S")."'";
$Msg = "<b>".htmlspecialchars($pg)." è stato graziato!</b>";
}
}
If (($_SESSION['Prigione_S'] == 1) && ($_POST['Arresta'] != '')) {
$Motivo = $_POST['Motivo_Arresto'];
$MySql = "SELECT Esilio From Personaggio WHERE Nome = '$pg'";
$Result = mysql_query($MySql);
$rs = mysql_fetch_array($Result);
if ($rs["Esilio"] == '2037-12-31 00:00:00') {
$Msg = "<b>".htmlspecialchars($pg)." è esiliato e non può essere imprigionato!</b>";
$MySql = "INSERT INTO Chat (Stanza, Mittente, Destinatario, Ora, Testo, Sesso, ImgGilda, DescGilda, ImgRazza, DescRazza, Tipo)";
$MySql .= "VALUES ('$Stanza', 'System Op', '$Login', NOW(), '$Msg', '$Sesso_S', '$ImgGilda_S', '$DescGilda_S', '$ImgRazza_S', '$DescRazza_S', 'S')";
$Result = mysql_query($MySql);
$EsilioP = "";
echo "<font color=red>$msg</font>";
} else {
$EsilioP = "DATE_ADD(NOW(), INTERVAL '$gg' DAY)";
$Msg = "<b>".htmlspecialchars($pg)." è stato imprigionato per $gg giorni!</b>";
}
}
if ($EsilioP != "") {
$MySql = "UPDATE Personaggio SET Esilio = $EsilioP";
$MySql .= ", DataEventoEsilio = NOW()";
$MySql .= ", Motivo = '$Motivo'";
$MySql .= ", AutoreEsilio = '$Login'";
$MySql .= " WHERE Nome = '$pg'";
$Result = mysql_query($MySql);
$MySql = "INSERT INTO Chat (Stanza, Mittente, Destinatario, Ora, Testo, Sesso, ImgGilda, DescGilda, ImgRazza, DescRazza, Tipo)";
$MySql .= "VALUES ('$Stanza', 'System Op', '$Login', NOW(), '$Msg', '$Sesso_S', '$ImgGilda_S', '$DescGilda_S', '$ImgRazza_S', '$DescRazza_S', 'S')";
$Result = mysql_query($MySql);
echo "<font color=red>$Msg</font>";
}
If ((trim($pass) != "") AND (strtoupper($pg) == strtoupper($Login)))
{
echo('<font color=gold>SCHEDA MODIFICATA</font><hr size=1 color=gold>');
# $pass = pars($pass);
$descrizione = substr($descrizione, 0, 255);
$descrizione = trim($descrizione);
$affetti = substr($affetti, 0, 255);
$affetti = trim($affetti);
$capacita = substr($capacita, 0, 255);
$capacita = trim($capacita);
$email = trim($email);
$icq = trim($icq);
$urlimg = trim($urlimg);
$urlimg = substr($urlimg, 0, 255);
#$urlimg = pars($urlimg);
$DataNascita = '';
$gg = 0 + $gg;
$mm = 0 + $mm;
$aaaa = 0 + $aaaa;
if (($rs["DataNascita"] == "") :: ($rs["DataNascita"] == "0000-00-00")) {
if (($gg>0) && ($mm>0) && ($aaaa>0)) {
if ($gg < 10) {
$gg = "0".$gg;
}
if ($gg > 31) {
$gg = 0;
}
if ($mm < 10) {
$mm = "0".$mm;
}
if ($mm > 12) {
$mm = 0;
}
if ($aaaa < 100) {
$aaaa = "19".$aaaa;
}
if (($aaaa > 2000) :: ($aaaa < 1900)) {
$aaaa = 0;
}
$DataNascita = "".$aaaa."-".$mm."-".$gg;
}
}
if ($icq == "") {$icq = "nessuno";};
if ($descrizione == "") {$descrizione = "niente";};
if ($affetti == "") {$affetti = "niente";};
if ($capacita == "") {$capacita = "niente";};
if ($email == "") {$email = "nessuna";};
$MySql = "UPDATE Personaggio";
$MySql .= " SET Pass = '".$pass."',";
$MySql .= " Descrizione = '".$descrizione."',";
$MySql .= " Affetti = '".$affetti."',";
$MySql .= " Capacita = '".$capacita."',";
$MySql .= " ICQ = '".$icq."',";
$MySql .= " UrlImg = '".$urlimg."'";
If ($DataNascita != "") {
$MySql .= ", DataNascita = '".$DataNascita."'";
}
$MySql .= " WHERE Nome = '".$pg."'";
$Result = mysql_query($MySql);
# mysql_fetch_array($Result);
}
$MySql = "SELECT Personaggio.*, Razza.Razza, Razza.URLImg AS URLImgRazza, Gilda.Gilda, Gilda.URLImg AS URLImgGilda
FROM Personaggio
LEFT JOIN Razza
ON Personaggio.IDRazza = Razza.IDRazza
LEFT JOIN Gilda
ON Personaggio.IDGilda = Gilda.IDGilda
WHERE Nome = '$pg'";
$result = mysql_query($MySql);
#echo $MySql;
$rs = mysql_fetch_array($result);
if ((trim($pg) == "") or !($rs)) {
$rs->close;
mysql_close;
echo("<script><!--
history.back();
//-->
</script>");
exit();
};
#########################################
# Il Recordset non è vuoto #
#########################################
$UrlImg = trim($rs["URLImg"]."");
If ($UrlImg == "")
$UrlImg = "img/sagoma".$rs["Sesso"].".gif";
$UrlImgRazza = trim($rs["URLImgRazza"]."");
If ($UrlImgRazza == "")
$UrlImgRazza = "spacer.gif";
$UrlImgGilda = trim($rs["URLImgGilda"]."");
If ($UrlImgGilda == "")
$UrlImgGilda = "nessuno.gif";
$Gilda = trim($rs["Gilda"]."");
if ($Gilda == "") {
if (strtolower($rs["Sesso"]) == "f") {
$Gilda = "Cittadina delle Libere Terre";
} else {
$Gilda = "Cittadino delle Libere Terre";
}
}
$DataUltimaGilda = $rs['DataUltimaGilda'];
include ('inc/header.html.inc.php');
?>
<title>Scheda <?= $pg ?></title>
</head>
<body>
<table border=0 cellpadding=2 cellspacing=2 class=tChiaro>
<tr>
<td>Scheda Personaggio</td>
<td class=tScuro><a href="scheda2.php?pg=<?= urlencode($pg) ?>">Oggetti</a></td>
<?
if (isset($Login)) {
if ($Login == $pg) {
echo('<td class=tScuro><a href="scheda3.php?pg='.urlencode($pg).'">Modifica</a></td>');
echo('<td class=tScuro><a href="scheda4.php?pg='.urlencode($pg).'">Movimenti</a></td>');
echo('<td class=tScuro><a href="scheda5.php?pg='.urlencode($pg).'">Punti</a></td>');
}
};
?>
</tr></table><br><br>
<table border=1 cellspacing=0 cellpadding=2 width=600 class=tChiaro>
<tr class=tTitolo>
<?
echo('<td colspan=3><font class=Titolo><img src="img/testamini'.strtolower($rs["Sesso"]).'.gif"> '.htmlspecialchars($rs["Nome"]).'</font></td>');
echo('<td colspan=2>');
echo('<a href="nuovomessaggio.php?Dest='.urlencode($rs["Nome"].'').'">');
echo('Scrivi a '.htmlspecialchars($rs["Nome"].''));
echo('</a>');
?></td>
</tr><tr class=tScuro>
<td rowspan=10 colspan=2 align=left valign=top width=200><img width=200 src="<?= $UrlImg ?>" border="0"></td>
<td width=100>Iscrizione</td><td colspan=2> <?=formattadata($rs["DataIscrizione"])?></td>
</tr><tr class=tScuro>
<td width=100>Esperienza</td><td width="70px"> <?= $rs["Esperienza"] ?></td><td width=300><?= barra($rs["Esperienza"], 0) ?></td>
</tr><tr class=tScuro>
<td width=100>Mente</td><td width="70px"> <?= $rs["Mente"]."/".$rs["MaxMente"] ?></td><td width=300><?= barra($rs["Mente"], $rs["maxmente"]) ?></td>
</tr><tr class=tScuro>
<td width=100>Forza</td><td width="70px"> <?= $rs["Forza"]."/".$rs["MaxForza"] ?></td><td width=300><?= barra($rs["Forza"], $rs["maxforza"]) ?></td>
</tr><tr class=tScuro>
<td width=100>Resistenza</td><td width="70px"> <?= $rs["Resistenza"]."/".$rs["MaxResistenza"] ?></td><td width=300><?= barra($rs["Resistenza"], $rs["maxresistenza"]) ?></td>
</tr><tr class=tScuro>
<td width=100>Destrezza</td><td width="40px"> <?= $rs["Destrezza"]."/".$rs["MaxDestrezza"] ?></td><td width=300><?= barra($rs["Destrezza"], $rs["maxdestrezza"]) ?></td>
</tr><tr class=tScuro>
<td width=100>Razza</td><td colspan="2">
<? if(intval($rs['IDRazza'])%1000 != 0){
echo '<a href="razza.php?ID='.intval($rs['IDRazza']/10)*10 .'">';
} ?>
<img src="img/razze/<?=$UrlImgRazza?>" border=0> <?= htmlspecialchars($rs["Razza"]."") ?>
<? if(intval($rs['IDRazza'])%1000 != 0){
echo '</a>';
} ?>
<?
$MySql = 'SELECT * FROM Razza WHERE IDRazza = '.intval($rs['IDRazza']/10)*10;
$Result1 = mysql_query($MySql);
$rs1 = mysql_fetch_array($Result1);
$Disciplina = Array (
1 => $rs1['Disciplina1'],
2 => $rs1['Disciplina2'],
3 => $rs1['Disciplina3'],
4 => $rs1['Disciplina4']
);
$rs1='';
for ($i=1; $i<=4; $i++) {
if ($Disciplina[$i] != 0) {
$MySql = 'SELECT * FROM Discipline WHERE ID = '.pars($Disciplina[$i]);
$Result1 = mysql_query($MySql);
$rs1 = mysql_fetch_array($Result1);
echo('<br><li>'.htmlspecialchars($rs1['Nome']));
};
};
$rs1->close;
?></td>
</tr><tr class=tScuro>
<td width=100 valign=top>Corporazione o Mestiere</td>
<td colspan="2" valign=top>
<? if(intval($rs['IDGilda']) >= 100){
echo '<a href="corporazioni.php?ID='.intval($rs['IDGilda']/100)*100 .'">';
} ?>
<img src="img/stemmi/<?= $UrlImgGilda ?>" border=0> <?= htmlspecialchars($Gilda) ?><br><i>dal <?= formattadata($DataUltimaGilda) ?></i>
<? if(intval($rs['IDGilda']) >= 100){
echo '</a>';
} ?>
</td>
</tr><tr class=tScuro>
<td width=100 valign=top>Riconoscimenti e Altro</td>
<td colspan="2" align=left valign=top><?
switch ($rs["Master"]) {
case 1:
echo '<img src="img/gray-m.gif">';
break;
case 2:
echo '<img src="img/gray-c.gif">';
break;
case 3:
echo'<img src="img/gray-r.gif">';
break;
}
?> <?
$MySql = "SELECT * FROM ClgPersonaggioMostrine";
$MySql .=" LEFT JOIN CodMostrina ON CodMostrina.IdMostrina = ClgPersonaggioMostrine.IdMostrina";
$MySql .=" WHERE ClgPersonaggioMostrine.Nome = '$pg' ORDER BY ClgPersonaggioMostrine.IdMostrina";
$Result1 = mysql_query($MySql);
while ($rs1 = mysql_fetch_array($Result1)) {
echo '<img src="img/mostrine/'.$rs1['ImgURL'].'" Title="'.$rs1['Descrizione'].'" baseline=top>';
}
$rs1->close;
?></td>
</tr><tr class=tScuro>
<td width=100 valign=top>Dice di sé</td><td colspan="2" valign=top> <?
if ((trim($rs["Descrizione"]."") == "") and !($upd)) {
echo(" - ");
} else {
echo(str_replace("
", "<br>", htmlspecialchars($rs["Descrizione"])));
} ?></td>
</tr><tr class=tScuro>
<td width=100 valign=top>Affetti</td><td colspan="2" valign=top> <?
if ((trim($rs["Affetti"]."") == "") and !$upd) {
echo(" - ");
} else {
echo(str_replace("
", "<br>", htmlspecialchars($rs["Affetti"])));
} ?></td>
</tr><tr class=tScuro>
<td width=100 valign=top>Capacitá</td><td colspan="2" valign=top> <?
if (($rs["Capacita"]."") == "" and !$upd) {
echo(" - ");
} else {
echo(str_replace("
", "<br>", htmlspecialchars($rs["Capacita"])));
} ?></td>
</tr><tr class=tScuro>
<? if (strtoupper($pg) == strtoupper($HTTP_SESSION_VARS['Login'])) {
echo('<td>'.$par_CurrencyName.'</td><td> '.htmlspecialchars($rs["Soldi"]."").' </td>');
} else {
echo('<td colspan=2> </td>');
}
?>
<td width=100>ICQ/MSN</td><td colspan=2> <?= htmlspecialchars($rs["ICQ"]."") ?></td>
</tr>
<?
if ($rs["Esilio"] == '2037-12-31 00:00:00') {
#gmdate("d M Y H:i:s", mktime (0,0,0,12,31,9999))) {
echo '<tr bgcolor=red><td colspan=5><font color=white>Cacciato il '.formattadata($rs['DataEventoEsilio']).' per sempre dalle libere terre.<br>Motivazione: '.htmlspecialchars($rs["Motivo"]).' ('.htmlspecialchars($rs["AutoreEsilio"]).')</font></td></tr>';
} elseif ($rs["Esilio"] > date("Y-m-d H:i:s")) {
#gmdate("d M Y H:i:s", mktime (0,0,0,12,31,9999))) {
echo '<tr class=tTitolo><td colspan=5><font class=Warning>Imprigionato il '.formattadata($rs['DataEventoEsilio']).'.<br>Motivazione: '.htmlspecialchars($rs["Motivo"]).' ('.htmlspecialchars($rs["AutoreEsilio"]).')</font></td></tr>';
}
#----- Strumenti di Esilio o Prigione -----
if ($_SESSION['Esilio_S']) {
echo '<form onSubmit="return Conferma();" action="scheda.php" method=Post><tr><td colspan=5>Motivo Esilio <input name="Motivo_Esilio" size=40 maxlength=255> <input Name="Esilia" type=submit value="Esilia" style={color:white;background:red}> <input type=checkbox Name=IP style={background:red}> blocco IP <input Name="Grazia" type=checkbox style={background:green}> Grazia</td></tr><input type=hidden Name=pg value="'.$pg.'"></form></td></tr>';
echo '<form onSubmit="return Conferma();" action="scheda.php" method=Post><tr><td colspan=5>Pulisci Avatar <input Name="pg" type=hidden value="'.$pg.'"><input Name="Pulisci" type=submit value="Pulisci" style={color:black;background:white}></form>';
}
if ($_SESSION['Prigione_S']) {
echo '<form onSubmit="return Conferma();" action="scheda.php" method=Post><tr><td colspan=5>Motivo Arresto <input name="Motivo_Arresto" size=40 maxlength=255> <input Name="Arresta" type=submit value="Arresta" style={background:yellow}> per giorni <select Name=gg><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option></select></td></tr><input type=hidden Name=pg value="'.$pg.'"></form>';
}
if ($_SESSION['LogDoppi_S']) {
echo BottoneGestione('Log Doppi', 'D', 'gstLogDoppi.php?Nome='.urlencode($pg));
}
if ($_SESSION['LogFinanza_S'] == '1')
{
echo BottoneGestione('Log Traffici Finanziari', 'F', 'gstLogFinanza.php?Nome='.urlencode($pg));
echo BottoneGestione('Log Oggetti', 'O', 'gst_LogOggetti.php?Nome='.urlencode($pg));
}
if (($_SESSION['Admin_S']=='1') AND ($_SESSION['AdminExt_S']=='1') AND ($par_Flag_AdminExt=='1')) {
echo BottoneGestione('Chiudi Gestione Estesa', '', 'scheda.php?AdminExt=0&pg='.urlencode($pg));
#----- Controlla gli ultimi 10 IP di entrata
echo BottoneGestione('Log Entrate', '', 'gstLogEntrate.php?Nome='.urlencode($pg));
echo '<tr class=tScuro><td colspan=5>';
$MySql = 'SELECT IP FROM LogEntrate WHERE Nome = ''.addslashes($pg).'' ORDER BY DataEvento DESC LIMIT 0,10';
$Result1 = mysql_query($MySql);
while ($rs1 = mysql_fetch_array($Result1)) {
echo '<a href="gstLogEntrate.php?IP='.$rs1['IP'].'">'.$rs1['IP'].'</a><br>';
}
mysql_free_result($Result1);
$rs1->close;
echo '</td></tr>';
#----- Controlla gli ultimi 10 messaggi di chat -----
echo '<tr class=tScuro><td colspan=5>';
$MySql = 'SELECT Chat.*, Mappa.Breve FROM Chat LEFT JOIN Mappa ON Chat.Stanza=Mappa.ID WHERE Mittente=''.addslashes($pg).'' ORDER BY ID DESC LIMIT 0,10';
$Result1 = mysql_query($MySql);
while ($rs1 = mysql_fetch_array($Result1)) {
echo '<b>'.strftime("%H:%M", strtotime($rs1['Ora'])).' '.htmlspecialchars($rs1['Breve']).' ['.$rs1['Tipo'].'] ['.htmlspecialchars($rs1['Mittente']);
if ($rs1['Destinatario'] != '') {
echo '>><a href="scheda.php?pg='.urlencode($rs1['Destinatario']).'">'.htmlspecialchars($rs1['Destinatario']).'</a>';
}
echo ']</b><br>'.$rs1['Testo'].'<br>';
}
mysql_free_result($Result1);
$rs1->close;
echo '</td></tr>';
#----- Controlla le ultime 10 missive -----
echo '<tr class=tScuro><td colspan=5>';
$MySql = 'SELECT * FROM Messaggi WHERE Mittente=''.addslashes($pg).'' ORDER BY ID DESC LIMIT 0,10';
$Result1 = mysql_query($MySql);
while ($rs1 = mysql_fetch_array($Result1)) {
echo '</b></i><b>'.strftime("%d/%m/%Y %H:%M", strtotime($rs1['Spedito'])).' ['.htmlspecialchars($rs1['Mittente']).'>><a href="scheda.php?pg='.urlencode($rs1['Destinatario']).'">'.htmlspecialchars($rs1['Destinatario']).']</a></b><br>';
echo str_replace("
", "<br>", substr($rs1['Testo'],0,200)).'<hr>';
}
mysql_free_result($Result1);
$rs1->close;
echo '</td></tr>';
}
if (($_SESSION['Admin_S']=='1') AND ($_SESSION['AdminExt_S']!='1') AND ($par_Flag_AdminExt=='1')) {
echo BottoneGestione('Apri Gestione Estesa', '', 'scheda.php?AdminExt=1&pg='.urlencode($pg));
}
?>
</table>
<? $rs->close; ?>
<script language="JavaScript">
function Conferma(){
if (confirm('Sei sicuro?'))
return true;
else
return false;
}
</script>
</body>
</html>
<? session_start();
include ('inc/parametri.inc.php');
include ('inc/controllo.php');
include ('inc/open2.php');
$pg = trim($pg);
$Modifica = trim($Login);
$upd = ((strtoupper($pg) == strtoupper($Login)) and (trim($pg) != "") and (strtoupper($Modifica) == strtoupper($pg)));
function barra($valore, $maxvalore)
{
$colore = "55FF55";
$colore1 = "FF4040";
$bar = '<table cellpadding=0 cellspacing=0 border=0 width="'.$valore.'" height=10>';
$bar .= '<tr><td align=right bgcolor="'.$colore.'" width=';
if ($valore > 100) {
$bar .= '100><font color=black>+</font>';
}
else
{
$bar .= $valore.'><img src='img/spacer.gif' width='.$valore.' height=1>';
};
$bar .= "</td>";
if (($maxvalore - $valore) > 0) {
$bar .= '<td align=right bgcolor="'.$colore1.'" width=';
$bar .= ($maxvalore - $valore).'><img src='img/spacer.gif' width='.($maxvalore-$valore).' height=1>';
$bar .= "</td>";
};
$bar .= "</tr>";
$bar .= "</table>
";
return $bar;
};
$MySql = "SELECT Personaggio.*, Razza.Razza, Razza.URLImg AS URLImgRazza, Gilda.Gilda, Gilda.URLImg AS URLImgGilda
FROM Personaggio
LEFT JOIN Razza
ON Personaggio.IDRazza = Razza.IDRazza
LEFT JOIN Gilda
ON Personaggio.IDGilda = Gilda.IDGilda
WHERE Nome = '".pars($pg)."'";
$result = mysql_query($MySql);
$rs = mysql_fetch_array($result);
if ((trim($pg) == "") or !($rs)) {
$rs->close;
mysql_close;
echo("<script><!--
history.back();
//-->
</script>");
exit();
};
#########################################
# Il Recordset non è vuoto #
#########################################
$UrlImg = trim($rs["URLImg"]);
If ($UrlImg == "")
$UrlImg = "img/sagoma".$rs["Sesso"].".gif";
$UrlImgRazza = trim($rs["URLImgRazza"]);
If ($UrlImgRazza == "")
$UrlImgRazza = "spacer.gif";
$UrlImgGilda = trim($rs["URLImgGilda"]);
If ($UrlImgGilda == "")
$UrlImgGilda = "nessuno.gif";
$Gilda = trim($rs["Gilda"]);
if ($Gilda == "") {
if (strtolower($rs["Sesso"]) == "f") {
$Gilda = "Cittadina delle Libere Terre";
} else {
$Gilda = "Cittadino delle Libere Terre";
}
}
include ('inc/header.html.inc.php');
?>
<title>Modifica Scheda <?= $pg ?></title>
</head>
<body bgcolor=#555555>
<table border=0 cellpadding=2 cellspacing=2 class=tChiaro>
<tr>
<td class=tScuro><a href="scheda.php?pg=<?= urlencode($pg) ?>">Scheda Personaggio</a></td>
<td class=tScuro><a href="scheda2.php?pg=<?= urlencode($pg) ?>">Oggetti</a></td>
<? if (strtoupper($pg) == strtoupper($Login)) { ?>
<td>Modifica</td>
<td class=tScuro><a href="scheda4.php?pg=<?= urlencode($pg) ?>">Movimenti</a></td>
<td class=tScuro><a href="scheda5.php?pg=<?= urlencode($pg) ?>">Punti</a></td>
<? } ?>
</tr></table><br><br>
<? if (!($upd)) {exit();} ?>
<table border="1" bordercolor="#F8E9AA" cellspacing="0" cellpadding="2" width="420">
<tr>
<td colspan=4><font class=Titolo><img src="img/testamini<?= strtolower($rs["Sesso"]) ?>.gif"> <?= htmlspecialchars($rs["Nome"]) ?></font></td>
</tr>
<? if ($upd) { ?>
<form action="scheda.php" method="POST">
<input type="hidden" name="pg" value="<?= urlencode($pg) ?>">
<tr>
<td>ATTENZIONE: nessuno può imporre di cambiare la password suggerendo quella nuova. Se accadesse, denunciatelo ai moschettieri.</td>
<td width=100>Password</td><td colspan="2"> <input type="password" name="pass" maxlength="50" value="<?= htmlspecialchars($rs["Pass"]) ?>"></td>
</tr>
<? }
if (($rs["DataNascita"] == "") :: ($rs["DataNascita"] == "0000-00-00")) {
?>
<tr>
<td>ATTENZIONE: impostare la data di nascita per una migliore sicurezza nel recupero della password.</td>
<td align=left>data di nascita (gg/mm/aaaa):</td>
<td align=left colspan=2><input Name="gg" size=2 maxlength=2><input Name="mm" size=2 maxlength=2><input Name="aaaa" size=4 maxlength=4></td>
</tr>
<? } ?>
<tr>
<td rowspan="10" align="left" valign="top" width="200"><img width="200" src="<?= $UrlImg ?>" border="0"></td>
<td width=100>Esperienza</td><td width=20> <?= htmlspecialchars($rs["Esperienza"]) ?></td><td width=100><?= barra($rs["Esperienza"],$rs["MaxEsperienza"]) ?></td>
</tr><tr>
<td width=100>Mente</td><td width=20> <?= htmlspecialchars($rs["Mente"]) ?></td><td width=100><?= barra($rs["Mente"],$rs["MaxMente"]) ?></td>
</tr><tr>
<td width=100>Forza</td><td width=20> <?= htmlspecialchars($rs["Forza"]) ?></td><td width=100><?= barra($rs["Forza"],$rs["MaxForza"]) ?></td>
</tr><tr>
<td width=100>Resistenza</td><td width=20> <?= htmlspecialchars($rs["Resistenza"]) ?></td><td width=100><?= barra($rs["Resistenza"],$rs["MaxResistenza"]) ?></td>
</tr><tr>
<td width=100>Destrezza</td><td width=20> <?= htmlspecialchars($rs["Destrezza"]) ?></td><td width=100><?= barra($rs["Destrezza"],$rs["MaxDestrezza"]) ?></td>
</tr><tr>
<td width=100>Razza</td><td colspan="2"> <?= htmlspecialchars($rs["Razza"]) ?></td>
</tr><tr>
<td width=100>Gilda</td><td colspan="2"> <?= htmlspecialchars($Gilda) ?></td>
<? if (($pg == $Login) && !(strtoupper($Modifica) == strtoupper($pg))) { ?>
</tr><tr>
<td width=100><?= $par_CurrencyName ?></td><td colspan="2"> <?= htmlspecialchars($rs["Soldi"]) ?></td>
<? } ?>
</tr><tr>
<td width=100>Dice di sé</td><td colspan="2"> <?
if ((trim($rs["Descrizione"]) == "") && !($upd)) {
echo "niente";
} else {
if ($upd) {
echo "<textarea cols=40 rows=4 name="descrizione">".htmlspecialchars($rs["Descrizione"])."</textarea>";
} else {
echo htmlspecialchars($rs["Descrizione"]);
}
} ?></td>
</tr><tr>
<td width=100>Affetti</td><td colspan="2"> <?
if (trim($rs["Affetti"] == "") && !($upd)) {
echo "niente";
} else {
if ($upd) {
echo "<textarea cols=40 rows=4 name="affetti">".htmlspecialchars($rs["Affetti"])."</textarea>";
} else {
echo htmlspecialchars($rs["Affetti"]);
}
} ?></td>
</tr><tr>
<td width=100>Capacitá</td><td colspan="2"> <?
if ((trim($rs["Capacita"]) == "") && !($upd)) {
echo "niente";
} else {
if ($upd) {
echo "<textarea cols=40 rows=4 name="capacita">".htmlspecialchars($rs["Capacita"])."</textarea>";
} else {
echo htmlspecialchars($rs["Capacita"]);
}
} ?></td>
</tr><tr>
<td width=100>ICQ/MSN</td><td colspan="3"> <?
if ($upd) {
echo "<input type="text" name="icq" value="".htmlspecialchars($rs["ICQ"])."" maxlength=50 size=50>";
} else {
echo htmlspecialchars(rs("ICQ") & "");
} ?></td>
</tr><tr>
<td width=100>Master</td><td colspan="3"> <?
if ($rs["Master"] == 1) {
echo "Sì";
} else {
echo "No";
} ?></td>
</tr>
<? if ($upd) { ?>
<tr>
<td>URL Immagine</td><td colspan="3"> <input type="text" name="urlimg" maxlength="255" value="<?= htmlspecialchars($rs["URLImg"]) ?>" size=40></td>
</tr>
<tr>
<td>Modifica</td><td colspan="3"> <input type="Submit" value="Modifica <?= $pg ?>"></td>
</tr>
</form>
<? } ?></table>
<? $rs->close;
?>
</body>
</html>
P.S: volendo creare un campo in scheda.php visibile solo dal pg e da certi master come faccio in 2 parole?
Grazie e scusate se vi assillo con richieste apparantemente assurde ma io e il php nn ci amiamo proprio.^^
Pagine → 1
19/09/2007 23:22:58
Per i nuovi campi resistenza e destrezza dovete modificare anche i file di iscrizione (di solito iscrizione2) in modo che vengano assegnati i punteggi stabiliti all'interno dei campi del db di ogni PG.
Per la visualizzazione da parte del solo PG e di alcuni master è sufficiente inserire una riga che vada a controllare se la sessione è "Login" e "Master".
19/09/2007 23:51:46
shevran ha scritto: Per i nuovi campi resistenza e destrezza dovete modificare anche i file di iscrizione (di solito iscrizione2) in modo che vengano assegnati i punteggi stabiliti all'interno dei campi del db di ogni PG.
Per la visualizzazione da parte del solo PG e di alcuni master è sufficiente inserire una riga che vada a controllare se la sessione è "Login" e "Master".
Grazie.
Il primo problema l'ho risolto, il secondo quasi.
In pratica io voglio creare una cella in scheda.php nella quale il master e il pg possano legger il background del pg stesso. Questi lo scrive in sheda3.php. Io ho aggiunto una texarea in scheda3 ma non si aggiorna in scheda.php (dove ovviamente ho creato la riga del background)
20/09/2007 10:41:43
beh allora indicami cm fare^^
non è mica obbligato xD
prenditi l'extreme e guarda come ha fatto, si impara di più sforzandosi che facendosi dare la risposta bella pronta.
20/09/2007 11:08:17
arry_blu ha scritto: [quote]beh allora indicami cm fare^^
non è mica obbligato xD
prenditi l'extreme e guarda come ha fatto, si impara di più sforzandosi che facendosi dare la risposta bella pronta.[/quote]
ma infatti non lo volevo obbligare. E' solo che, come ho già detto all'inizio, io e php non andiamo d'accordo e pertanto avrei potuto non trovare la parte che interessava a me cercando da solo. Cmq grazie faber; non appena finisco e verifico posto. (per la gst_stastus sto ancora in alto mare inveceT_T)
20/09/2007 11:43:46
locke ha scritto: [quote]arry_blu ha scritto: [quote]beh allora indicami cm fare^^
non è mica obbligato xD
prenditi l'extreme e guarda come ha fatto, si impara di più sforzandosi che facendosi dare la risposta bella pronta.[/quote]
ma infatti non lo volevo obbligare. E' solo che, come ho già detto all'inizio, io e php non andiamo d'accordo e pertanto avrei potuto non trovare la parte che interessava a me cercando da solo. Cmq grazie faber; non appena finisco e verifico posto. (per la gst_stastus sto ancora in alto mare inveceT_T) [/quote]
grazie faber tutto risolto ^^.
Speriamo di farcela anche per il file dello stato.
Pagine → 1
Rispondi alla Discussione Segui Discussione Inoltra Discussione Forum Programmazione, Open Source e Hosting Elenco Forum
Articoli, Interviste e altre Risorse!
War Thunder ↗
Foundation Galactic Frontier ↗
AlterEgo ↗
World of Warship ↗
Wuthering Waves ↗