<script type="text/javascript">
    //if($defined($('myTable'))) {
        var myTable = {};
        window.addEvent('domready', function(){
            myTable = new sortableTable('myTable', {overCls: 'over', onClick: function(){alert(this.id)}});
        });
    //}
</script>

<?php
if ( $main->is_logged($_SESSION['id_user']) && $main->group_right($_SESSION['id_user'], 2) ) {
    if ( isset($_GET['let']) ) {
        mysql_query('UPDATE reported_content SET stav=1 WHERE version=' . $_GET['let']);
        mysql_query('UPDATE articles SET show_web=1 WHERE id=' . $_GET['let']);
        echo '<script type="text/javascript">document.location.href=\'?id=18\'</script>';
    } else if ( isset($_GET['del']) ) {
        mysql_query('UPDATE reported_content SET stav=2 WHERE version=' . $_GET['del']);
        mysql_query('UPDATE articles SET show_web=0 WHERE id=' . $_GET['del']);
        echo '<script type="text/javascript">document.location.href=\'?id=18\'</script>';
    } else if ( isset($_GET['del_list']) ) {
        mysql_query('DELETE FROM reported_content WHERE version=' . $_GET['del_list']);
        echo '<script type="text/javascript">document.location.href=\'?id=18\'</script>';
    }
    if ( isset($_GET['lector']) ) {
        mysql_query('UPDATE login.users SET group_rights=1, add_rights=1 WHERE id_user=' . $_GET['lector']);
        echo '<script type="text/javascript">document.location.href=\'?id=18&edit_users=1\'</script>';
    } elseif ( isset($_GET['del_lector']) ) {
        mysql_query('UPDATE login.users SET group_rights=0, add_rights=1 WHERE id_user=' . $_GET['del_lector']);
        echo '<script type="text/javascript">document.location.href=\'?id=18&edit_users=1\'</script>';
    }
?>
    <div>
<?php
if ( isset($_GET['edit_users']) ) {
    $admin->manage_users();
} else {
    $admin->manage_content();
}
?>
    </div>
<?php
} else {
    echo $main->return_error_text('Pre vstup do tejto sekcie musíte byť prihlásený ako administrátor.');
}
?>