<?php require_once('../Connections/Samariterverein2.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO saer_postendienst (podi_ID, podi_veranstalter, podi_art, podi_ort, podi_adresse, podi_datum) VALUES (%s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['podi_ID'], "int"),
GetSQLValueString($_POST['podi_veranstalter'], "text"),
GetSQLValueString($_POST['podi_art'], "text"),
GetSQLValueString($_POST['podi_ort'], "text"),
GetSQLValueString($_POST['podi_adresse'], "text"),
GetSQLValueString($_POST['podi_datum'], "text"));
mysql_select_db($database_Samariterverein2, $Samariterverein2);
$Result1 = mysql_query($insertSQL, $Samariterverein2) or die(mysql_error());
$insertGoTo = "index.php?id=postendienstanfrage_2";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
mysql_select_db($database_Samariterverein2, $Samariterverein2);
$query_postendienstanfrage = "SELECT podi_ID, podi_veranstalter, podi_art, podi_ort, podi_adresse, podi_datum FROM saer_postendienst";
$postendienstanfrage = mysql_query($query_postendienstanfrage, $Samariterverein2) or die(mysql_error());
$row_postendienstanfrage = mysql_fetch_assoc($postendienstanfrage);
$totalRows_postendienstanfrage = mysql_num_rows($postendienstanfrage);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Unbenanntes Dokument</title>
</head>
<body>
<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
<table align="center">
<tr valign="baseline">
<td nowrap="nowrap" align="right">Podi_ID:</td>
<td><input type="text" name="podi_ID" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Podi_veranstalter:</td>
<td><input type="text" name="podi_veranstalter" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Podi_art:</td>
<td><input type="text" name="podi_art" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Podi_ort:</td>
<td><input type="text" name="podi_ort" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Podi_adresse:</td>
<td><input type="text" name="podi_adresse" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Podi_datum:</td>
<td><input type="text" name="podi_datum" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"> </td>
<td><input type="submit" value="Datensatz einfügen" /></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1" />
</form>
<p> </p>
</body>
</html>
<?php
mysql_free_result($postendienstanfrage);
?>