<?PHP
//........................

$table = THEMEMASTER;
$return = "edittheme.php";
$setpage = "editthemee";

//........................

$SQL = "SELECT * from $table WHERE ID = '$_GET[id]'"; 
$result = mySQL_query( $SQL ); 
$row = mySQL_fetch_array( $result );
?>

<?PHP
if ($_GET[update] == 1) {
	foreach ($_POST as $k => $content) {
	if ($k != 'Save') {
		$sqlup    = "UPDATE THEMES SET
		CLASSCSS = '$content' WHERE THEMEID = '$_GET[theme]' AND CLASSNAME = '$k'";
		$queryup  = mysql_query($sqlup);
	}
	}
}
?>

<h1><?PHP /* (LANGUAGE) */ $t = "Editing CSS"; $f = "editcss"; include "langinc.php"; /* (LANGUAGE) */ ?></h1>

<form name="form" method="post" action="index.php?page=edittheme&update=1&id=<?php echo $_GET[id]; ?>&theme=<?php echo $row[THEMEID]; ?>">

<?PHP
$SQLdelta = "SELECT * from THEMES WHERE THEMEID = '$row[THEMEID]' ORDER BY CLASSNAME ASC";
$resultdelta = @mySQL_query( $SQLdelta ); while( $rowdelta = @mySQL_fetch_array( $resultdelta ) ) {
?>

<hr>

<h3 style="margin-top: 15px;"><?php echo $rowdelta[CLASSNAME]; ?></h3>

<textarea name="<?php echo $rowdelta[CLASSNAME]; ?>" class="fieldbox" style="width: 100%; height: 100px;"><?php echo $rowdelta[CLASSCSS]; ?></textarea>

<input class="sparklybutton" type="submit" name="Save" value="<?PHP /* (LANGUAGE) */ $t = "Save"; $f = "save"; include "langinc.php"; /* (LANGUAGE) */ ?>" style="margin-top: 15px;">

<?PHP } ?>

</form>

