<? include('checkcookie.php');
if (isset($_POST["sitename"])){
$sitename=$_POST["sitename"];
$wmid=$_POST["wmid"];
$email=$_POST["email"];
$icq=$_POST["icq"];
$purse=$_POST["wmpurse"];
$valuta=$_POST["valuta"];
$valutaname=$_POST["valutaname"];
$sd=$_POST["startdate"];
$blockip=$_POST["blockip"];
$ctrlword=$_POST["ctrlword"];
$merchant=$_POST["merchant"];
$offsite=$_POST["offsite"];

$modered = intval($_POST["modered"]);
mysql_query("UPDATE `b_config` SET `price`='$modered' WHERE `name`='auto_moder'") or die(mysql_error());
mysql_query("ALTER TABLE tb_ads CHANGE modered modered int(1) DEFAULT '$modered'") or die(mysql_error());
mysql_query("ALTER TABLE tb_statlinks CHANGE modered modered int(1) DEFAULT '$modered'") or die(mysql_error());
mysql_query("ALTER TABLE tb_advban CHANGE modered modered int(1) DEFAULT '$modered'") or die(mysql_error());
mysql_query("ALTER TABLE seo_paymails CHANGE modered modered int(1) DEFAULT '$modered'") or die(mysql_error());
mysql_query("ALTER TABLE seo_tasks CHANGE modered modered int(1) DEFAULT '$modered'") or die(mysql_error());

if($ctrlword!='NULL' and $ctrlword!='') $ctrlword=md5($ctrlword);
mysql_query("update tb_site set blockip='$blockip', icq='$icq', sitename='$sitename', wmid='$wmid', email='$email', purse='$purse', valuta='$valuta', valutaname='$valutaname', startdate='$sd', merchant='$merchant' where id='1'");
if($ctrlword!='NULL'){
mysql_query("update tb_site set ctrlword='$ctrlword' where id='1'");
$_SESSION["ctrlwordaccess"]='0';
}
mysql_query("UPDATE tb_config SET price='$offsite' WHERE item='offsite'");
echo "<font color=\"green\"><b>Настройки сохранены</b></font><br><br>";
}

$row = mysql_fetch_array(mysql_query("SELECT * FROM tb_site WHERE id='1'"));
$m = $row["merchant"];
$off = mysql_result(mysql_query("SELECT `price` FROM `tb_config` WHERE `item`='offsite'"),0,0);
$auto_moder = mysql_result(mysql_query("SELECT `price` FROM `b_config` WHERE `name`='auto_moder'"),0,0);
?>
<link rel="stylesheet" href="css/ui.datepicker.css" type="text/css" media="screen" />

<script type="text/javascript" src="js/jquery_min.js" ></script>
<script type="text/javascript" src="js/jquery-ui-personalized-1.5.3.packed.js"></script>
<script type="text/javascript" src="js/ui.datepicker-ru.js"></script>
<script type="text/javascript">
var $d = jQuery.noConflict();
$d(document).ready(function() {
$d.datepicker.setDefaults($d.datepicker.regional['ru']);
$d("#startdate").datepicker({
dateFormat: 'yy/mm/dd',
changeMonth: true,
numberOfMonths: 1,
minDate: "0",
yearRange: "<?php echo (DATE("Y")-2).":".(DATE("Y")+2);?>",
});
});
function customRange(input) { return; }
</script>