<?
if (isset($apache)){
$on_r = mysql_query("SELECT `id-apache` FROM `on` WHERE `id-apache` = '".$apache['id']."'");
if (mysql_num_rows($on_r)){
mysql_query("UPDATE `on` SET `url`='".$urlup."', `style` = '".$wapweb."', `visit`= `visit`+1, `date` = '".time()."' WHERE `id-apache` = '".$apache['id']."'");
}else{
mysql_query("INSERT INTO `on` SET `id-apache` = '".$apache['id']."', `url` = '".$urlup."', `style` = '".$wapweb."', `visit`= `visit`+1, `date` = '".time()."'");
}
mysql_query("DELETE FROM `on` WHERE `date` <= '".(time()-60*3)."'");
include_once(HOME .'./apahe/ban.tpl');
}else if (!isset($apache)){
$defin = $_SERVER['REMOTE_ADDR'];
$ong_r = mysql_query("SELECT `ip-down` FROM `on-g` WHERE `ip-down` = '".$defin."'");
if (mysql_num_rows($ong_r)){
mysql_query("UPDATE `on-g` SET `url`='".$urlup."', `style` = '".$wapweb."', `visit`= `visit`+1, `date` = '".time()."' WHERE `ip-down` = '".$defin."'");
}else{
mysql_query("INSERT INTO `on-g` SET `ip-down` = '".$defin."', `url` = '".$urlup."', `style` = '".$wapweb."', `visit`= `visit`+1, `date` = '".time()."'");
}
mysql_query("DELETE FROM `on-g` WHERE `date` <= '".(time()-60*3)."'");
}
include_once(HOME .'/sheet/style/'.$themes.'/top.php');
?>