Hi Leute,
was stimmt hier an dem Update Synthax nicht? Es wird nichts upgedatet, aber es erscheint auch keine Fehlermeldung. Ich komm nicht drauf. Über jeden Tipp wäre ich supi dankbar.
Bearbeiten.php
change_befehl.php
was stimmt hier an dem Update Synthax nicht? Es wird nichts upgedatet, aber es erscheint auch keine Fehlermeldung. Ich komm nicht drauf. Über jeden Tipp wäre ich supi dankbar.
Bearbeiten.php
PHP-Code:
<?php
include "config/conn_db.php";
$result = mysql_query("select * from ww,verant,knecht where
ww.id_w='".$_GET ['id_w']."' and
abteilung ='Walzwerk'
",$db_link);
$frist = mysql_result($result,$i,frist );
$ist = mysql_result($result,$i,ist );
$Bemerkung = mysql_result($result,$i,Bemerkung );
$massnahme = mysql_result($result,$i,massnahme );
$prio = mysql_result($result,$i,prio );
$mass = mysql_result($result,$i,mass );
$quelle = mysql_result($result,$i,quelle );
$eingetragen = mysql_result($result,$i,eingetragen);
$stand = mysql_result($result,$i,stand );
$v_name = mysql_result($result,$i,v_name );
$k_name = mysql_result($result,$i,k_name );
$name = mysql_result($result,$i,name );
?>
</div>
<div id="text">
<center>
<form action="change_befehl.php" name="q1" method="post"
enctype="multipart/form-data" onSubmit="return validator()">
<input type="hidden" name="id_w" value="<?php echo $_GET['id_w']?>">
<table padding="0" border="0" width="auto" vertical-align="top">
<tr><td align="left" colspan="5"><h1>Qualitätsbericht anlegen</h1></td></tr>
<tr><td colspan="4"> </td></tr>
<tr>
<td valign="top">Bearbeitungsfrist:*</td>
<td>
<input type="text" name="frist" size="12" maxlength="12" value='<?php echo $frist ?>' onFocus="getCalendarFor(this)"> <a href="#" onClick="getCalendarFor(document.q1.frist);return false"><b>[Datum wählen]</b></a>
</td></tr>
<tr><td colspan="2"><img src="img/blank.gif" width="*" height="10" border="0" alt=""></td></tr>
<tr>
<td valign="top">Priorität:*</td>
<td valign="top">
<?php
if ($prio == 'hoch')
{
echo '
<input type="radio" name="prio" value="hoch" checked >Hoch<br>
<input type="radio" name="prio" value="mittel" >Mittel<br>
<input type="radio" name="prio" value="gering" >Gering<br> ';
}
else if ($prio == 'mittel')
{
echo '
<input type="radio" name="prio" value="hoch" >Hoch<br>
<input type="radio" name="prio" value="mittel" checked>Mittel<br>
<input type="radio" name="prio" value="gering" >Gering<br> ';
}
else
{
echo '
<input type="radio" name="prio" value="hoch" >Hoch<br>
<input type="radio" name="prio" value="mittel" >Mittel<br>
<input type="radio" name="prio" value="gering" checked>Gering<br> ';
}
?>
</td>
</tr>
<tr><td colspan="2"><img src="img/blank.gif" height="10" border="0" alt=""></td></tr>
<td valign="top" width="*">Ist Zustand:*</td>
<td valign="top"><textarea name="ist" cols="30" rows="4"><?php echo $ist ?></textarea></td>
</tr>
<tr><td colspan="2"><img src="img/blank.gif" height="10" border="0" alt=""></td></tr>
<tr>
<td valign="top">Maßnahme:*</b></td>
<td valign="top"><textarea name="massnahme" cols="30" rows="4"><?php echo $massnahme?></textarea></td>
<tr><td colspan="2"><img src="img/blank.gif" height="10" border="0" alt=""></td></tr>
</tr>
<tr><td colspan="2"><img src="img/blank.gif" height="10" border="0" alt=""></td></tr>
<tr>
<td valign="top">Massnahme erfolgreich?*</td>
<td valign="top">
<?php
if ($mass == 'yes')
{
echo '
<input type="radio" name="mass" value="yes" checked >Ja<br>
<input type="radio" name="mass" value="no" >Nein<br> ';
}
else
{
echo '
<input type="radio" name="mass" value="yes" >Ja<br>
<input type="radio" name="mass" value="no" checked>Nein<br> ';
}
?>
</tr>
<tr><td colspan="2"><img src="img/blank.gif" height="10" border="0" alt=""></td></tr>
<tr>
<td valign="top">Verantwortlicher:*</td>
<td valign="top">
<select name="id_v">
<option value="">Wählen Sie</option>
<?php
$sql = "SELECT id_v,v_name FROM verant";
$result = mysql_query($sql) OR die(mysql_error());
while($row = mysql_fetch_assoc($result)) {
echo "<option value=". $row['id_v'].">
" . $row['v_name'] .
"</option>";
}
?>
</select></td>
</tr>
<tr><td colspan="2"><img src="img/blank.gif" height="10" border="0" alt=""></td></tr>
<td valign="top">Ausführender:*</td>
<td valign="top">
<select name="id_k">
<option value="">Wählen Sie</option>
<?php
$sql = "SELECT id_k,k_name FROM knecht";
$result = mysql_query($sql) OR die(mysql_error());
while($row = mysql_fetch_assoc($result)) {
echo "<option value=". $row['id_k'].">
" . $row['k_name'] .
"</option>";
}
?>
</select></td>
<tr><td colspan="2"><img src="img/blank.gif" height="10" border="0" alt=""></td></tr>
<tr>
<td valign="top">Quelle:*</td>
<td valign="top">
<select name="quelle" size="1" >
<?php
if ($quelle == 'A')
{
echo '
<option value ></option>
<option value="OHSAS">OHSAS</option>
<option value="A" selected>A</option>
<option value="P">P</option>
<option value="Q">Q</option>
<option value="U">U</option> ';
}
else if ($quelle == 'P')
{
echo '
<option value ></option>
<option value="OHSAS">OHSAS</option>
<option value="A">A</option>
<option value="P" selected>P</option>
<option value="Q">Q</option>
<option value="U">U</option> ';
}
else if ($quelle == 'Q')
{
echo '
<option value ></option>
<option value="OHSAS">OHSAS</option>
<option value="A">A</option>
<option value="P">P</option>
<option value="Q" selected>Q</option>
<option value="U">U</option> ';
}
else
{
echo '
<option value ></option>
<option value="OHSAS">OHSAS</option>
<option value="A">A</option>
<option value="P">P</option>
<option value="Q">Q</option>
<option value="U" selected>U</option> ';
}
?>
</select>
</td>
</tr>
<tr><td colspan="2"><img src="img/blank.gif" height="10" border="0" alt=""></td></tr>
<tr>
<td valign="top">Bearbeitungsstand:</b></td>
<td> <?php
if ($stand == 'offen')
{
echo '
<input type="radio" name="stand" value="offen" checked >Offen<br>
<input type="radio" name="stand" value="bearbeitung" >In Bearbeitung<br>
<input type="radio" name="stand" value="erledigt" >Erledigt<br> ';
}
else if ($stand == 'bearbeitung')
{
echo '
<input type="radio" name="stand" value="offen" >Offen<br>
<input type="radio" name="stand" value="bearbeitung" checked>In Bearbeitung<br>
<input type="radio" name="stand" value="erledigt" >Erledigt<br> ';
}
else
{
echo '
<input type="radio" name="stand" value="offen" >Offen<br>
<input type="radio" name="stand" value="bearbeitung" >In Bearbeitung<br>
<input type="radio" name="stand" value="erledigt" checked>Erledigt<br> ';
}
?></td>
</tr>
<tr><td colspan="2"><img src="img/blank.gif" height="10" border="0" alt=""></td></tr>
<tr>
<td valign="top">Bemerkung:</b></td>
<td><textarea name="Bemerkung" cols="25" rows="4"><?php echo $Bemerkung ?></textarea></td>
</tr>
<tr><td colspan="2"><img src="img/blank.gif" height="10" border="0" alt=""></td></tr>
<tr>
<td valign="top">Eingetragen von :</b></td>
<td><input name="eingetragen" type="text" size="3" maxlength="5"
value='<?php echo $eingetragen ?>'> [Namenskürzel]</td>
</tr>
<tr><td colspan="2"><img src="img/blank.gif" height="10" border="0" alt=""></td></tr>
<tr>
<td valign="top">Anhang hochladen:</b>
<input type="hidden" name="MAX_FILE_SIZE" value="2000000">
</td><td><?php echo $name ?>
<input name="userfile" type="file" id="userfile" ></td>
</tr>
<tr><td colspan="2"><img src="img/blank.gif" height="10" border="0" alt=""></td></tr>
<tr><td><img src="img/blank.gif" height="10" border="0" alt=""></td>
<td colspan="1"><input type="submit" value="Ändern" name="upload" class="box" id="upload">
<input type="reset" value="Daten löschen" ></td>
</tr>
</table>
</center>
</form>
</div>
</div>
</div>
</div>
</body>
</html>
PHP-Code:
<?php
include ("config/conn_db.php");
$id_w =$_POST["id_w"];
$ist =$_POST["ist"];
$frist =$_POST["frist"];
$Bemerkung =$_POST["Bemerkung"];
$massnahme =$_POST["massnahme"];
$prio =$_POST["prio"];
$mass =$_POST["mass"];
$bcolor =$_POST["bcolor"];
$quelle =$_POST["quelle"];
$stand =$_POST["stand"];
$eingetragen =$_POST["eingetragen"];
$v_name =$_POST["v_name"];
$id_v =$_POST["id_v"];
$k_name =$_POST["k_name"];
$id_k =$_POST["id_k"];
$upload =$_POST["upload"];
if(isset($_POST['upload']) && $_FILES['userfile']['size'] > 0)
{
$fileName = $_FILES['userfile']['name'];
$tmpName = $_FILES['userfile']['tmp_name'];
$fileSize = $_FILES['userfile']['size'];
$fileType = $_FILES['userfile']['type'];
$fp = fopen($tmpName, 'r');
$content = fread($fp, filesize($tmpName));
$content = addslashes($content);
fclose($fp);
if(!get_magic_quotes_gpc())
{
$fileName = addslashes($fileName);
}
}
$result = mysql_query
("UPDATE ww,knecht,verant set
ist ='".$_POST['ist']."',
frist ='".$_POST['frist']."',
Bemerkung ='".$_POST['Bemerkung']."',
massnahme ='".$_POST['massnahme']."',
prio ='".$_POST['prio']."',
mass ='".$_POST['mass']."',
bcolor ='".$_POST['bcolor']."',
quelle ='".$_POST['quelle']."',
stand ='".$_POST['stand']."',
eingetragen ='".$_POST['eingetragen']."',
v_name ='".$_POST['v_name']."',
id_v ='".$_POST['id_v']."',
k_name ='".$_POST['k_name']."',
id_k ='".$_POST['id_k']."',
name ='$fileName',
size ='$fileSize',
type ='$fileType',
content ='$content'
WHERE
id_w='".$_POST['id_w']."' and
abteilung='Walzwerk'",$db_link);
$row = @mysql_fetch_array($result);
mysql_close();
echo'<META HTTP-EQUIV=REFRESH CONTENT="2; URL=q_ansehen.php">'; ?>
<center>
<table cellpadding="0" cellspacing="0" border="0">
<tr><td>
<b style="color:white;font-size:14px"><br><br>
Bitte haben Sie einen Moment Geduld...</td></tr>
</table>
</center>
</body>
</html>
Kommentar