<?
    
    include './system/common.php';
    
 include './system/functions.php';
        
      include './system/user.php';
    
if(!$user OR $user['access'] < 4 && $user['id'] != 1) {

  header('location: /');
    
exit;

}

    $title = 'SQL manager';    

include './system/h.php';

?>

<div class='title'><?=$title?></div>
 <div class='line'></div>
 
<?

  if($_POST['text']) {
  
  if(mysql_query($_POST['text'])) {
  
?>

<div class='content'>
SQL запрос: <code><?$_POST['text']?></code> успешно выполнен!
</div>
 <div class='line'></div>

<?
  
  }
  else
  {
  
  }
  
  }

?>

<div class='content'>
  <form action='/sql.php' method='post'>
  
    <textarea name='text' style='width: 100%'></textarea><br/>
    <input type='submit' value='OK'/>
  
  </form></div>
<?

include './system/f.php';
  
?>