<?php
//Connection statement
require_once('Connections/conn.php');
//Aditional Functions
require_once('includes/functions.inc.php');
// build the form action
$editFormAction = $_SERVER['PHP_SELF'] . (isset($_SERVER['QUERY_STRING']) ? "?" . $_SERVER['QUERY_STRING'] : "");
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE t_kurs SET t_applikation_id=%s, t_dozent_id=%s, t_raum_id=%s, t_status_id=%s, kursbeschrieb=%s, date1=%s, start_time1=%s, end_time1=%s, date2=%s, start_time2=%s, end_time2=%s, date3=%s, start_time3=%s, end_time3=%s, date4=%s, start_time4=%s, end_time4=%s, date5=%s, start_time5=%s, end_time5=%s, ueberbuchung=%s, min_teilnehmer=%s WHERE id=%s",
GetSQLValueString($_POST['t_applikation_id'], "int"),
GetSQLValueString($_POST['t_dozent_id'], "int"),
GetSQLValueString($_POST['t_raum_id'], "int"),
GetSQLValueString($_POST['t_status_id'], "int"),
GetSQLValueString($_POST['kursbeschrieb'], "text"),
GetSQLValueString($_POST['date1'], "date"),
GetSQLValueString($_POST['start_time1'], "text"),
GetSQLValueString($_POST['end_time1'], "text"),
GetSQLValueString($_POST['date2'], "date"),
GetSQLValueString($_POST['start_time2'], "text"),
GetSQLValueString($_POST['end_time2'], "text"),
GetSQLValueString($_POST['date3'], "date"),
GetSQLValueString($_POST['start_time3'], "text"),
GetSQLValueString($_POST['end_time3'], "text"),
GetSQLValueString($_POST['date4'], "date"),
GetSQLValueString($_POST['start_time4'], "text"),
GetSQLValueString($_POST['end_time4'], "text"),
GetSQLValueString($_POST['date5'], "date"),
GetSQLValueString($_POST['start_time5'], "text"),
GetSQLValueString($_POST['end_time5'], "text"),
GetSQLValueString($_POST['ueberbuchung'], "int"),
GetSQLValueString($_POST['min_teilnehmer'], "int"),
GetSQLValueString($_POST['id'], "int"));
$Result1 = $conn->Execute($updateSQL) or die($conn->ErrorMsg());
$updateGoTo = "k_kurs_bearb.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
KT_redir($updateGoTo);
}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form3")) {
$updateSQL = sprintf("UPDATE t_kursbesuche SET t_mitarbeiter_id=%s, t_statKB_id=%s WHERE id=%s",
GetSQLValueString($_POST['t_mitarbeiter_id'], "int"),
GetSQLValueString($_POST['t_statKB_id'], "int"),
GetSQLValueString($_POST['id'], "int"));
$Result1 = $conn->Execute($updateSQL) or die($conn->ErrorMsg());
$updateGoTo = "k_kurs_bearb__.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
KT_redir($updateGoTo);
}
// begin Recordset
$query_sucheApplikation = "SELECT * FROM t_applikation";
$sucheApplikation = $conn->SelectLimit($query_sucheApplikation) or die($conn->ErrorMsg());
$totalRows_sucheApplikation = $sucheApplikation->RecordCount();
// end Recordset
// begin Recordset
$query_sucheDozent = "SELECT * FROM t_dozent";
$sucheDozent = $conn->SelectLimit($query_sucheDozent) or die($conn->ErrorMsg());
$totalRows_sucheDozent = $sucheDozent->RecordCount();
// end Recordset
// begin Recordset
$query_sucheStatus = "SELECT * FROM t_status";
$sucheStatus = $conn->SelectLimit($query_sucheStatus) or die($conn->ErrorMsg());
$totalRows_sucheStatus = $sucheStatus->RecordCount();
// end Recordset
// begin Recordset
$query_sucheRaum = "SELECT * FROM t_raum";
$sucheRaum = $conn->SelectLimit($query_sucheRaum) or die($conn->ErrorMsg());
$totalRows_sucheRaum = $sucheRaum->RecordCount();
// end Recordset
// begin Recordset
$colname__mutiereKurs = '-1';
if (isset($_GET['recordID'])) {
$colname__mutiereKurs = $_GET['recordID'];
}
$query_mutiereKurs = sprintf("SELECT * FROM t_kurs WHERE id = %s", GetSQLValueString($colname__mutiereKurs, "int"));
$mutiereKurs = $conn->SelectLimit($query_mutiereKurs) or die($conn->ErrorMsg());
$totalRows_mutiereKurs = $mutiereKurs->RecordCount();
// end Recordset
// begin Recordset
$colname__mutiereKursbesuche = '-1';
if (isset($_GET['recordID'])) {
$colname__mutiereKursbesuche = $_GET['recordID'];
}
$query_mutiereKursbesuche = sprintf("SELECT * FROM t_kursbesuche WHERE t_kurs_id = %s AND fld1 = 1", GetSQLValueString($colname__mutiereKursbesuche, "int"));
$mutiereKursbesuche = $conn->SelectLimit($query_mutiereKursbesuche) or die($conn->ErrorMsg());
$totalRows_mutiereKursbesuche = $mutiereKursbesuche->RecordCount();
// end Recordset
// begin Recordset
$query_sucheMitarbeiter = "SELECT * FROM t_mitarbeiter";
$sucheMitarbeiter = $conn->SelectLimit($query_sucheMitarbeiter) or die($conn->ErrorMsg());
$totalRows_sucheMitarbeiter = $sucheMitarbeiter->RecordCount();
// end Recordset
// begin Recordset
$colname__mutiereKursbesuche2 = '-1';
if (isset($_GET['recordID'])) {
$colname__mutiereKursbesuche2 = $_GET['recordID'];
}
$query_mutiereKursbesuche2 = sprintf("SELECT * FROM t_kursbesuche WHERE t_kurs_id = %s AND fld1 = 2", GetSQLValueString($colname__mutiereKursbesuche2, "int"));
$mutiereKursbesuche2 = $conn->SelectLimit($query_mutiereKursbesuche2) or die($conn->ErrorMsg());
$totalRows_mutiereKursbesuche2 = $mutiereKursbesuche2->RecordCount();
// end Recordset
// begin Recordset
$colname__mutiereKursbesuche3 = '-1';
if (isset($_GET['recordID'])) {
$colname__mutiereKursbesuche3 = $_GET['recordID'];
}
$query_mutiereKursbesuche3 = sprintf("SELECT * FROM t_kursbesuche WHERE t_kurs_id = %s AND fld1 = 3", GetSQLValueString($colname__mutiereKursbesuche3, "int"));
$mutiereKursbesuche3 = $conn->SelectLimit($query_mutiereKursbesuche3) or die($conn->ErrorMsg());
$totalRows_mutiereKursbesuche3 = $mutiereKursbesuche3->RecordCount();
// end Recordset
// begin Recordset
$colname__mutiereKursbesuche4 = '-1';
if (isset($_GET['recordID'])) {
$colname__mutiereKursbesuche4 = $_GET['recordID'];
}
$query_mutiereKursbesuche4 = sprintf("SELECT * FROM t_kursbesuche WHERE t_kurs_id = %s AND fld1 = 4", GetSQLValueString($colname__mutiereKursbesuche4, "int"));
$mutiereKursbesuche4 = $conn->SelectLimit($query_mutiereKursbesuche4) or die($conn->ErrorMsg());
$totalRows_mutiereKursbesuche4 = $mutiereKursbesuche4->RecordCount();
// end Recordset
// begin Recordset
$colname__mutiereKursbesuche5 = '-1';
if (isset($_GET['recordID'])) {
$colname__mutiereKursbesuche5 = $_GET['recordID'];
}
$query_mutiereKursbesuche5 = sprintf("SELECT * FROM t_kursbesuche WHERE t_kurs_id = %s AND fld1 = 5", GetSQLValueString($colname__mutiereKursbesuche5, "int"));
$mutiereKursbesuche5 = $conn->SelectLimit($query_mutiereKursbesuche5) or die($conn->ErrorMsg());
$totalRows_mutiereKursbesuche5 = $mutiereKursbesuche5->RecordCount();
// end Recordset
// begin Recordset
$colname__mutiereKursbesuche6 = '-1';
if (isset($_GET['recordID'])) {
$colname__mutiereKursbesuche6 = $_GET['recordID'];
}
$query_mutiereKursbesuche6 = sprintf("SELECT * FROM t_kursbesuche WHERE t_kurs_id = %s AND fld1 = 6", GetSQLValueString($colname__mutiereKursbesuche6, "int"));
$mutiereKursbesuche6 = $conn->SelectLimit($query_mutiereKursbesuche6) or die($conn->ErrorMsg());
$totalRows_mutiereKursbesuche6 = $mutiereKursbesuche6->RecordCount();
// end Recordset
// begin Recordset
$colname__mutiereKursbesuche7 = '-1';
if (isset($_GET['recordID'])) {
$colname__mutiereKursbesuche7 = $_GET['recordID'];
}
$query_mutiereKursbesuche7 = sprintf("SELECT * FROM t_kursbesuche WHERE t_kurs_id = %s AND fld1 = 7", GetSQLValueString($colname__mutiereKursbesuche7, "int"));
$mutiereKursbesuche7 = $conn->SelectLimit($query_mutiereKursbesuche7) or die($conn->ErrorMsg());
$totalRows_mutiereKursbesuche7 = $mutiereKursbesuche7->RecordCount();
// end Recordset
// begin Recordset
$colname__mutiereKursbesuche8 = '-1';
if (isset($_GET['recordID'])) {
$colname__mutiereKursbesuche8 = $_GET['recordID'];
}
$query_mutiereKursbesuche8 = sprintf("SELECT * FROM t_kursbesuche WHERE t_kurs_id = %s AND fld1 = 8", GetSQLValueString($colname__mutiereKursbesuche8, "int"));
$mutiereKursbesuche8 = $conn->SelectLimit($query_mutiereKursbesuche8) or die($conn->ErrorMsg());
$totalRows_mutiereKursbesuche8 = $mutiereKursbesuche8->RecordCount();
// end Recordset
// begin Recordset
$colname__mutiereKursbesuche9 = '-1';
if (isset($_GET['recordID'])) {
$colname__mutiereKursbesuche9 = $_GET['recordID'];
}
$query_mutiereKursbesuche9 = sprintf("SELECT * FROM t_kursbesuche WHERE t_kurs_id = %s AND fld1 = 9", GetSQLValueString($colname__mutiereKursbesuche9, "int"));
$mutiereKursbesuche9 = $conn->SelectLimit($query_mutiereKursbesuche9) or die($conn->ErrorMsg());
$totalRows_mutiereKursbesuche9 = $mutiereKursbesuche9->RecordCount();
// end Recordset
// begin Recordset
$colname__mutiereKursbesuche10 = '-1';
if (isset($_GET['recordID'])) {
$colname__mutiereKursbesuche10 = $_GET['recordID'];
}
$query_mutiereKursbesuche10 = sprintf("SELECT * FROM t_kursbesuche WHERE t_kurs_id = %s AND fld1 = 10", GetSQLValueString($colname__mutiereKursbesuche10, "int"));
$mutiereKursbesuche10 = $conn->SelectLimit($query_mutiereKursbesuche10) or die($conn->ErrorMsg());
$totalRows_mutiereKursbesuche10 = $mutiereKursbesuche10->RecordCount();
// end Recordset
// begin Recordset
$colname__sucheKursbesuche = '-1';
if (isset($_GET['fld1'])) {
$colname__sucheKursbesuche = $_GET['fld1'];
}
$query_sucheKursbesuche = sprintf("SELECT * FROM t_kursbesuche WHERE t_kurs_id = %s AND fld1 = 1", GetSQLValueString($colname__sucheKursbesuche, "int"));
$sucheKursbesuche = $conn->SelectLimit($query_sucheKursbesuche) or die($conn->ErrorMsg());
$totalRows_sucheKursbesuche = $sucheKursbesuche->RecordCount();
// end Recordset
// begin Recordset
$query_sucheStatKB = "SELECT * FROM t_statKB";
$sucheStatKB = $conn->SelectLimit($query_sucheStatKB) or die($conn->ErrorMsg());
$totalRows_sucheStatKB = $sucheStatKB->RecordCount();
// end Recordset
//PHP ADODB document - made with PHAkt 3.7.0
?><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Firma Dozent bearbeiten</title>
<tr>
<td height="15" valign="top"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Schulungsraum','','navi/na_schulungsraum_r.jpg',1)"><img src="navi/na_schulungsraum.jpg" name="Schulungsraum" width="115" height="15" border="0"></a></td>
</tr>
<tr>
<td height="495" valign="top"><!--DWLayoutEmptyCell--> </td>
</tr>
</table></td>
<td width="960" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="960" height="101" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="85" height="44" valign="top"><!--DWLayoutEmptyCell--> </td>
<td width="872" valign="top"><!--DWLayoutEmptyCell--> </td>
<td width="3"></td>
</tr>
<tr>
<td height="36" valign="top"><!--DWLayoutEmptyCell--> </td>
<td valign="top"><span class="titel_seite">KURS BEARBEITEN </span></td>
<td></td>
</tr>
<tr>
<td height="21" valign="top"><!--DWLayoutEmptyCell--> </td>
<td colspan="2" valign="top"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td height="0"></td>
<td></td>
<td></td>
</tr>
</table></td>
</tr>
<tr>
<td height="618" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="80" rowspan="2" valign="top"><!--DWLayoutEmptyCell--> </td>
<td width="880" height="457" valign="top"><form method="POST" id="form1" action="<?php echo $editFormAction; ?>">
<table width="877" height="455" align="left">
<tr valign="baseline">
<td width="115" align="right" nowrap class="left">Nr.:</td>
<td colspan="4"><?php echo $mutiereKurs->Fields('id'); ?></td>
<td width="422"> </td>
<td width="115"><input type="hidden" name="MM_update" value="form1" /></td>
</tr>
<tr valign="baseline">
<td width="115" align="right" nowrap class="left">Applikation:</td>
<td colspan="4"><select name="t_applikation_id">
<?php
while(!$sucheApplikation->EOF){
?>
<option value="<?php echo $sucheApplikation->Fields('id')?>"<?php if (!(strcmp($sucheApplikation->Fields('id'), $mutiereKurs->Fields('t_applikation_id')))) {echo "SELECTED";} ?>><?php echo $sucheApplikation->Fields('app_name').$sucheApplikation->Fields('version');?></option>
<?php
$sucheApplikation->MoveNext();
}
$sucheApplikation->MoveFirst();
?>
</select> </td>
<td> </td>
<td><input type="hidden" name="id" value="<?php echo $mutiereKurs->Fields('id'); ?>" /></td>
<tr valign="baseline">
<td width="115" align="right" nowrap class="left">Dozent:</td>
<td colspan="4"><select name="t_dozent_id">
<?php
while(!$sucheDozent->EOF){
?>
<option value="<?php echo $sucheDozent->Fields('id')?>" <?php if (!(strcmp($sucheDozent->Fields('id'), $mutiereKurs->Fields('t_dozent_id')))) {echo "SELECTED";} ?>><?php echo $sucheDozent->Fields('dname').$sucheDozent->Fields('dvorname');?></option>
<?php
$sucheDozent->MoveNext();
}
$sucheDozent->MoveFirst();
?>
</select> </td>
<td> </td>
<td> </td>
<tr valign="baseline">
<td width="115" align="right" nowrap class="left">Status:</td>
<td colspan="4"><select name="t_status_id">
<?php
while(!$sucheStatus->EOF){
?>
<option value="<?php echo $sucheStatus->Fields('id')?>" <?php if (!(strcmp($sucheStatus->Fields('id'), $mutiereKurs->Fields('t_status_id')))) {echo "SELECTED";} ?>><?php echo $sucheStatus->Fields('bezeichnung')?></option>
<?php
$sucheStatus->MoveNext();
}
$sucheStatus->MoveFirst();
?>
</select> </td>
<td> </td>
<td> </td>
<tr valign="baseline">
<td width="115" align="right" nowrap class="left">Raum:</td>
<td colspan="4"><select name="t_raum_id">
<?php
while(!$sucheRaum->EOF){
?>
<option value="<?php echo $sucheRaum->Fields('id')?>" <?php if (!(strcmp($sucheRaum->Fields('id'), $mutiereKurs->Fields('t_raum_id')))) {echo "SELECTED";} ?>><?php echo $sucheRaum->Fields('bezeichnung')?></option>
<?php
$sucheRaum->MoveNext();
}
$sucheRaum->MoveFirst();
?>
</select></td>
<td> </td>
<td> </td>
<tr valign="baseline">
<td width="115" align="right" valign="middle" nowrap class="left">Kursbeschrieb:</td>
<td colspan="4"><textarea name="kursbeschrieb" cols="50" rows="5"><?php echo $mutiereKurs->Fields('kursbeschrieb'); ?></textarea></td>
<td> </td>
<td> </td>
</tr>
<tr valign="baseline">
<td width="115" align="right" nowrap class="left">1. Datum:</td>
<td width="115"><input type="text" name="date1" value="<?php echo KT_formatDate($mutiereKurs->Fields('date1')); ?>" size="12" /></td>
<td width="115"><span class="left">von:</span></td>
<td width="115"><input type="text" name="start_time1" value="<?php echo $mutiereKurs->Fields('start_time1'); ?>" size="7" /></td>
<td width="115"><span class="left">bis:</span></td>
<td><input type="text" name="end_time1" value="<?php echo $mutiereKurs->Fields('end_time1'); ?>" size="7" /></td>
<td> </td>
</tr>
<tr valign="baseline">
<td width="115" align="right" nowrap class="left">2. Datum:</td>
<td><input type="text" name="date2" value="<?php echo $mutiereKurs->Fields('date2'); ?>" size="12" /></td>
<td><span class="left">von:</span></td>
<td><input type="text" name="start_time2" value="<?php echo $mutiereKurs->Fields('start_time2'); ?>" size="7" /></td>
<td><span class="left">bis:</span></td>
<td><input type="text" name="end_time2" value="<?php echo $mutiereKurs->Fields('end_time2'); ?>" size="7" /></td>
<td> </td>
</tr>
<tr valign="baseline">
<td width="115" align="right" nowrap class="left">3. Datum:</td>
<td><input type="text" name="date3" value="<?php echo $mutiereKurs->Fields('date3'); ?>" size="12" /></td>
<td><span class="left">von:</span></td>
<td><input type="text" name="start_time3" value="<?php echo $mutiereKurs->Fields('start_time3'); ?>" size="7" /></td>
<td><span class="left">bis:</span></td>
<td><input type="text" name="end_time3" value="<?php echo $mutiereKurs->Fields('end_time3'); ?>" size="7" /></td>
<td> </td>
</tr>
<tr valign="baseline">
<td width="115" align="right" nowrap class="left">4. Datum:</td>
<td><input type="text" name="date4" value="<?php echo $mutiereKurs->Fields('date4'); ?>" size="12" /></td>
<td><span class="left">von:</span></td>
<td><input type="text" name="start_time4" value="<?php echo $mutiereKurs->Fields('start_time4'); ?>" size="7" /></td>
<td><span class="left">bis:</span></td>
<td><input type="text" name="end_time4" value="<?php echo $mutiereKurs->Fields('end_time4'); ?>" size="7" /></td>
<td> </td>
</tr>
<tr valign="baseline">
<td width="115" align="right" nowrap class="left">5. Datum:</td>
<td><input type="text" name="date5" value="<?php echo $mutiereKurs->Fields('date5'); ?>" size="12" /></td>
<td><span class="left">von:</span></td>
<td><input type="text" name="start_time5" value="<?php echo $mutiereKurs->Fields('start_time5'); ?>" size="7" /></td>
<td><span class="left">bis:</span></td>
<td><input type="text" name="end_time5" value="<?php echo $mutiereKurs->Fields('end_time5'); ?>" size="7" /></td>
<td> </td>
</tr>
<tr valign="baseline">
<td width="115" align="right" nowrap class="left">Voll</td>
<td colspan="4"><input type="checkbox" name="checkbox" value="<?php echo $mutiereKurs->Fields('voll'); ?>"></td>
<td> </td>
<td> </td>
</tr>
<tr valign="baseline">
<td width="115" align="right" nowrap class="left">Überbuchung:</td>
<td colspan="4"><input type="text" name="ueberbuchung" value="<?php echo $mutiereKurs->Fields('ueberbuchung'); ?>" size="4" /></td>
<td> </td>
<td> </td>
</tr>
<tr valign="baseline">
<td width="115" align="right" nowrap class="left">Min. Teilnehmer:</td>
<td colspan="4"><input type="text" name="min_teilnehmer" value="<?php echo $mutiereKurs->Fields('min_teilnehmer'); ?>" size="4" /></td>
<td> </td>
<td> </td>
</tr>
<tr valign="baseline">
<td width="115" align="right" nowrap class="left"> </td>
<td colspan="4"><input name="submit" type="submit" value="Kurs bearbeiten" /></td>
<td> </td>
<td> </td>
</tr>
<tr valign="baseline">
<td colspan="7" align="right" nowrap class="left"> </td>
</tr>
</table>
</form> <p> </p></td>
</tr>
<tr>
<td height="161" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="880" height="161" valign="top"><p> </p>
<form name="form3" method="POST" id="form2" action="<?php echo $editFormAction; ?>">
<table align="left">
<tr valign="baseline">
<td nowrap align="right">Angemeldet:</td>
<td><select name="t_mitarbeiter_id">
<?php
while(!$sucheMitarbeiter->EOF){
?>
<option value="<?php echo $sucheMitarbeiter->Fields('id')?>" <?php if (!(strcmp($sucheMitarbeiter->Fields('id'), $mutiereKursbesuche->Fields('t_mitarbeiter_id')))) {echo "SELECTED";} ?>><?php echo $sucheMitarbeiter->Fields('name')?></option>
<?php
$sucheMitarbeiter->MoveNext();
}
$sucheMitarbeiter->MoveFirst();
?>
</select>
</td>
<tr>
<tr valign="baseline">
<td nowrap align="right">Status:</td>
<td><select name="t_statKB_id">
<?php
while(!$sucheStatKB->EOF){
?>
<option value="<?php echo $sucheStatKB->Fields('id')?>" <?php if (!(strcmp($sucheStatKB->Fields('id'), $mutiereKursbesuche->Fields('t_statKB_id')))) {echo "SELECTED";} ?>><?php echo $sucheStatKB->Fields('bezeichnung')?></option>
<?php
$sucheStatKB->MoveNext();
}
$sucheStatKB->MoveFirst();
?>
</select>
</td>
<tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td><input type="submit" value="Datensatz aktualisieren" /></td>
</tr>
</table>
<input type="hidden" name="MM_update" value="form3">
<input type="hidden" name="id" value="<?php echo $mutiereKursbesuche->Fields('id'); ?>" />
</form>
<p> </p></td>
</tr>
</table>
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html><?php
$sucheApplikation->Close();
$sucheDozent->Close();
$sucheStatus->Close();
$sucheRaum->Close();
$mutiereKurs->Close();
$mutiereKursbesuche->Close();
$sucheMitarbeiter->Close();
$mutiereKursbesuche2->Close();
$sucheKursbesuche->Close();
$sucheStatKB->Close();
?>