Location: PHPKode > projects > PhpMyContent > phpMyContent-0.1/bereich_edit.php3
<?
	require 'inc/config.php3';			// Variablen Deklaration
	require "$inc_path/db_connect.php3";	// Datenbank Verbindung
	require "$inc_path/auth.php3";		// Authentifizierung
	require "$inc_path/header.php3";		// HTML Header (Layout)
	require "$inc_path/user_track.php3";	// User Logging

?>
	<center><h3><? echo $nav_bereich;?> (<?echo $nav_editieren;?>)</h3>

<script language="JavaScript">
function check_required_fields() {
	if (document.form.bereichName.value.length == 0) {
		alert("<?echo $check_required_fields;?>")
		document.form.bereichName.focus();
		return false;
	}
	if (document.form.bereichBeschreibung.value.length == 0) {
		alert("<?echo $check_required_fields;?>")
		document.form.bereichBeschreibung.focus();
		return false;
	}
	if (document.form.bereichDepend.selectedIndex < 1) {
		alert("<?echo $check_required_fields;?>")
		document.form.bereichDepend.focus();
		return false;
	}
	return true;
}
</script>

<?	if ( ($status == 'Superuser') || ($status == 'Projekt Administrator') ){
?>		<form action="bereich_update.php3" name="form" method="post" onsubmit="return check_required_fields();">
		<input type="hidden" name="projekt" value="<?echo $projekt?>">
		<input type="hidden" name="bereich" value="<?echo $bereich?>">
		<table border=0>
<?			$sqlquery = "	SELECT 	autoID,
						name,
						beschreibung,
						bereichID,
						erstellt,
						geaendert,
						aktiv
					FROM 	Bereich
					WHERE 	Bereich.autoID = $bereich";
			$db_object->query_db($content_db, $sqlquery);
			$row = $db_object->getrow();

?>		<tr><td><?echo $label_name?>:</td></tr>
		<tr><td><input name="bereichName" size=50 value='<?echo ereg_replace("'", '"', $db_object->unescapeChar($row[1]))?>' style="width=500pt; background='white';"></td></tr>
		<tr><td><?echo $label_beschreibung?>:</td></tr>
		<tr><td><textarea cols=80 rows=10 name="bereichBeschreibung" style="width=500pt; background='white';"><?echo $db_object->unescapeChar($row[2])?></textarea></td></tr>
		<tr><td><?echo $nav_abhaengig;?>:</td></tr>
		<tr><td><select name="bereichDepend" style="width=500pt; background='white';">
				<option value=''><?echo $label_bereich_waehlen;?></option>
				<option <?if ( $row[3] == 0) {echo 'SELECTED';}?> value="0">Top Level</option>
<?				$sqlquery = "	SELECT		autoID,
								name,
								beschreibung
						FROM 		Bereich
						WHERE		projektID = $projekt
						AND		Bereich.autoID != $bereich
						ORDER BY 	name";
	 			$db_object->query_db($content_db, $sqlquery);
				while ($row2 = $db_object->getrow()) {
?>					<option <?if ( $row[3] == $row2[0]) {echo 'SELECTED';}?> value="<?echo $row2[0]?>"><?echo $db_object->unescapeChar($row2[1])?></option>
<?				}
?>			</select>
		</td></tr>
		<tr><td><?echo $label_sichtbar?>:&nbsp;<input type="checkbox" name="aktiv"<?if ($row[6] == '1') { echo ' CHECKED'; }?>></td></tr>
		</table>
		<table border=0> 
		<tr>	<td><?echo $nav_erstellt?>:</td> 
			<td><?echo date($nav_zeitformat, $row[4])?></td> 
		</tr> 
		<tr>	<td><?echo $nav_geaendert?>:</td> 
			<td><?if ($row[5]) { echo date($nav_zeitformat, $row[5]);} else { echo '-'; }?></td> 
		</tr> 
		</table> 

		<input type=submit value="<?echo $nav_speichern;?>" style="width: 500pt;">
		</form>
<?	} else {
		echo $nav_frage_superuser;
	}
?>	</center>
<?	require 'inc/db_disconnect.php3';
	require 'inc/footer.php3';
?>
Return current item: PhpMyContent