<?php
/*
 ########################################################################
#                                                                        #
#           Version 4       /                        /   /               #
#          -----------__---/__---__------__----__---/---/-               #
#           | /| /  /___) /   ) (_ `   /   ) /___) /   /                 #
#          _|/_|/__(___ _(___/_(__)___/___/_(___ _/___/___               #
#                       Free Content / Management System                 #
#                                   /                                    #
#                                                                        #
#                                                                        #
#   Copyright 2005-2006 by webspell.org                                  #
#                                                                        #
#   visit webSPELL.org, webspell.info to get webSPELL for free           #
#   - Script runs under the GNU GENERAL PUBLIC LICENSE                   #
#   - It's NOT allowed to remove this copyright-tag                      #
#   -- http://www.fsf.org/licensing/licenses/gpl.html                    #
#                                                                        #
#   Code based on WebSPELL Clanpackage (Michael Gruber - webspell.at),   #
#   Far Development by Development Team - webspell.org                   #
#                                                                        #
#   visit webspell.org                                                   #
#                                                                        #
 ########################################################################
*/

if(!ispageadmin($userID) OR substr(basename($_SERVER[REQUEST_URI]),0,15) != "admincenter.php") die('Access denied.');

if($_POST['submit'] != "") {
 	$imprint = $_POST['imprint'];
 	
 	safe_query("UPDATE `".PREFIX."settings` SET imprint='".$_POST['type']."'");
	
  if(mysql_num_rows(safe_query("SELECT * FROM `".PREFIX."imprint`"))) safe_query("UPDATE `".PREFIX."imprint` SET imprint='$imprint'");
	else safe_query("INSERT INTO `".PREFIX."imprint` (imprint) values( '$imprint') ");
	redirect("admincenter.php?site=imprint","Successful");
}
else {
	echo'<h2>page imprint</h2>';
	if($imprint_type) $type1='checked="checked"';
	else $type0='checked="checked"';
	
	$ergebnis=safe_query("SELECT * FROM `".PREFIX."imprint`");
	$ds=mysql_fetch_array($ergebnis);
	
	echo'<form method="post" action="admincenter.php?site=imprint">
	     <table cellpadding="0" cellspacing="3" border="0" width="580">
        <tr><td><input type="radio" name="type" value="0" '.$type0.'> Automatic</td></tr>
        <tr><td><input type="radio" name="type" value="1" '.$type1.'> Manually (use text field below)<p align="center">
        <table width="90%" border="0">
         <tr>
		      <td>
			     Imprint: you can use HTML-tags<br>
			     <textarea name="imprint" cols="100" rows="30" class="form_off" onFocus="this.className=\'form_on\'" onBlur="this.className=\'form_off\'">'.$ds[imprint].'</textarea>
			    </td>
		     </tr>
		    </table></p></td></tr>
		   <tr><td><input type="submit" name="submit" value="update"></td></tr>
		 </table>
		 </form>';
}
?>
