<?php
/*********************/
/*                   */
/*  Version : 5.1.0  */
/*  Author  : RM     */
/*  Comment : 071223 */
/*                   */
/*********************/

echo "<body marginheight=\"0\" marginwidth=\"0\" topmargin=\"0\" leftmargin=\"0\" rightmargin=\"0\">\r\n<script  type=\"text/javascript\" language=\"javascript\" src=\"../js/functions.js\"></script>\r\n<link rel=\"stylesheet\" href=\"../css/style.css\" type=\"text/css\">\r\n";
$action = $_GET['action'];
if ( $action == "conta" || empty( $action ) )
{
    $search = "Conta";
}
if ( $action == "char" )
{
    $search = "Char";
}
if ( $action == "imagem" )
{
    $search = "Imagem";
}
if ( $action == "guild" )
{
    $search = "Guild";
}
echo "\r\n    \t<table width=\"100%\"><tr><td>\r\n        \t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=\"100%\">\r\n            \t<tr>\r\n                \t<td width=\"1\"><img src=\"../../images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                \t<td width=\"22\" background=\"../../images/bdy06.gif\" align=\"center\"><nobr>&nbsp;<img src=\"../../images/bullet090.gif\">&nbsp;</nobr></td>\r\n                \t<td width=\"95%\" background=\"../../images/bdy06.gif\" class=\"nrm02\" align=\"left\">&nbsp;<b><font color=\"#2283BF\">Procurar ";
echo $search;
echo "</font></b></td>\r\n                \t<td background=\"../../images/bdy06.gif\" align=\"right\"><img src=\"../../images/bullet031.gif\" width=\"6\" height=\"10\">&nbsp;&nbsp;</td>\r\n                \t<td width=\"1\"><img src=\"../../images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                </tr>\r\n                <tr>\r\n                \t<td width=\"1\" bgcolor=\"#666666\"><img src=\"../../images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                \t<td colspan=\"3\"  ";
if ( $action == "imagem" )
{
    echo "height=\"270\" valign=\"top\"";
}
echo "><!--<img src=\"images/spacer.gif\" width=\"100\" height=\"5\">-->\r\n                    \t";
if ( $action == "conta" || empty( $action ) )
{
    echo "                            <form name=\"form1\" id=\"form1\" action=\"\" method=\"post\">\r\n                            <table width=\"100%\">\r\n                            <tr>\r\n                                <td class=\"busca\">Conta:</td>\r\n                                <td><input type=\"text\" name=\"conta\" maxlength=\"255\" class=\"busca\"></td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td colspan=\"2\" align=\"center\">\r\n                                    <script language=\"JavaScript\">\r\n                                        <!--\r\n                                        //hide me\r\n                                        if (document.images) {\r\n                                        specbut1On = new Image();\r\n                                        specbut1On.src = \"../../images/en/buttons/procuraro.gif\";\r\n                                        specbut1Off = new Image();\r\n                                        specbut1Off.src = \"../../images/en/buttons/procurar.gif\";\r\n                                        }\r\n                                        //-->\r\n                                        </script>\r\n                                        <a href=\"#\" onClick=\"document.form1.submit(); return false;\" onMouseOver='ShowHide(\"specbut1\",\"specbut1On\");' onMouseOut='ShowHide(\"specbut1\",\"specbut1Off\")'><img src=\"../../images/en/buttons/procurar.gif\" Array border=\"0\" name=\"specbut1\"></a>\r\n                                </form>\r\n                                </td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td colspan=\"2\" align=\"center\">\r\n                                    ";
    if ( isset( $_POST['conta'] ) )
    {
        $conta = $_POST['conta'];
        require( "../check.class.php" );
        require( "../sql.class.php" );
        $check = new checkclass( );
        $sql = new sqlclass( );
        $sql->connect( );
        $check->checacampobranco( $conta, "Conta" );
        $sql->query( "SELECT memb___id FROM MEMB_INFO WHERE memb___id LIKE '%".$conta."%' ORDER BY memb___id ASC" );
        echo "<select size=\"15\" name=\"busca\" id=\"busca\" class=\"busca\">";
        while ( $contas = $sql->row( ) )
        {
            echo "<option value=\"".$contas[0]."\">".$contas[0]."</option>";
        }
        echo "</select><br>\r\n                                        <a href=\"javascript:;\" OnClick=\"javascript:Volta();\">Bot&atilde;o OK</a>\r\n                                        ";
    }
    echo "                                </td>\r\n                            </tr>\r\n                            </table>\r\n                        ";
}
if ( $action == "char" )
{
    echo "                        \t<form name=\"form1\" id=\"form1\" action=\"\" method=\"post\">\r\n                            <table width=\"100%\">\r\n                            <tr>\r\n                                <td class=\"busca\">Char:</td>\r\n                                <td><input type=\"text\" name=\"char\" maxlength=\"255\" class=\"busca\"></td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td colspan=\"2\" align=\"center\">\r\n                                    <script language=\"JavaScript\">\r\n                                        <!--\r\n                                        //hide me\r\n                                        if (document.images) {\r\n                                        specbut1On = new Image();\r\n                                        specbut1On.src = \"../../images/en/buttons/procuraro.gif\";\r\n                                        specbut1Off = new Image();\r\n                                        specbut1Off.src = \"../../images/en/buttons/procurar.gif\";\r\n                                        }\r\n                                        //-->\r\n                                        </script>\r\n                                        <a href=\"#\" onClick=\"document.form1.submit(); return false;\" onMouseOver='ShowHide(\"specbut1\",\"specbut1On\");' onMouseOut='ShowHide(\"specbut1\",\"specbut1Off\")'><img src=\"../../images/en/buttons/procurar.gif\" Array border=\"0\" name=\"specbut1\"></a>\r\n                                </form>\r\n                                </td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td colspan=\"2\" align=\"center\">\r\n                                    ";
    if ( isset( $_POST['char'] ) )
    {
        $char = $_POST['char'];
        require( "../check.class.php" );
        require( "../sql.class.php" );
        $check = new checkclass( );
        $sql = new sqlclass( );
        $sql->connect( );
        $check->checacampobranco( $char, "Char" );
        $sql->query( "SELECT Name FROM Character WHERE Name LIKE '%".$char."%' ORDER BY Name ASC" );
        echo "<select size=\"15\" name=\"busca\" id=\"busca\" class=\"busca\">";
        while ( $chars = $sql->row( ) )
        {
            echo "<option value=\"".$chars[0]."\">".$chars[0]."</option>";
        }
        echo "</select><br>\r\n                                        <a href=\"javascript:;\" OnClick=\"javascript:VoltaChar();\">Bot&atilde;o OK</a>\r\n                                        ";
    }
    echo "                                </td>\r\n                            </tr>\r\n                            </table>\r\n\t\t\t\t\t\t";
}
if ( $action == "imagem" )
{
    if ( $_GET['imagem'] )
    {
        $imagem = $_GET['imagem'];
        $end = substr( $imagem, 8 );
        $arquivo2 = substr( $end, -10 );
        $diretorio = substr( $end, 0, -11 );
        $arquivo = substr( $arquivo2, 0, 6 );
        echo "\t\t\t\t\t\t<table width=\"100%\">\r\n                            <tr>\r\n                                <td align=\"center\">\r\n\t\t\t<select name=\"diretorio\" id=\"diretorio\" style=\"width: 100px;\" onChange=\"DirChangeCat('";
        echo $_GET['imagem'];
        echo "')\">\r\n                  <option>&lt;Selecione&gt;</option>\t\t\r\n";
        $dir = "../../images/shop/";
        if ( is_dir( $dir ) && ( $dh = opendir( $dir ) ) )
        {
            while ( false != ( $file = readdir( $dh ) ) )
            {
                if ( !( filetype( $dir.$file ) == "dir" ) && !( $file != ".." ) && !( $file != "." ) && !( $file != "" ) )
                {
                    if ( $_GET['dir'] == $file || $diretorio == $file )
                    {
                        echo "\t\t\t\t\t\t\t\t<option selected value=\"";
                        echo $file;
                        echo "\">";
                        echo $file;
                        echo "</option>\r\n\t\t\t\t\t\t\t";
                    }
                    else
                    {
                        echo "\t\t\t\t\t\t\t\t<option value=\"";
                        echo $file;
                        echo "\">";
                        echo $file;
                        echo "</option>\r\n\t\t\t\t\t\t\t";
                    }
                }
            }
            closedir( $dh );
        }
        echo "\t\t\t</select>\r\n\t\t</td>\r\n\t\t<td>\r\n\t\t\t<select name=\"sub\" id=\"sub\" style=\"width: 100px;\" onChange=\"DirSubChangeCat2('";
        echo $_GET['imagem'];
        echo "')\">\r\n                  <option>&lt;Selecione&gt;</option>\t\r\n\t";
        if ( $_GET['dir'] || $diretorio )
        {
            if ( $_GET['dir'] )
            {
                $a = "../../images/shop/".$_GET['dir'];
            }
            else
            {
                $a = "../../images/shop/".$diretorio;
            }
            $d = dir( $a );
            while ( false != ( $entry = $d->read( ) ) )
            {
                if ( !( $entry != ".." ) && !( $entry != "." ) && !( pathinfo( $entry, PATHINFO_EXTENSION ) == "jpg" ) && !( strlen( $entry ) <= 10 ) )
                {
                    $entry = substr( $entry, 0, 6 );
                    if ( $_GET['sub'] == $entry || $arquivo == $entry )
                    {
                        echo "\t\t\t\t\t\t\t\t\t<option selected value=\"";
                        echo $entry;
                        echo "\">";
                        echo $entry;
                        echo "</option>\r\n\t\t\t\t\t\t\t\t";
                    }
                    else
                    {
                        echo "\t\t\t\t\t\t\t\t\t<option value=\"";
                        echo $entry;
                        echo "\">";
                        echo $entry;
                        echo "</option>\r\n\t\t\t\t\t\t\t\t";
                    }
                }
            }
        }
        echo "</select>\r\n\t\t</td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td align=\"center\" colspan=\"2\">\r\n\t\t\t\t";
        if ( !$_GET['dir'] && $_GET['sub'] || $diretorio && $arquivo )
        {
            if ( !isset( $_GET['dir'] ) )
            {
                $GLOBALS['_GET']['dir'] = $diretorio;
            }
            if ( !isset( $_GET['sub'] ) )
            {
                $GLOBALS['_GET']['sub'] = $arquivo;
            }
            $dirpadrao = "images/shop/";
            $foto = $dirpadrao.$_GET['dir']."/".$_GET['sub'];
            echo "\t\t\t\t<br><br><img src=\"../../images/shop/";
            echo $_GET['dir'];
            echo "/";
            echo $_GET['sub'];
            echo ".jpg\">\r\n\t\t\t\t<br><br><a href=\"javascript:Volta('";
            echo $foto;
            echo "_s.jpg','";
            echo $foto;
            echo ".jpg');\">Inserir Imagem</a>\r\n\t\t\t";
        }
        echo "\t\t</td>\r\n\t</tr>\r\n</table>\r\n";
    }
    if ( !isset( $_GET['imagem'] ) )
    {
        echo "\t\t\t\t\t\t<table width=\"100%\">\r\n                            <tr>\r\n                                <td align=\"center\">\r\n\t\t\t<select name=\"diretorio\" id=\"diretorio\" style=\"width: 100px;\" onChange=\"DirChangeCat()\">\r\n                  <option>&lt;Selecione&gt;</option>\t\t\r\n";
        $dir = "../../images/shop/";
        if ( is_dir( $dir ) && ( $dh = opendir( $dir ) ) )
        {
            while ( ( $file = readdir( $dh ) ) != false )
            {
                if ( !( filetype( $dir.$file ) == "dir" ) && !( $file != ".." ) && !( $file != "." ) && !( $file != "" ) )
                {
                    if ( $_GET['dir'] == $file )
                    {
                        echo "\t\t\t\t\t\t\t\t<option value=\"";
                        echo $file;
                        echo "\" selected=\"selected\">";
                        echo $file;
                        echo "</option>\r\n\t\t\t\t\t\t\t";
                    }
                    else
                    {
                        echo "\t\t\t\t\t\t\t\t<option value=\"";
                        echo $file;
                        echo "\">";
                        echo $file;
                        echo "</option>\r\n\t\t\t\t\t\t\t";
                    }
                }
            }
            closedir( $dh );
        }
        echo "\t\t\t</select>\r\n\t\t</td>\r\n\t\t<td>\r\n\t\t\t\t\t\t<select name=\"sub\" id=\"sub\" style=\"width: 100px;\" onChange=\"DirSubChangeCat()\">\r\n                  <option>&lt;Selecione&gt;</option>\r\n\t";
        if ( $_GET['dir'] )
        {
            $a = "../../images/shop/".$_GET['dir'];
            $d = dir( $a );
            while ( false != ( $entry = $d->read( ) ) )
            {
                if ( !( $entry != ".." ) && !( $entry != "." ) && !( pathinfo( $entry, PATHINFO_EXTENSION ) == "jpg" ) && !( strlen( $entry ) <= 10 ) )
                {
                    $entry = substr( $entry, 0, 6 );
                    if ( $_GET['sub'] == $entry )
                    {
                        echo "\t\t\t\t\t\t\t\t\t<option selected=\"selected\" value=\"";
                        echo $entry;
                        echo "\">";
                        echo $entry;
                        echo "</option>\r\n\t\t\t\t\t\t\t\t";
                    }
                    else
                    {
                        echo "\t\t\t\t\t\t\t\t\t<option value=\"";
                        echo $entry;
                        echo "\">";
                        echo $entry;
                        echo "</option>\r\n\t\t\t\t\t\t\t\t";
                    }
                }
            }
        }
        echo "</select>\r\n\t\t</td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td align=\"center\" colspan=\"2\">\r\n\t\t\t\t";
        if ( $_GET['dir'] && $_GET['sub'] )
        {
            $dirpadrao = "images/shop/";
            $foto = $dirpadrao.$_GET['dir']."/".$_GET['sub'];
            echo "\t\t\t<br><br><img src=\"../../images/shop/";
            echo $_GET['dir'];
            echo "/";
            echo $_GET['sub'];
            echo ".jpg\">\r\n            \r\n\t\t\t<br><br>\r\n\t\t\t<script language=\"JavaScript\">\r\n\t\t\t\t<!--\r\n\t\t\t\t//hide me\r\n\t\t\t\tif (document.images) {\r\n\t\t\t\t\tspecbut3On = new Image();\r\n\t\t\t\t\tspecbut3On.src = \"../../images/en/buttons/prosseguiro.gif\";\r\n\t\t\t\t\tspecbut3Off = new Image();\r\n\t\t\t\t\tspecbut3Off.src = \"../../images/en/buttons/prosseguir.gif\";\r\n\t\t\t\t}\r\n\t\t\t\t//-->\r\n \t\t\t</script>\r\n                <a href=\"javascript:Volta('";
            echo $foto;
            echo "_s.jpg','";
            echo $foto;
            echo ".jpg');\" onMouseOver='ShowHide(\"specbut3\",\"specbut3On\");' onMouseOut='ShowHide(\"specbut3\",\"specbut3Off\")'><img src=\"../../images/en/buttons/prosseguir.gif\" Array border=\"0\" name=\"specbut3\"></a>\r\n\t\t\t";
        }
        echo "\t\t</td>\r\n\t</tr>\r\n</table>\r\n";
    }
    echo "\t\t\t\t\t";
}
if ( $action == "guild" )
{
    echo "                        \t<form name=\"form1\" id=\"form1\" action=\"\" method=\"post\">\r\n                            <table width=\"100%\">\r\n                            <tr>\r\n                                <td class=\"busca\">Guild:</td>\r\n                                <td><input type=\"text\" name=\"guild\" maxlength=\"8\" class=\"busca\"></td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td colspan=\"2\" align=\"center\">\r\n                                    <script language=\"JavaScript\">\r\n                                        <!--\r\n                                        //hide me\r\n                                        if (document.images) {\r\n                                        specbut1On = new Image();\r\n                                        specbut1On.src = \"../../images/en/buttons/procuraro.gif\";\r\n                                        specbut1Off = new Image();\r\n                                        specbut1Off.src = \"../../images/en/buttons/procurar.gif\";\r\n                                        }\r\n                                        //-->\r\n                                        </script>\r\n                                        <a href=\"#\" onClick=\"document.form1.submit(); return false;\" onMouseOver='ShowHide(\"specbut1\",\"specbut1On\");' onMouseOut='ShowHide(\"specbut1\",\"specbut1Off\")'><img src=\"../../images/en/buttons/procurar.gif\" Array border=\"0\" name=\"specbut1\"></a>\r\n                                </form>\r\n                                </td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td colspan=\"2\" align=\"center\">\r\n                                    ";
    if ( isset( $_POST['guild'] ) )
    {
        $guild = $_POST['guild'];
        require( "../check.class.php" );
        require( "../sql.class.php" );
        $check = new checkclass( );
        $sql = new sqlclass( );
        $sql->connect( );
        $check->checacampobranco( $guild, "Guild" );
        $sql->query( "SELECT G_Name FROM Guild WHERE G_Name LIKE '%".$guild."%' ORDER BY G_Name ASC" );
        echo "<select size=\"15\" name=\"busca\" id=\"busca\" class=\"busca\">";
        while ( $guilds = $sql->row( ) )
        {
            echo "<option value=\"".$guilds[0]."\">".$guilds[0]."</option>";
        }
        echo "</select><br>\r\n                                        <a href=\"javascript:;\" OnClick=\"javascript:VoltaGuild();\">Bot&atilde;o OK</a>\r\n                                        ";
    }
    echo "                                </td>\r\n                            </tr>\r\n                            </table>\r\n\t\t\t\t\t\t";
}
echo "\r\n                    </td>\r\n                    <td width=\"1\" bgcolor=\"#666666\"><img src=\"../../images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                </tr>\r\n                <tr>\r\n                    <td width=\"1\"><img src=\"../../images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                    <td bgcolor=\"#666666\" colspan=\"3\"><img src=\"../../images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                    <td width=\"1\"><img src=\"../../images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                </tr>\r\n\t\t\t</table>\r\n\t\t</td>\r\n\t</tr>\r\n</table>\r\n</body>";
?>
