Hallo hallo,
ich hab ein (hoffenlich) kleines Problem, folgende Situation:
ich habe ein Template und ein Skript, das Skript begfüllt innerhalb eines zweidimensionalen Loops ein Formular das Zeilenweise gleichaussieht (Aufbau ebenfalls durch Loop)
für die letzte SQL-Anweisung benötige ich den Wert! Ach ja wie ihr seht benutze ich Sessions, um genau zu sein die ADOdb-Bibliothek!
Gruss
Dominik
ich hab ein (hoffenlich) kleines Problem, folgende Situation:
ich habe ein Template und ein Skript, das Skript begfüllt innerhalb eines zweidimensionalen Loops ein Formular das Zeilenweise gleichaussieht (Aufbau ebenfalls durch Loop)
PHP:
<table>
<tmpl_loop name="system_loop">
<tr>
<td width="100px" valign="top">
<form method="post">
<input type="hidden" name="HiddenField" value"{tmpl_var name='id'}">
{tmpl_var name='id'}
</td>
<td valign="top">
<select name="auswahl_br" class="Listing" size="1">
<option selected>{tmpl_var name='baureihe'}</option>
<tmpl_loop name="br_rest">
<option>{tmpl_var name='br'}</option>
</tmpl_loop>
</select>
</td>
<td valign="top">
<select name="auswahl_ma" class="Listing" size="1">
<option selected>{tmpl_var name='markt'}</option>
<tmpl_loop name="ma_rest">
<option>{tmpl_var name='ma'}</option>
</tmpl_loop>
</select>
</td>
<td valign="top">
<select name="auswahl_va" class="Listing" size="1">
<option>{tmpl_var name='var'}</option>
<option selected>{tmpl_var name='variante'}</option>
<tmpl_loop name="va_rest">
<option>{tmpl_var name='va'}</option>
</tmpl_loop>
</select>
</td>
<td valign="top" align="left">
<input name="send" type="submit" class="Button" value="OK" onclick="this.form.action='System_update.php'">
<input name="send" type="submit" class="Button2" value="{tmpl_var name='loeschen'}" onclick="this.form.action='System_new.php'"></form>
</td>
</tr>
</tmpl_loop>
<tr>
<td><font color="#D2D0CF">-</font></td>
</tr>
<tr>
<td><font color="#D2D0CF">-</font></td>
</tr>
</table>
<hr width="800px" align="left">
<table>
<tr>
<td><font size="4px"><b>{tmpl_var name='system2'}</b></font></td>
</tr>
<tr>
<td><font color="#D2D0CF">-</font></td>
</tr>
</table>
nun ist in jeder Zeile ein HiddenField das den jeweiligen Datensatz identifizieren soll, es wird aus dem Skript mit einer Templatevariablen (vlibTemplate) befüllt, leider habe fehlt mir bei betätigung des okay buttons der Wert im aufgerufenen Skript:
<?
Global $HTTP_SESSION_VARS;
require("../header.php");
@session_start();
if ($s_sessionid==""){
$tmplK = new vlibTemplate('../Templates/kick_u_tmpl.html');
$tmplK->pparse();
}
else{
$tmpl = new vlibTemplate('../Templates/Fahrzeugsysteme_tmpl.html');
..........
$dbh=my_connect();
$br_suche=$dbh->Execute("SELECT * FROM baureihe WHERE Baureihe='$auswahl_br';");
$brID=$br_suche->fields[0].'';
$ma_suche=$dbh->Execute("SELECT * FROM markt WHERE Markt='$auswahl_ma';");
$maID=$ma_suche->fields[0].'';
$va_suche=$dbh->Execute("SELECT * FROM variante WHERE VarianteLang='$auswahl_va';");
$vaID=$va_suche->fields[0].'';
if($auswahl_va == "variant" or $auswahl_va == "Variante"){
$vaID=0;
}
echo $HiddnField;
$dbh->Execute("UPDATE system SET BaureihenID='$brID', MarktID='$maID', VariantenID='$vaID' WHERE ID = '$HiddenField';");
Gruss
Dominik