Вход Регистрация
Файл: Source/admin/block_user.php
Строк: 31
<?php
/*
 * Script name: Points4Prize
 * Author: Soft Projects
 * Date created: 15/07/2015
 */
 
 
$ID = (int) htmlspecialchars($_GET['id']);
include 
"common.php";
head();
?>

<div class="body content rows scroll-y">
    <!-- Page header -->
    <div class="page-heading">
        <h1><b>Block user</b> </h1>
    </div>
    <!-- End page header -->
    <!-- Begin info box -->
    <div class="row">
        <div class="col-md-12">
            <div class="box-info">
                <h2>Block user</h2>
                <?php
                $result 
mysql_query("SELECT * FROM `vn_users` WHERE `id`=$ID");
                
$row mysql_fetch_array($result);
                
                if(isset(
$_POST['add'])){
                
                    
$reason htmlspecialchars($_POST['reason']);
                    
                    
$time time();
                    
                    
mysql_query("UPDATE `vn_users` SET `active` = 'no' WHERE `id` = $ID");
                    
mysql_query("INSERT INTO `vn_blocked` (`userid`, `reason`, `time`) VALUES ('$ID', '$reason', '$time');");
                    echo 
'<div class="alert alert-success">The user has been blocked.<br /><a href="users.php">Back to users.</a></div>';
                }
                
?>
                <form action="" method="post">
                    <p>
                        <label>
                            User: 
                        </label> <?php echo $row['user'];?>
                    </p>
                    <p>
                        <label>
                            Reason
                        </label>
                        <textarea name="reason" class="form-control" required="true" rows="3"></textarea>
                    </p>
                    <input type="submit"  class="btn btn-success" name="add" value="Block" />
                </form>
            </div>
            <?php
            footer
();
            
?>
        </div>
    </div>
Онлайн: 1
Реклама