Location: PHPKode > projects > l2jweb > administrare.php
<?
switch ($_GET['module'])
{

    case 'announce':
        if (@($_POST['submit'] == 'Submit'))
        {
            $sql = "INSERT INTO `web_announce` ( `id` , `title` , `text` , `date` ) VALUES ( NULL, '', '" .
                addslashes($_POST['anunt']) . "', CURRENT_TIMESTAMP );";
            if ($db->query($sql))
                $content = 'The announce was successfully added!';
            else
                $content = 'The announce wasn\'t added';

        } else
            $content = $smarty->fetch('admin/announce_add.tpl');
        break;
		
// TOS management
    case 'TOS':
        if (@$_GET['action'] == 'mod')
        {
            $TOS_file = fopen(skin . 'TOS.tpl', 'w');
            fwrite($TOS_file, $_POST['TOS']);
            fclose($TOS_file);
        }
        $TOS_file = fopen(skin . 'TOS.tpl', 'r');
        $TOS_content = fread($TOS_file, filesize(skin . 'TOS.tpl'));
        fclose($TOS_file);
        $smarty->assign('default_text', stripslashes($TOS_content));
        $content = $smarty->fetch('admin/edit_TOS.tpl');
        break;
		
		
//developer's ip management		
    case 'web_dev_ip':
        $sql = "SELECT * FROM `web_developers`";
        $web_dev = $db->fetch_all_array($sql);
        for ($i = 0; $i < 100; $i++)
        {
            if (@$web_dev[$i] == null)
                break;
            $developers[$web_dev[$i][0]] = $web_dev[$i][1];
        }
        $smarty->assign('player', $developers);
        $content = $smarty->fetch('admin/list_ip.tpl');

        break;
		
//banned ip management
    case 'web_bans':
        $sql = "SELECT * FROM `web_bans`";
        $web_dev = $db->fetch_all_array($sql);
        for ($i = 0; $i < 100; $i++)
        {
            if (@$web_dev[$i] == null)
                break;
            $developers[$web_dev[$i][0]] = $web_dev[$i][1];
        }
        $smarty->assign('player', $developers);
        $content = $smarty->fetch('admin/list_ip.tpl');

        break;
//users management
    case 'users':
        $sql = "SELECT * FROM `users`";
        $web_dev = $db->fetch_all_array($sql);
        for ($i = 0; $i < 100; $i++)
        {
            if (@$web_dev[$i] == null)
                break;
            $developers[$web_dev[$i][0]] = $web_dev[$i][1];
        }
        $smarty->assign('player', $developers);
        $content = $smarty->fetch('admin/list_ip.tpl');

        break;

}
?>
Return current item: l2jweb