Ciao ragazzi, io ho una tabella da cui recuper i dati dal DB.
E ho due link immagine, uno prima della tabella (aggiungi record) e uno su ogni riga (update record)
Ora, cliccando su l'uno o sull'altro non mi fa le operazioni che dovrebbe (aggiungere o creare degli input text nella tabella per modificare o creare record).
Vi metto il codice e una faccina arrabbiata () dove sono i pulsanti e dove li richiamo!
Aiutatemi per favore :D
Codice PHP:
<?php
//@PascalPavanSGT2A
session_start();
?>
<head>
<title>Pianificazione Settimanale</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../css/CalendarioContainer/tcal.css" />
<link rel="stylesheet" type="text/css" href="../css/visualizzazioneTabelle/table.css" />
<script type="text/javascript" src="../js/CalendarioContainer/tcal.js"></script>
</head>
<center>
<?php
echo '<a href="?op=addPianSett"><img src="http://forum.it.altervista.org/immagini/bottoni/add_user.png"></a>';
echo '</center>';
include '../filtri/SearchPianificazioneSettimanale.php';
if($db->num_rows){
echo '<table class="hovertable">';
echo "<tr>";
echo "<th>Dossier</th>";
echo "<th>Zone</th>";
echo "<th>Laaddatum</th>";
echo "<th>Laadplaats</th>";
echo "<th>Afzender</th>";
echo "<th>Losdatum</th>";
echo "<th>Losplaats</th>";
echo "<th>Ontvanger</th>";
echo "<th>Type</th>";
echo "<th>Aantal</th>";
echo "<th>LM</th>";
echo "<th>TON</th>";
echo "<th>Bijzonderheden</th>";
echo "<th>Magazijn</th>";
echo "<th>Vervoerder</th>";
echo "<th>Kenteken</th>";
if($user->admin)
{
echo "<th></th>";
}
echo "<th></th>";
echo "</tr>";
if($_REQUEST["op"]=="addPianSett")//aggiungere utente, inserisci i campi vuoti nella tabella :incavolat
{
echo '<tr><form name="addNewUser" method="POST">';
echo '<td><input type="text" name="newDossier" value="" style="width: 75px;"/></td>';
echo '<td><input type="text" name="newZone" value="" style="width: 40px;"/></td>';
echo '<td><input type="text" name="newLaaddatum" value="" class="tcal" style="width: 73px;"/></td>';
echo '<td><input type="text" name="newLaadplaats" value="" style="width: 85px;"/></td>';
echo '<td><input type="text" name="newAfzender" value="" style="width: 75px;"/></td>';
echo '<td><input type="text" name="newLosdatum" value="" class="tcal" style="width: 73px;"/></td>';
echo '<td><input type="text" name="newLosplaats" value="" style="width: 75px;"/></td>';
echo '<td><input type="text" name="newOntvanger" value="" style="width: 75px;"/></td>';
echo '<td ><center>';
$sqlCon="Select omschrijving from typelm";
$qCon=mysql_query($sqlCon);
echo '<select name="newType" style="width: 45px;">';
while($rowCon = mysql_fetch_array($qCon))
{
echo "<option value='".$rowCon['omschrijving']."'>".$rowCon['omschrijving']."</option>";
}
echo '</select></center></td>';
echo '<td><input type="text" name="newAantal" value="" style="width: 43px;"/></td>';
echo '<td><input type="text" name="newPeso" value="" style="width: 26px;"/></td>';
echo '<td><input type="text" name="newTON" value="" style="width: 26px;"/></td>';
echo '<td><input type="text" name="newBijzonderheden" value="" style="width: 100px;"/></td>';
echo '<td><input type="text" name="newMagazijn" value="" style="width: 73px;"/></td>';
echo '<td><input type="text" name="newVervoerder" value="" style="width: 73px;"/></td>';
echo '<td><input type="text" name="newKenteken" value="" style="width: 73px;"/></td>';
echo '<td colspan="2"><input type="submit" value="Insert" name="insPianSett" /></td>';
echo "</form></tr>";
}
while($fetch = mysql_fetch_object($db->result)){
if($_REQUEST["op"]=="updatePianSett" && $_REQUEST["id"] == $fetch->ID)//nel caso update .. :incavolat
{
echo '<tr><form name="addNewUser" method="POST">';
echo '<td ><input type="text" name="newPianDosseir" value="'.$fetch->Dossier.'" style="width: 75px;"/></td>';
echo '<td><input type="text" name="newPianZone" value="'.$fetch->Zone.'" style="width: 40px;"/></td>';
echo '<td><input type="text" name="newPianLaaddatum" value="'.$fetch->Laaddatum.'" class="tcal" style="width: 73px;"/></td>';
echo '<td><input type="text" name="newPianLaadplaats" value="'.$fetch->Laadplaats.'" style="width: 85px;"/></td>';
echo '<td><input type="text" name="newPianAfzender" value="'.$fetch->Afzender.'" style="width: 75px;"/></td>';
echo '<td><input type="text" name="newPianLosdatum" value="'.$fetch->Losdatum.'" class="tcal" style="width: 73px;"/></td>';
echo '<td><input type="text" name="newPianLosplaats" value="'.$fetch->Losplaats.'" style="width: 75px;"/></td>';
echo '<td><input type="text" name="newPianOntvanger" value="'.$fetch->Ontvanger.'" style="width: 75px;"/></td>';
echo '<td ><center>';
$sqlCon1="Select * from typelm";
$qCon1=mysql_query($sqlCon1);
echo '<select name="newPianType">';
while($rowCon1 = mysql_fetch_array($qCon1))
{
if ($rowCon1['waarde']==$fetch->Type2)
echo "<option selected = “selected” value='".$rowCon1['omschrijving']."'>".$rowCon1['omschrijving']."</option>";
else
echo "<option value='".$rowCon1['omschrijving']."'>".$rowCon1['omschrijving']."</option>";
}
echo '</select></td>';
echo '<td><input type="text" name="newPianAantal" value="'.$fetch->Aantal.'"style="width: 43px;"/></td>';
echo '<td><input type="text" name="newPianLM" value="'.$fetch->LM.'" style="width: 26px;"/></td>';
echo '<td><input type="text" name="newPianTON" value="'.$fetch->TON.'" style="width: 26px;"/></td>';
echo '<td><input type="text" name="newPianBijzonderheden" value="'.$fetch->Bijzonderheden.'" style="width: 100px;"/></td>';
echo '<td><input type="text" name="newPianMagazijn" value="'.$fetch->Magazijn.'" style="width: 73px;"/></td>';
echo '<td><input type="text" name="newPianVervoerder" value="'.$fetch->Vervoerder.'" style="width: 73px;"/></td>';
echo '<td><input type="text" name="newPianKenteken" value="'.$fetch->Kenteken.'" style="width: 73px;"/></td>';
echo '<center><td colspan="2"><input type="submit" value="Update" name="updatePianSett" /></center></td>';
echo "</form></tr>";
}
else
{
echo "<tr>";
?>
<tr onmouseover="this.style.backgroundColor='#ffff66';" onmouseout="this.style.backgroundColor='#d4e3e5';">'
<?php
echo '<td><center>'.$fetch->Dossier.'</td>';
echo "<td>".$fetch->Zone."</td>";
echo "<td>".substr($fetch->Laaddatum, 0,5)."</td>";
echo "<td>".$fetch->Laadplaats."</td>";
echo "<td>".$fetch->Afzender."</td>";
echo "<td>".substr($fetch->Losdatum, 0,5)."</td>";
echo "<td>".$fetch->Losplaats."</td>";
echo "<td>".$fetch->Ontvanger."</td>";
echo "<td>".$fetch->Type."</td>";
echo "<td>".$fetch->Aantal."</td>";
echo "<td>".$fetch->LM."</td>";
echo "<td>".$fetch->TON."</td>";
echo "<td>".$fetch->Bijzonderheden."</td>";
echo "<td>".$fetch->Magazijn."</td>";
echo "<td>".$fetch->Vervoerder."</td>";
echo "<td>".$fetch->Kenteken."</td>";
if($user->admin)
{
echo "<td> <center><a href=\"?op=deletePianSett&id=".$fetch->ID."\"><img src=\"../immagini/bottoni/delete_user.png\"></a></center></td>"; :incavolat
}
echo "<td> <center><a href=\"?op=updatePianSett&id=".$fetch->ID."\"><img src=\"../immagini/bottoni/edit_user.png\"></a></center></td>"; :incavolat
echo "</tr>";
}
}
echo "</table>";
}
else
$db->api_close_db();
?>