<?php
if($_COOKIE['iQQol_Administrator']!=IQQOL_SPPASS)
{
    $style->assign("state",'COOKIE失效');
    $style->display('admin/index.html');exit();
}
else {
    $adv[header]=mysql_fetch_array(mysql_query("SELECT * FROM ".$table."adv 
WHERE `name`='header'",$con),true);
    $adv[footer]=mysql_fetch_array(mysql_query("SELECT * FROM ".$table."adv 
WHERE `name`='footer'",$con),true);
    $adv[main]=mysql_fetch_array(mysql_query("SELECT * FROM ".$table."adv 
WHERE `name`='main'",$con),true);
    $adv[index]=mysql_fetch_array(mysql_query("SELECT * FROM ".$table."adv 
WHERE `name`='index'",$con),true);
    $adv[ground]=mysql_fetch_array(mysql_query("SELECT * FROM ".$table."adv 
WHERE `name`='ground'",$con),true);
echo mysql_error();
    if($_GET['edit']=='yes'){
        $edit=mysql_query("UPDATE ".IQQOL_SQLTABLE."adv
 SET note='{$_POST['header']}' 
 WHERE name = 'header'");
        $edit=mysql_query("UPDATE ".IQQOL_SQLTABLE."adv
 SET status='{$_POST['header_a']}' 
 WHERE name = 'header'");
        $edit.=mysql_query("UPDATE ".IQQOL_SQLTABLE."adv
 SET note='{$_POST['footer']}' 
 WHERE name = 'footer'");
        $edit.=mysql_query("UPDATE ".IQQOL_SQLTABLE."adv
 SET status='{$_POST['footer_a']}' 
 WHERE name = 'footer'");
        $edit.=mysql_query("UPDATE ".IQQOL_SQLTABLE."adv
 SET note='{$_POST['index']}' 
 WHERE name = 'index'");
        $edit.=mysql_query("UPDATE ".IQQOL_SQLTABLE."adv
 SET status='{$_POST['index_a']}' 
 WHERE name = 'index'");
        $edit.=mysql_query("UPDATE ".IQQOL_SQLTABLE."adv
 SET note='{$_POST['main']}' 
 WHERE name = 'main'");
        $edit.=mysql_query("UPDATE ".IQQOL_SQLTABLE."adv
 SET status='{$_POST['main_a']}' 
 WHERE name = 'main'");
        $edit.=mysql_query("UPDATE ".IQQOL_SQLTABLE."adv
 SET note='{$_POST['ground']}' 
 WHERE name = 'ground'");
        $edit.=mysql_query("UPDATE ".IQQOL_SQLTABLE."adv
 SET status='{$_POST['ground_a']}' 
 WHERE name = 'ground'");
    if($edit){
        $tem_url_return=$_SERVER["PHP_SELF"].'?action=adv';
        $state='修改成功';
        $style->display('admin/status.html');
        exit();
    }else{
        $tem_url_return=$_SERVER["PHP_SELF"].'?action=adv';
        $state='修改失败';
        $style->display('admin/status.html');
        exit();
    }
    }
    if(IN_IQQOL){
        $style->display('admin/setting/adv.html');
    }
}