Location: PHPKode > scripts > WH Social > wh_social/admin/backup.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['backup_blank'] . '</h1>';

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

        echo '<form method="post" action="">
        <p><input type="submit" name="' . $lang['make_new_backup'] . '" id="' . $lang['make_new_backup'] . '" value="' . $lang['make_new_backup'] . '" class="buttons"></p>
        </form>';

        echo '<div id="pr_line"></div>';

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

        $directory = '/backup/';

        if(glob($directory)) {

            echo '<p class="false">' . $lang['backup_no'] . '</p>';

        }else{

        echo '<table width="100%" class="tables">
        <tr>
        <td width="25%"><strong>' . $lang['backup_blank'] . '</strong></td>
        <td width="15%"><strong>' . $lang['backup_size'] . '</strong></td>
        <td width="15%"><strong>' . $lang['admin_ending'] . '</strong></td>
        <td width="45%"><strong>' . $lang['backup_creation'] . '</strong></td>
        </tr>';

        $directory = 'backup/';
        $alledateien = scandir($directory);

        foreach($alledateien as $datei) {
            $dateiinfo = pathinfo($directory . "/" . $datei);
            $dateiinfo['filename'];
            $dateiinfo['dirname'];
            $dateiinfo['extension'];
            $dateiinfo['basename'];
            $dateiinfo['filemtime'];

        $size = ceil(filesize($directory . "/" . $datei)/1024);

        if($datei != "." && $datei != "..") {

            echo '<tr>
            <td width="25%"><a href="' . $dateiinfo['dirname'] . '/' . $dateiinfo['basename'] . '" target="_blank">' . $dateiinfo['filename'] . '.' . $dateiinfo['extension'] . '</a></td>
            <td width="15%">' . $size . ' KB</td>
            <td width="15%">' . $dateiinfo['extension'] . '</td>
            <td width="45%">' . date('d.m.Y - H:i', strtotime($dateiinfo['filemtime'])) . '</td>
            </tr>';
            }
        }

        echo '</table>';
        }

        }else{

        require('../framework/functions/backup.php');
        }

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

    ?>

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