Location: PHPKode > scripts > WH Social > wh_social/admin/maintenance.php
<?php

    if(file_exists('handler/stay.php') == TRUE) {

        require('handler/stay.php');

        }else{

        echo '<p class="red_span" align="center">Error - Fehler</p>';
        exit;
        }

?>

<?php define('INCLUDE_CHECK',1); define('MYSQL_CHECK',1); ?>

<?php require('../framework/config.php'); ?>
<?php require('../framework/mysql.php'); ?>
<?php require('../framework/constants.php'); ?>
<?php require('../framework/class/cache_class.php'); no_cache(); ?>
<?php require('../framework/security.php'); ?>
<?php require('handler/language.php'); ?>

<?php require('structure/header.inc.php'); ?>

    <div class="menu">
        <div class="menu_left">
            <ul id="admin_navi">
                <li class="active"><a href="index.php"><?php echo $lang['blank_admin_area']; ?></a></li>
                <li><a href="members.php"><?php echo $lang['admin_members']; ?></a></li>
                <li><a href="discussions.php"><?php echo $lang['discussions']; ?></a></li>
                <li><a href="topics.php"><?php echo $lang['blank_topics']; ?></a></li>
                <li><a href="news.php"><?php echo $lang['news']; ?></a></li>
                <li><a href="events.php"><?php echo $lang['events']; ?></a></li>
                <li><a href="newsletter.php"><?php echo $lang['newsletter']; ?></a></li>
                <li><a href="statistic.php"><?php echo $lang['statistic']; ?></a></li>
            </ul>
        </div>
        <div class="menu_right">
            <?php

            if(isset($_SESSION['admin']) && $_SESSION['admin'] == TRUE) {

            echo '<div class="admin_settings">
            <a class="admin_account"><span>' . $lang['blank_navigation'] . '</span></a>
            <div class="admin_submenu" style="display: none;">
                <ul class="root">
                    <li><a href="' . $url . '" target="_blank">' . $lang['goto_network'] . '</a></li>
                    <li><a href="signout.php">' . $lang['signout'] . '</a></li>
                </ul>
            </div>
            </div>';
            }

            ?>
        </div>
    </div>
</div>

<div class="clear"></div>

<div id="content_wrapper">
    <div class="content">

    <?php

        echo '<h1 class="p_space">' . $lang['maintenance'] . '</h1>';

        if($_SERVER['REQUEST_METHOD'] != 'POST') {

        $sql = "SELECT id, status FROM maintenance WHERE id = '1'";
        $result = mysql_query($sql) OR die(mysql_error());

        $row = mysql_fetch_assoc($result);

        echo '<form method="post" name="maintenance" action="">';

        if($row['status'] == '1') {

        echo '<input type="radio" name="status" value="1" checked> <span class="green_span">' . $lang['maintenance_on'] . '</span><br>
        <input type="radio" name="status" value="0"> <span class="red_span">' . $lang['maintenance_off'] . '</span>';

            }else{

            echo '<input type="radio" name="status" value="1"> <span class="green_span">' . $lang['maintenance_on'] . '</span><br>
            <input type="radio" name="status" value="0" checked> <span class="red_span">' . $lang['maintenance_off'] . '</span>';
            }

        echo '<p><input type="submit" name="maintenance" id="maintenance" value="Anwenden" class="buttons"></p>
        </form>';

        }else{

        $query = "UPDATE maintenance SET status = '" . mysql_real_escape_string($_POST['status']) . "' WHERE id = '1'";

        mysql_query($query) OR die(mysql_error());

        if(mysql_affected_rows() == 1) {

            echo '<p class="success">' . $lang['admin_settings_applied'] . '</p>
            <p><a href="maintenance.php">' . $lang['go_on'] . '</a></p>';

            }else{

            echo '<p class="false">' . $lang['admin_settings_failed'] . '</p>
            <p><a href="maintenance.php">' . $lang['back'] . '</a></p>';
            }
        }

        echo '<div class="clear"></div>';

    ?>

<?php require('structure/footer.inc.php'); ?>
Return current item: WH Social