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

$action = $_GET['action'];
$go = $_GET['go'];
$id = $_GET['id'];
if ( $action == "adicionar" )
{
    if ( $go == false )
    {
        echo "    \t<script language=\"javascript\" src=\"modules/js/shopajax.js\"></script>\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\">Adicionar Item no Shop Virtual</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\"><!--<img src=\"images/spacer.gif\" width=\"100\" height=\"5\">-->\r\n                    \t<form name=\"FormAdicionarShopp\" id=\"FormAdicionarShopp\" action=\"\" method=\"post\">\r\n                        <span id=\"dados\"></span>\r\n                         ";
        if ( empty( $_POST['Categoria'] ) && empty( $_POST['SubCategoria'] ) )
        {
            echo "                \t\t<table width=\"100%\" cellpadding=\"5\" cellspacing=\"2\">\r\n                \t\t<tr>\r\n                \t\t\t<td align=\"center\">\r\n                            <select name=\"listCategorias\" id=\"listCategorias\" style=\"width: 200px;\" onChange=\"Dados(this.value);\">\r\n                            \t<option value=\"0\">&lt;Selecione uma categoria&gt;</option>\r\n                            ";
            $sql->query( "SELECT Id, Categoria FROM SITE_SHOPCATEGORIAS WHERE Condicao='1'" );
            while ( $info = $sql->row( ) )
            {
                echo "                                \t<option value=\"";
                echo $info[0];
                echo "\">";
                echo $info[1];
                echo "</option>\r\n                                ";
            }
            echo "                            </select></td>\r\n                \t\t\t<td align=\"center\">\r\n\t\t\t\t\t\t<select name=\"listSubCategorias\" id=\"listSubCategorias\" style=\"width: 200px;\" onChange=\"FecharFuncao('1');\">\r\n\t\t\t\t\t\t\t\t<option id=\"opcoes\" value=\"0\">&lt;Primeiro selecione a categoria&gt;</option>\r\n\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t\t</td>\r\n                \t\t</tr>\r\n\t\t\t\t\t\t</table>\r\n                        ";
        }
        echo "                        </form>\r\n                        ";
        if ( isset( $_POST['Categoria'], $_POST['SubCategoria'] ) )
        {
            echo "                    \t<form name=\"FormAdicionarShop\" id=\"FormAdicionarShop\" action=\"?page=shop&action=adicionar&go=1\" method=\"post\">\r\n                        <input type=\"hidden\" id=\"Categoria\" name=\"Categoria\" value=\"";
            echo $_POST['Categoria'];
            echo "\" />\r\n                        <input type=\"hidden\" id=\"SubCategoria\" name=\"SubCategoria\" value=\"";
            echo $_POST['SubCategoria'];
            echo "\" />\r\n                \t\t<table width=\"100%\" cellpadding=\"5\" cellspacing=\"2\">\r\n                \t\t<tr>\r\n                \t\t\t<td align=\"center\" colspan=\"2\">\r\n                            <select name=\"listCategorias\" id=\"listCategorias\" style=\"width: 200px;\" disabled=\"disabled\">\r\n                            ";
            $sql->query( "SELECT Id, Categoria FROM SITE_SHOPCATEGORIAS WHERE Condicao='1'" );
            while ( $info = $sql->row( ) )
            {
                if ( $_POST['Categoria'] == $info[0] )
                {
                    echo "                                \t<option value=\"";
                    echo $info[0];
                    echo "\">";
                    echo $info[1];
                    echo "</option>\r\n                                \t";
                }
            }
            echo "                            </select></td>\r\n                \t\t\t<td align=\"center\" colspan=\"2\">\r\n\t\t\t\t\t\t\t<select name=\"listSubCategorias\" id=\"listSubCategorias\" style=\"width: 200px;\" disabled=\"disabled\">\r\n\t\t";
            $sql->query( "SELECT Numero, Sub FROM SITE_SHOPSUBCATEGORIAS WHERE Categoria='".$_POST['Categoria']."' AND Condicao='1'" );
            while ( $info = $sql->row( ) )
            {
                if ( $_POST['SubCategoria'] == $info[0] )
                {
                    echo "                                    <option value=\"";
                    echo $info[0];
                    echo "\">";
                    echo $info[1];
                    echo "</option>\r\n                                    ";
                }
            }
            echo "\t\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t\t</td>\r\n                \t\t</tr>\r\n                        <tr>\r\n                        \t<td align=\"center\" colspan=\"4\"><select name=\"nome\" id=\"nome\" style=\"width: 250px;\">\r\n\t\t\t\t\t  <option>&lt;Selecione o nome do item&gt;</option>\r\n\t\t\t\t\t \t";
            if ( $_POST['Categoria'] == 1 )
            {
                $sql->query( "SELECT Nome FROM ShopSets ORDER BY Nome ASC" );
                while ( $Nome = $sql->row( ) )
                {
                    echo "\t\t\t\t\t\t\t\t\t<option value=\"";
                    echo $Nome[0];
                    echo "\">";
                    echo $Nome[0];
                    echo "</option>\r\n\t\t\t\t\t\t\t\t";
                }
            }
            else if ( $_POST['Categoria'] == 2 )
            {
                $sql->query( "SELECT Sub FROM SITE_SHOPSUBCATEGORIAS WHERE Categoria='".$_POST['Categoria']."' AND Numero='".$_POST['SubCategoria']."' ORDER BY Sub ASC" );
                $SubCat = $sql->row( );
                $sql->query( "SELECT i_Name FROM ShopItens WHERE i_Type='".$SubCat[0]."' ORDER BY i_Name ASC" );
                while ( $Nome = $sql->row( ) )
                {
                    echo "\t\t\t\t\t\t\t\t\t<option value=\"";
                    echo $Nome[0];
                    echo "\">";
                    echo $Nome[0];
                    echo "</option>\r\n\t\t\t\t\t\t\t\t";
                }
            }
            else
            {
                $sql->query( "SELECT Categoria FROM SITE_SHOPCATEGORIAS WHERE Id='".$_POST['Categoria']."' ORDER BY Categoria ASC" );
                $Cate = $sql->row( );
                if ( $Cate[0] == "Escudos" )
                {
                    $Cate[0] = "Shields";
                }
                if ( $Cate[0] == "Asas" )
                {
                    $Cate[0] = "Wings";
                }
                if ( $Cate[0] == "Joias" )
                {
                    $Cate[0] = "Jewels";
                }
                $sql->query( "SELECT i_Name FROM ShopItens WHERE i_Type='".$Cate[0]."' ORDER BY i_Name ASC" );
                while ( $Nome = $sql->row( ) )
                {
                    echo "\t\t\t\t\t\t\t\t<option value=\"";
                    echo $Nome[0];
                    echo "\">";
                    echo $Nome[0];
                    echo "</option>\r\n\t\t\t\t\t\t\t";
                }
            }
            echo "\t\t\t\t\t</select></td>\r\n                    \t</tr>\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<td class=\"shop\" align=\"right\">Op&ccedil;&otilde;es Liberadas:</td>\r\n\t\t\t\t\t\t\t<td><input type=\"checkbox\" value=\"1\" name=\"level\" id=\"level\" />Level<br>\r\n                                <input type=\"checkbox\" value=\"1\" name=\"adicional\" id=\"adicional\">Adicional<br>\r\n                                <input type=\"checkbox\" value=\"1\" name=\"luck\" id=\"luck\">Luck<br>\r\n                                <input type=\"checkbox\" value=\"1\" name=\"skill\" id=\"skill\">Skill<br>\r\n                                <input type=\"checkbox\" value=\"1\" name=\"opcao\" id=\"opcao\">Op&ccedil;&otilde;es Excelentes<br>\r\n                                <input type=\"checkbox\" value=\"1\" name=\"full\" id=\"full\">Item Full\r\n                            </td>\r\n\t\t\t\t\t\t\t<td align=\"left\" class=\"shop\" colspan=\"2\" rowspan=\"2\">\r\n                                Pre&ccedil;o Level:<br>\r\n                                <input type=\"text\" maxlength=\"4\" id=\"plevel\" name=\"plevel\" style=\"width: 90px;\"><br>\r\n                                Pre&ccedil;o Adicional:<br>\r\n                                <input type=\"text\" maxlength=\"4\" id=\"padicional\" name=\"padicional\" style=\"width: 90px;\"><br>\r\n                                Pre&ccedil;o Luck:<br>\r\n                                <input type=\"text\" maxlength=\"4\" id=\"pluck\" name=\"pluck\" style=\"width: 90px;\"><br>\r\n                                Pre&ccedil;o Skill:<br>\r\n                                 <input type=\"text\" maxlength=\"4\" id=\"pskill\" name=\"pskill\" style=\"width: 90px;\"><br>\r\n                                Pre&ccedil;o Opcional:<br>\r\n                                <input type=\"text\" maxlength=\"4\" id=\"popcao\" name=\"popcao\" style=\"width: 90px;\"><br>\r\n                            </td>\r\n\t\t\t\t\t\t</tr>\r\n                        <tr>\r\n\t\t\t\t\t\t\t<td class=\"shop\" align=\"right\">Promo&ccedil;&atilde;o:</td>\r\n\t\t\t\t\t\t\t<td><input type=\"checkbox\" value=\"1\" name=\"promocao\" id=\"promocao\"> Promo&ccedil;&atilde;o</td>\r\n\t\t\t\t\t\t</tr>\r\n                        <tr>\r\n                        \t<td class=\"shop\" valign=\"top\" align=\"right\">Pre&ccedil;o:</td>\r\n\t\t\t\t\t\t\t<td><input type=\"text\" maxlength=\"4\" id=\"preco\" name=\"preco\" style=\"width: 40px;\"> Gold(s)</td>\r\n                    \t\t<td align=\"left\" valign=\"top\" colspan=\"2\" rowspan=\"5\"><input type=\"hidden\" id=\"foto\" name=\"foto\" value=\"\">\r\n                            \t<input type=\"hidden\" id=\"mini\" name=\"mini\" value=\"\">\r\n                            \t<input type=\"hidden\" id=\"i_foto\" name=\"i_foto\" value=\"\">\r\n\t\t\t\t\t\t\t\t<script language=\"JavaScript\">\r\n\t\t\t\t\t\t\t\t\t<!--\r\n\t\t\t\t\t\t\t\t\t//hide me\r\n\t\t\t\t\t\t\t\t\tif (document.images) {\r\n\t\t\t\t\t\t\t\t\t\tspecbut2On = new Image();\r\n\t\t\t\t\t\t\t\t\t\tspecbut2On.src = \"images/en/buttons/procuraro.gif\";\r\n\t\t\t\t\t\t\t\t\t\tspecbut2Off = new Image();\r\n\t\t\t\t\t\t\t\t\t\tspecbut2Off.src = \"images/en/buttons/procurar.gif\";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t//-->\r\n\t\t\t\t\t\t\t\t\t</script>\r\n\t\t\t\t\t\t\t\t\t<a href=\"javascript:;\" onClick=\"BuscaImagem();\" onMouseOver='ShowHide(\"specbut2\",\"specbut2On\");' onMouseOut='ShowHide(\"specbut2\",\"specbut2Off\")'><img src=\"images/en/buttons/procurar.gif\" Array border=\"0\" name=\"specbut2\"></a><br />\r\n                                    <span id=\"produto\" style=\"height: 182px;\">&nbsp;</span>\r\n                            </td>\r\n                        </tr>\r\n                       <tr>\r\n                        \t<td align=\"center\" class=\"shop\" valign=\"top\">Status Produto</td>\r\n                        \t<td valign=\"top\">\r\n                            \t<input type=\"radio\" name=\"status\" id=\"status\" value=\"0\"> Desativado \r\n                            \t<input type=\"radio\" name=\"status\" id=\"status\" value=\"1\"> Ativado \r\n                            </td>\r\n                       </tr>\r\n                       <tr>\r\n                       \t\t<td align=\"center\" class=\"shop\" valign=\"top\" colspan=\"2\">\r\n                       </td>\r\n                        <tr>\r\n                       \t\t<td align=\"center\" class=\"shop\" valign=\"top\" colspan=\"2\">\r\n                       </td>\r\n                       <tr>\r\n                       \t\t<td align=\"center\" class=\"shop\" valign=\"top\" colspan=\"2\">\r\n                       </td>\r\n                       <tr>\r\n                       \t\t<td align=\"center\" class=\"shop\" valign=\"top\" colspan=\"2\">\r\n                       </td>\r\n                       <tr>\r\n                        \t<td align=\"center\" class=\"shop\" valign=\"top\" colspan=\"4\">\r\n\t\t\t\t\t\t\t\t<script language=\"JavaScript\">\r\n\t\t\t\t\t\t\t\t\t<!--\r\n\t\t\t\t\t\t\t\t\t//hide me\r\n\t\t\t\t\t\t\t\t\tif (document.images) {\r\n\t\t\t\t\t\t\t\t\tspecbut1On = new Image();\r\n\t\t\t\t\t\t\t\t\tspecbut1On.src = \"images/en/buttons/additemo.gif\";\r\n\t\t\t\t\t\t\t\t\tspecbut1Off = new Image();\r\n\t\t\t\t\t\t\t\t\tspecbut1Off.src = \"images/en/buttons/additem.gif\";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t//-->\r\n\t\t\t\t\t\t\t\t\t</script>\r\n\t\t\t\t\t\t\t\t\t<a href=\"#\" onClick=\"document.FormAdicionarShop.submit(); return false;\" onMouseOver='ShowHide(\"specbut1\",\"specbut1On\");' onMouseOut='ShowHide(\"specbut1\",\"specbut1Off\")'><img src=\"images/en/buttons/additem.gif\" Array border=\"0\" name=\"specbut1\"></a>\r\n                            </td>\r\n                       </tr>\r\n\t\t\t\t\t</table>\r\n                        ";
        }
        echo "                    </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    ";
    }
    if ( $go == true )
    {
        $categoria = $_POST['Categoria'];
        $subcategoria = $_POST['SubCategoria'];
        $nome = $_POST['nome'];
        $level = $_POST['level'];
        $adicional = $_POST['adicional'];
        $luck = $_POST['luck'];
        $skill = $_POST['skill'];
        $opcao = $_POST['opcao'];
        $full = $_POST['full'];
        $plevel = $_POST['plevel'];
        $padicional = $_POST['padicional'];
        $pluck = $_POST['pluck'];
        $pskill = $_POST['pskill'];
        $popcao = $_POST['popcao'];
        $promocao = $_POST['promocao'];
        $foto = $_POST['foto'];
        $mini = $_POST['mini'];
        $preco = $_POST['preco'];
        $status = $_POST['status'];
        $check->checacampobranco( $nome, "Nome" );
        $check->checacampobranco( $foto, "Foto" );
        $check->checacampobranco( $mini, "Mini Foto" );
        $check->checanumeropositivo( $categoria, "Categoria" );
        $check->checanumeropositivo( $subcategoria, "SubCategoria" );
        $check->checanumeropositivo( $plevel, "Preco do Level" );
        $check->checanumeropositivo( $padicional, "Preco do Adicional" );
        $check->checanumeropositivo( $pluck, "Preco do Luck" );
        $check->checanumeropositivo( $pskill, "Preco do Skill" );
        $check->checanumeropositivo( $popcao, "Preco do Opcional" );
        $check->checanumeropositivo( $preco, "Preco" );
        if ( empty( $level ) )
        {
            $level = 0;
        }
        if ( empty( $adicional ) )
        {
            $adicional = 0;
        }
        if ( empty( $luck ) )
        {
            $luck = 0;
        }
        if ( empty( $skill ) )
        {
            $skill = 0;
        }
        if ( empty( $opcao ) )
        {
            $opcao = 0;
        }
        if ( empty( $full ) )
        {
            $full = 0;
        }
        if ( empty( $promocao ) )
        {
            $promocao = 0;
        }
        if ( empty( $status ) )
        {
            $status = 0;
        }
        if ( empty( $level_item ) )
        {
            $level_item = 0;
        }
        $sql->executaadicionaritemshop( $nome, $preco, $categoria, $subcategoria, $mini, $foto, $promocao, $status, $level, $adicional, $skill, $luck, $opcao, $full, $level_item, $plevel, $padicional, $pskill, $pluck, $popcao );
    }
}
if ( $action == "alterar" )
{
    $sql->query( "SELECT Id, Nome, Preco, Comprado, Categoria, SubCategoria, Opcoes, Promocao, MiniFoto, Foto FROM SITE_SHOPITEM, SITE_SHOPINFORMACOES WHERE Id=ItemID" );
    if ( $id == false && $go == false )
    {
        echo "<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\">Alterar Item Shop</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\"><!--<img src=\"images/spacer.gif\" width=\"100\" height=\"5\">-->\r\n                \t\t<table width=\"100%\" cellpadding=\"5\">\r\n                        <tr>\r\n                          <td colspan=\"8\" class=\"infotitulo\">Shop</td>\r\n                        </tr>\r\n\t\t\t\t\t\t<tr class=\"downtitulo\">\r\n\t\t\t\t\t\t\t<td>#ID</td>\r\n\t\t\t\t\t\t\t<td>Nome</td>\r\n\t\t\t\t\t\t\t<td>Preco</td>\r\n\t\t\t\t\t\t\t<td>Comprado</td>\r\n                            <td>A&ccedil;&atilde;o</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t";
        while ( $info = $sql->row( ) )
        {
            ++$x;
            if ( $x % 2 == 0 )
            {
                $estilo = "down2";
            }
            else
            {
                $estilo = "down1";
            }
            $sql->query( "SELECT Categoria FROM SITE_SHOPCATEGORIAS WHERE Id='".$info[4]."'" );
            $categoria = $sql->row( );
            $categoria = $categoria[0];
            $sql->query( "SELECT Sub FROM SITE_SHOPSUBCATEGORIAS WHERE Numero='".$info[5]."'" );
            $subcategoria = $sql->row( );
            $subcategoria = $subcategoria[0];
            $sql->query( "SELECT Level, Adicional, Skill, Luck, Opcional, [Full] FROM SITE_SHOPOPCOES WHERE Id='".$info[6]."'" );
            $opcoes = $sql->row( );
            echo "                            <form name=\"form";
            echo $x;
            echo "\" action=\"\" method=\"post\">\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[0];
            echo "</td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\"><a href=\"javascript:;\" onmouseover=\"Tip('<table><tr><td>Categoria: ";
            echo $categoria;
            echo "<br>SubCategoria: ";
            echo $subcategoria;
            echo "<br>Customizar Level: ";
            echo $check->simounao( $opcoes[0] );
            echo "<br>Customizar Adicional: ";
            echo $check->simounao( $opcoes[0] );
            echo "<br>Customizar Skill: ";
            echo $check->simounao( $opcoes[1] );
            echo "<br>Customizar Luck: ";
            echo $check->simounao( $opcoes[2] );
            echo "<br>Customizar Opcional: ";
            echo $check->simounao( $opcoes[3] );
            echo "<br>Full: ";
            echo $check->simounao( $opcoes[4] );
            echo "<br>Promocao: ";
            echo $check->simounao( $info[7] );
            echo "</td><td><img src=\\'";
            echo $info[8];
            echo "\\'></td></tr></table>')\" class=\"down\">";
            echo $info[1];
            echo "</a></td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[2];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[3];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"javascript:;\" onClick=\"javascript:location='?page=shop&action=alterar&id=";
            echo $info[0];
            echo "'\">Alterar</a></td>\r\n                        </tr>\r\n                        \t</form>\r\n\t\t\t\t\t\t\t";
        }
        echo "\t\t\t\t\t\t</table>\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";
    }
    if ( $id == true && $go == false )
    {
        $check->checanumeropositivo( $id, "Id" );
        $sql->verificaidshop( $id, 1 );
        $sql->query( "SELECT Categoria, SubCategoria, Nome, Preco, Comprado, Opcoes, Precos, Promocao, MiniFoto, Foto, Mostrar FROM SITE_SHOPITEM, SITE_SHOPINFORMACOES WHERE Id=ItemID AND Id='".$id."'" );
        echo "<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\">Alterar Item no Shop</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\"><!--<img src=\"images/spacer.gif\" width=\"100\" height=\"5\">-->\r\n                    ";
        while ( $info = $sql->row( ) )
        {
            $sql->query( "SELECT Level, Adicional, Skill, Luck, Opcional, [Full] FROM SITE_SHOPOPCOES WHERE Id='".$info[5]."'" );
            $opcoes = $sql->row( );
            $sql->query( "SELECT Level, Adicional, Skill, Luck, Opcional FROM SITE_SHOPPRECOS WHERE Id='".$info[6]."'" );
            $precos = $sql->row( );
            if ( $opcoes[0] == 1 )
            {
                $opcao[0] = " checked=\"checked\"";
            }
            if ( $opcoes[1] == 1 )
            {
                $opcao[1] = " checked=\"checked\"";
            }
            if ( $opcoes[2] == 1 )
            {
                $opcao[2] = " checked=\"checked\"";
            }
            if ( $opcoes[3] == 1 )
            {
                $opcao[3] = " checked=\"checked\"";
            }
            if ( $opcoes[4] == 1 )
            {
                $opcao[4] = " checked=\"checked\"";
            }
            if ( $opcoes[5] == 1 )
            {
                $opcao[5] = " checked=\"checked\"";
            }
            if ( $info[7] == 1 )
            {
                $promocao = " checked=\"checked\"";
            }
            if ( $info[10] == 1 )
            {
                $stats[0] = " checked=\"checked\"";
            }
            if ( $info[10] == 0 )
            {
                $stats[1] = " checked=\"checked\"";
            }
            echo "                    <form name=\"form1\" id=\"form1\" action=\"?page=shop&action=alterar&go=1\" method=\"post\">\r\n                        <input type=\"hidden\" id=\"Categoria\" name=\"Categoria\" value=\"";
            echo $info[0];
            echo "\" />\r\n                        <input type=\"hidden\" id=\"SubCategoria\" name=\"SubCategoria\" value=\"";
            echo $info[1];
            echo "\" />\r\n                        <input type=\"hidden\" id=\"itemid\" name=\"itemid\" value=\"";
            echo $_GET['id'];
            echo "\" />\r\n                \t\t<table width=\"100%\" cellpadding=\"5\" cellspacing=\"2\">\r\n                \t\t<tr>\r\n                \t\t\t<td align=\"center\" colspan=\"2\">\r\n                            <select name=\"listCategorias\" id=\"listCategorias\" style=\"width: 200px;\" disabled=\"disabled\">\r\n                            ";
            $sql->query( "SELECT Id, Categoria FROM SITE_SHOPCATEGORIAS WHERE Condicao='1'" );
            while ( $infos = $sql->row( ) )
            {
                if ( $info[0] == $infos[0] )
                {
                    echo "                                \t<option value=\"";
                    echo $infos[0];
                    echo "\">";
                    echo $infos[1];
                    echo "</option>\r\n                                \t";
                }
            }
            echo "                            </select></td>\r\n                \t\t\t<td align=\"center\" colspan=\"2\">\r\n\t\t\t\t\t\t\t<select name=\"listSubCategorias\" id=\"listSubCategorias\" style=\"width: 200px;\" disabled=\"disabled\">\r\n\t\t";
            $sql->query( "SELECT Numero, Sub FROM SITE_SHOPSUBCATEGORIAS WHERE Categoria='".$info[0]."' AND Condicao='1'" );
            while ( $infos = $sql->row( ) )
            {
                if ( $info[1] == $infos[0] )
                {
                    echo "                                    <option value=\"";
                    echo $infos[0];
                    echo "\">";
                    echo $infos[1];
                    echo "</option>\r\n                                    ";
                }
            }
            echo "\t\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t\t</td>\r\n                \t\t</tr>\r\n                        <tr>\r\n                        \t<td align=\"center\" colspan=\"4\"><select name=\"nome\" id=\"nome\" style=\"width: 250px;\">\r\n\t\t\t\t\t \t";
            if ( $info[0] == 1 )
            {
                $sql->query( "SELECT Nome FROM ShopSets ORDER BY Nome ASC" );
                while ( $Nome = $sql->row( ) )
                {
                    if ( $info[2] == $Nome[0] )
                    {
                        echo "\t\t\t\t\t\t\t\t\t<option value=\"";
                        echo $Nome[0];
                        echo "\">";
                        echo $Nome[0];
                        echo "</option>\r\n                                    ";
                    }
                }
            }
            else if ( $info[0] == 2 )
            {
                $sql->query( "SELECT Sub FROM SITE_SHOPSUBCATEGORIAS WHERE Categoria='".$info[0]."' AND Numero='".$info[1]."' ORDER BY Sub ASC" );
                $SubCat = $sql->row( );
                $sql->query( "SELECT i_Name FROM ShopItens WHERE i_Type='".$SubCat[0]."' ORDER BY i_Name ASC" );
                while ( $Nome = $sql->row( ) )
                {
                    if ( $info[2] == $Nome[0] )
                    {
                        echo "\t\t\t\t\t\t\t\t\t<option value=\"";
                        echo $Nome[0];
                        echo "\">";
                        echo $Nome[0];
                        echo "</option>\r\n                                    ";
                    }
                }
            }
            else
            {
                $sql->query( "SELECT Categoria FROM SITE_SHOPCATEGORIAS WHERE Id='".$info[0]."' ORDER BY Categoria ASC" );
                $Cate = $sql->row( );
                if ( $Cate[0] == "Escudos" )
                {
                    $Cate[0] = "Shields";
                }
                if ( $Cate[0] == "Asas" )
                {
                    $Cate[0] = "Wings";
                }
                if ( $Cate[0] == "Joias" )
                {
                    $Cate[0] = "Jewels";
                }
                $sql->query( "SELECT i_Name FROM ShopItens WHERE i_Type='".$Cate[0]."' ORDER BY i_Name ASC" );
                while ( $Nome = $sql->row( ) )
                {
                    if ( $info[2] == $Nome[0] )
                    {
                        echo "\t\t\t\t\t\t\t\t<option value=\"";
                        echo $Nome[0];
                        echo "\">";
                        echo $Nome[0];
                        echo "</option>\r\n\t\t\t\t\t\t\t\t";
                    }
                }
            }
            echo "\t\t\t\t\t</select></td>\r\n                    \t</tr>\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<td class=\"shop\" align=\"right\">Op&ccedil;&otilde;es Liberadas:</td>\r\n\t\t\t\t\t\t\t<td><input type=\"checkbox\" value=\"1\" name=\"level\" id=\"level\"";
            echo $opcao[0];
            echo ">Level<br>\r\n                                <input type=\"checkbox\" value=\"1\" name=\"adicional\" id=\"adicional\"";
            echo $opcao[1];
            echo ">Adicional<br>\r\n                                <input type=\"checkbox\" value=\"1\" name=\"luck\" id=\"luck\"";
            echo $opcao[2];
            echo ">Luck<br>\r\n                                <input type=\"checkbox\" value=\"1\" name=\"skill\" id=\"skill\"";
            echo $opcao[3];
            echo ">Skill<br>\r\n                                <input type=\"checkbox\" value=\"1\" name=\"opcao\" id=\"opcao\"";
            echo $opcao[4];
            echo ">Op&ccedil;&otilde;es Excelentes<br>\r\n                                <input type=\"checkbox\" value=\"1\" name=\"full\" id=\"full\"";
            echo $opcao[5];
            echo ">Item Full\r\n                            </td>\r\n\t\t\t\t\t\t\t<td align=\"left\" class=\"shop\" colspan=\"2\" rowspan=\"2\">\r\n                                Pre&ccedil;o Level:<br>\r\n                                <input type=\"text\" maxlength=\"4\" id=\"plevel\" name=\"plevel\" style=\"width: 90px;\" value=\"";
            echo $precos[0];
            echo "\"><br>\r\n                                Pre&ccedil;o Adicional:<br>\r\n                                <input type=\"text\" maxlength=\"4\" id=\"padicional\" name=\"padicional\" style=\"width: 90px;\" value=\"";
            echo $precos[1];
            echo "\"><br>\r\n                                Pre&ccedil;o Luck:<br>\r\n                                <input type=\"text\" maxlength=\"4\" id=\"pluck\" name=\"pluck\" style=\"width: 90px;\" value=\"";
            echo $precos[2];
            echo "\"><br>\r\n                                Pre&ccedil;o Skill:<br>\r\n                                 <input type=\"text\" maxlength=\"4\" id=\"pskill\" name=\"pskill\" style=\"width: 90px;\" value=\"";
            echo $precos[3];
            echo "\"><br>\r\n                                Pre&ccedil;o Opcional:<br>\r\n                                <input type=\"text\" maxlength=\"4\" id=\"popcao\" name=\"popcao\" style=\"width: 90px;\" value=\"";
            echo $precos[4];
            echo "\"><br>\r\n                            </td>\r\n\t\t\t\t\t\t</tr>\r\n                        <tr>\r\n\t\t\t\t\t\t\t<td class=\"shop\" align=\"right\">Promo&ccedil;&atilde;o:</td>\r\n\t\t\t\t\t\t\t<td><input type=\"checkbox\" value=\"1\" name=\"promocao\" id=\"promocao\"";
            echo $promocao;
            echo "> Promo&ccedil;&atilde;o</td>\r\n\t\t\t\t\t\t</tr>\r\n                        <tr>\r\n                        \t<td class=\"shop\" valign=\"top\" align=\"right\">Pre&ccedil;o:</td>\r\n\t\t\t\t\t\t\t<td><input type=\"text\" maxlength=\"4\" id=\"preco\" name=\"preco\" style=\"width: 40px;\" value=\"";
            echo $info[3];
            echo "\"> Gold(s)</td>\r\n                    \t\t<td align=\"left\" valign=\"top\" colspan=\"2\" rowspan=\"5\"><input type=\"hidden\" id=\"foto\" name=\"foto\" value=\"";
            echo $info[9];
            echo "\">\r\n                            \t<input type=\"hidden\" id=\"mini\" name=\"mini\" value=\"";
            echo $info[8];
            echo "\">\r\n                            \t<input type=\"hidden\" id=\"i_foto\" name=\"i_foto\" value=\"";
            echo $info[9];
            echo "\">\r\n\t\t\t\t\t\t\t\t<script language=\"JavaScript\">\r\n\t\t\t\t\t\t\t\t\t<!--\r\n\t\t\t\t\t\t\t\t\t//hide me\r\n\t\t\t\t\t\t\t\t\tif (document.images) {\r\n\t\t\t\t\t\t\t\t\t\tspecbut2On = new Image();\r\n\t\t\t\t\t\t\t\t\t\tspecbut2On.src = \"images/en/buttons/procuraro.gif\";\r\n\t\t\t\t\t\t\t\t\t\tspecbut2Off = new Image();\r\n\t\t\t\t\t\t\t\t\t\tspecbut2Off.src = \"images/en/buttons/procurar.gif\";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t//-->\r\n\t\t\t\t\t\t\t\t\t</script>\r\n\t\t\t\t\t\t\t\t\t<a href=\"javascript:;\" onClick=\"BuscaImagem();\" onMouseOver='ShowHide(\"specbut2\",\"specbut2On\");' onMouseOut='ShowHide(\"specbut2\",\"specbut2Off\")'><img src=\"images/en/buttons/procurar.gif\" Array border=\"0\" name=\"specbut2\"></a><br />\r\n                                    <span id=\"produto\" style=\"height: 182px;\"><img src=\"";
            echo $info[8];
            echo "\" /></span>\r\n                            </td>\r\n                        </tr>\r\n                       <tr>\r\n                        \t<td align=\"center\" class=\"shop\" valign=\"top\">Status Produto</td>\r\n                        \t<td valign=\"top\">\r\n                            \t<input type=\"radio\" name=\"status\" id=\"status\" value=\"0\"";
            echo $stats[1];
            echo "> Desativado \r\n                            \t<input type=\"radio\" name=\"status\" id=\"status\" value=\"1\"";
            echo $stats[0];
            echo "> Ativado \r\n                            </td>\r\n                       </tr>\r\n                       <tr>\r\n                       \t\t<td class=\"shop\" valign=\"top\" align=\"right\">Comprado:</td>\r\n\t\t\t\t\t\t\t<td><input type=\"text\" maxlength=\"4\" id=\"comprado\" name=\"comprado\" style=\"width: 40px;\" value=\"";
            echo $info[4];
            echo "\"> Vez(es)</td>\r\n                       </td>\r\n                        <tr>\r\n                       \t\t<td align=\"center\" class=\"shop\" valign=\"top\" colspan=\"2\">\r\n                       </td>\r\n                       <tr>\r\n                       \t\t<td align=\"center\" class=\"shop\" valign=\"top\" colspan=\"2\">\r\n                       </td>\r\n                       <tr>\r\n                       \t\t<td align=\"center\" class=\"shop\" valign=\"top\" colspan=\"2\">\r\n                       </td>\r\n                       <tr>\r\n                        \t<td align=\"center\" class=\"shop\" valign=\"top\" colspan=\"4\">\r\n\t\t\t\t\t\t\t\t<script language=\"JavaScript\">\r\n\t\t\t\t\t\t\t\t\t<!--\r\n\t\t\t\t\t\t\t\t\t//hide me\r\n\t\t\t\t\t\t\t\t\tif (document.images) {\r\n\t\t\t\t\t\t\t\t\tspecbut1On = new Image();\r\n\t\t\t\t\t\t\t\t\tspecbut1On.src = \"images/en/buttons/altitemo.gif\";\r\n\t\t\t\t\t\t\t\t\tspecbut1Off = new Image();\r\n\t\t\t\t\t\t\t\t\tspecbut1Off.src = \"images/en/buttons/altitem.gif\";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t//-->\r\n\t\t\t\t\t\t\t\t\t</script>\r\n\t\t\t\t\t\t\t\t\t<a href=\"#\" onClick=\"document.form1.submit(); return false;\" onMouseOver='ShowHide(\"specbut1\",\"specbut1On\");' onMouseOut='ShowHide(\"specbut1\",\"specbut1Off\")'><img src=\"images/en/buttons/altitem.gif\" Array border=\"0\" name=\"specbut1\"></a>\r\n                            </td>\r\n                       </tr>\r\n\t\t\t\t\t</table>\r\n                        ";
        }
        echo "                    </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    ";
    }
    if ( $id == false && $go == true )
    {
        $id = $_POST['itemid'];
        $categoria = $_POST['Categoria'];
        $subcategoria = $_POST['SubCategoria'];
        $nome = $_POST['nome'];
        $level = $_POST['level'];
        $adicional = $_POST['adicional'];
        $luck = $_POST['luck'];
        $skill = $_POST['skill'];
        $opcao = $_POST['opcao'];
        $full = $_POST['full'];
        $plevel = $_POST['plevel'];
        $padicional = $_POST['padicional'];
        $pluck = $_POST['pluck'];
        $pskill = $_POST['pskill'];
        $popcao = $_POST['popcao'];
        $promocao = $_POST['promocao'];
        $foto = $_POST['foto'];
        $mini = $_POST['mini'];
        $preco = $_POST['preco'];
        $status = $_POST['status'];
        $comprado = $_POST['comprado'];
        $check->checacampobranco( $nome, "Nome" );
        $check->checacampobranco( $foto, "Foto" );
        $check->checacampobranco( $mini, "Mini Foto" );
        $check->checanumeropositivo( $categoria, "Categoria" );
        $check->checanumeropositivo( $subcategoria, "SubCategoria" );
        $check->checanumeropositivo( $plevel, "Preco do Level" );
        $check->checanumeropositivo( $padicional, "Preco do Adicional" );
        $check->checanumeropositivo( $pluck, "Preco do Luck" );
        $check->checanumeropositivo( $pskill, "Preco do Skill" );
        $check->checanumeropositivo( $popcao, "Preco do Opcional" );
        $check->checanumeropositivo( $preco, "Preco" );
        $check->checanumeropositivo( $comprado, "Comprado" );
        if ( empty( $level ) )
        {
            $level = 0;
        }
        if ( empty( $adicional ) )
        {
            $adicional = 0;
        }
        if ( empty( $luck ) )
        {
            $luck = 0;
        }
        if ( empty( $skill ) )
        {
            $skill = 0;
        }
        if ( empty( $opcao ) )
        {
            $opcao = 0;
        }
        if ( empty( $full ) )
        {
            $full = 0;
        }
        if ( empty( $promocao ) )
        {
            $promocao = 0;
        }
        if ( empty( $status ) )
        {
            $status = 0;
        }
        if ( empty( $level_item ) )
        {
            $level_item = 0;
        }
        $sql->executaalteraritemshop( $id, $nome, $preco, $categoria, $subcategoria, $mini, $foto, $promocao, $status, $level, $adicional, $skill, $luck, $opcao, $full, $level_item, $plevel, $padicional, $pskill, $pluck, $popcao, $comprado );
    }
}
if ( $action == "remover" )
{
    $sql->query( "SELECT Id, Nome, Preco, Comprado, Categoria, SubCategoria, Opcoes, Promocao, MiniFoto, Foto FROM SITE_SHOPITEM, SITE_SHOPINFORMACOES WHERE Id=ItemID" );
    if ( $id == false && $go == false )
    {
        echo "<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\">Remover Item Shop</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\"><!--<img src=\"images/spacer.gif\" width=\"100\" height=\"5\">-->\r\n                \t\t<table width=\"100%\" cellpadding=\"5\">\r\n                        <tr>\r\n                          <td colspan=\"8\" class=\"infotitulo\">Shop</td>\r\n                        </tr>\r\n\t\t\t\t\t\t<tr class=\"downtitulo\">\r\n\t\t\t\t\t\t\t<td>#ID</td>\r\n\t\t\t\t\t\t\t<td>Nome</td>\r\n\t\t\t\t\t\t\t<td>Preco</td>\r\n\t\t\t\t\t\t\t<td>Comprado</td>\r\n                            <td>A&ccedil;&atilde;o</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t";
        while ( $info = $sql->row( ) )
        {
            ++$x;
            if ( $x % 2 == 0 )
            {
                $estilo = "down2";
            }
            else
            {
                $estilo = "down1";
            }
            $sql->query( "SELECT Categoria FROM SITE_SHOPCATEGORIAS WHERE Id='".$info[4]."'" );
            $categoria = $sql->row( );
            $categoria = $categoria[0];
            $sql->query( "SELECT Sub FROM SITE_SHOPSUBCATEGORIAS WHERE Numero='".$info[5]."'" );
            $subcategoria = $sql->row( );
            $subcategoria = $subcategoria[0];
            $sql->query( "SELECT Level, Adicional, Skill, Luck, Opcional, [Full] FROM SITE_SHOPOPCOES WHERE Id='".$info[6]."'" );
            $opcoes = $sql->row( );
            echo "                            <form name=\"form";
            echo $x;
            echo "\" action=\"\" method=\"post\">\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[0];
            echo "</td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\"><a href=\"javascript:;\" onmouseover=\"Tip('<table><tr><td>Categoria: ";
            echo $categoria;
            echo "<br>SubCategoria: ";
            echo $subcategoria;
            echo "<br>Customizar Level: ";
            echo $check->simounao( $opcoes[0] );
            echo "<br>Customizar Adicional: ";
            echo $check->simounao( $opcoes[0] );
            echo "<br>Customizar Skill: ";
            echo $check->simounao( $opcoes[1] );
            echo "<br>Customizar Luck: ";
            echo $check->simounao( $opcoes[2] );
            echo "<br>Customizar Opcional: ";
            echo $check->simounao( $opcoes[3] );
            echo "<br>Full: ";
            echo $check->simounao( $opcoes[4] );
            echo "<br>Promocao: ";
            echo $check->simounao( $info[7] );
            echo "</td><td><img src=\\'";
            echo $info[8];
            echo "\\'></td></tr></table>')\" class=\"down\">";
            echo $info[1];
            echo "</a></td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[2];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[3];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"javascript:;\" onClick=\"javascript:RemoverShop('";
            echo $info[0];
            echo "')\">Remover</a></td>\r\n                        </tr>\r\n                        \t</form>\r\n\t\t\t\t\t\t\t";
        }
        echo "\t\t\t\t\t\t</table>\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";
    }
    if ( $id == true )
    {
        $id = $_GET['id'];
        $check->checanumeropositivo( $id, "Id" );
        $sql->verificaidshop( $id, 1 );
        $sql->executaremoveritemshop( $id );
    }
}
if ( $action == "informacoes" )
{
    $sql->query( "SELECT Id, Nome, Preco, Comprado, Categoria, SubCategoria, Opcoes, Promocao, MiniFoto, Foto FROM SITE_SHOPITEM, SITE_SHOPINFORMACOES WHERE Id=ItemID" );
    if ( $id == false )
    {
        echo "<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\">Informa&ccedil;&otilde;es Item Shop</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\"><!--<img src=\"images/spacer.gif\" width=\"100\" height=\"5\">-->\r\n                \t\t<table width=\"100%\" cellpadding=\"5\">\r\n                        <tr>\r\n                          <td colspan=\"8\" class=\"infotitulo\">Shop</td>\r\n                        </tr>\r\n\t\t\t\t\t\t<tr class=\"downtitulo\">\r\n\t\t\t\t\t\t\t<td>#ID</td>\r\n\t\t\t\t\t\t\t<td>Nome</td>\r\n\t\t\t\t\t\t\t<td>Preco</td>\r\n\t\t\t\t\t\t\t<td>Comprado</td>\r\n                            <td>A&ccedil;&atilde;o</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t";
        while ( $info = $sql->row( ) )
        {
            ++$x;
            if ( $x % 2 == 0 )
            {
                $estilo = "down2";
            }
            else
            {
                $estilo = "down1";
            }
            $sql->query( "SELECT Categoria FROM SITE_SHOPCATEGORIAS WHERE Id='".$info[4]."'" );
            $categoria = $sql->row( );
            $categoria = $categoria[0];
            $sql->query( "SELECT Sub FROM SITE_SHOPSUBCATEGORIAS WHERE Numero='".$info[5]."'" );
            $subcategoria = $sql->row( );
            $subcategoria = $subcategoria[0];
            $sql->query( "SELECT Level, Adicional, Skill, Luck, Opcional, [Full] FROM SITE_SHOPOPCOES WHERE Id='".$info[6]."'" );
            $opcoes = $sql->row( );
            echo "                            <form name=\"form";
            echo $x;
            echo "\" action=\"\" method=\"post\">\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[0];
            echo "</td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\"><a href=\"javascript:;\" onmouseover=\"Tip('<table><tr><td>Categoria: ";
            echo $categoria;
            echo "<br>SubCategoria: ";
            echo $subcategoria;
            echo "<br>Customizar Level: ";
            echo $check->simounao( $opcoes[0] );
            echo "<br>Customizar Adicional: ";
            echo $check->simounao( $opcoes[0] );
            echo "<br>Customizar Skill: ";
            echo $check->simounao( $opcoes[1] );
            echo "<br>Customizar Luck: ";
            echo $check->simounao( $opcoes[2] );
            echo "<br>Customizar Opcional: ";
            echo $check->simounao( $opcoes[3] );
            echo "<br>Full: ";
            echo $check->simounao( $opcoes[4] );
            echo "<br>Promocao: ";
            echo $check->simounao( $info[7] );
            echo "</td><td><img src=\\'";
            echo $info[8];
            echo "\\'></td></tr></table>')\" class=\"down\">";
            echo $info[1];
            echo "</a></td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[2];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[3];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"javascript:;\" onClick=\"javascript:location='?page=shop&action=informacoes&id=";
            echo $info[0];
            echo "'\">Informa&ccedil;&otilde;es</a></td>\r\n                        </tr>\r\n                        \t</form>\r\n\t\t\t\t\t\t\t";
        }
        echo "\t\t\t\t\t\t</table>\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";
    }
    if ( $id == true )
    {
        $id = $_GET['id'];
        $check->checanumeropositivo( $id, "Id" );
        $sql->verificaidshop( $id, 1 );
        $sql->query( "SELECT Nome, Preco, Comprado, Categoria, SubCategoria, Opcoes, Precos, Promocao, MiniFoto, Foto FROM SITE_SHOPITEM, SITE_SHOPINFORMACOES WHERE Id=ItemID AND Id='".$id."'" );
        while ( $info = $sql->row( ) )
        {
            $sql->query( "SELECT Categoria FROM SITE_SHOPCATEGORIAS WHERE Id='".$info[3]."'" );
            $categoria = $sql->row( );
            $categoria = $categoria[0];
            $sql->query( "SELECT Sub FROM SITE_SHOPSUBCATEGORIAS WHERE Numero='".$info[4]."'" );
            $subcategoria = $sql->row( );
            $subcategoria = $subcategoria[0];
            $sql->query( "SELECT Level, Adicional, Skill, Luck, Opcional, [Full] FROM SITE_SHOPOPCOES WHERE Id='".$info[5]."'" );
            $opcoes = $sql->row( );
            $sql->query( "SELECT Level, Adicional, Skill, Luck, Opcional FROM SITE_SHOPPRECOS WHERE Id='".$info[6]."'" );
            $precos = $sql->row( );
            echo "<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\">Informa&ccedil;&otilde;es Item Shop</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\"><!--<img src=\"images/spacer.gif\" width=\"100\" height=\"5\">-->\r\n                \t\t<table width=\"100%\" cellpadding=\"5\">\r\n                            <tr>\r\n                              <td colspan=\"2\" class=\"infotitulo\">Informa&ccedil;&atilde;o do Item do Shop</td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td class=\"infodown\" align=\"right\" width=\"35%\"><b>#ID:</b></td>\r\n                                <td class=\"infodown\">";
            echo $id;
            echo "</td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td class=\"infodown2\" align=\"right\"><b>Nome:</b></td>\r\n                                <td class=\"infodown2\">";
            echo $info[0];
            echo "</td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td class=\"infodown\" align=\"right\" width=\"35%\"><b>Categoria:</b></td>\r\n                                <td class=\"infodown\">";
            echo $categoria;
            echo "</a></td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td class=\"infodown2\" align=\"right\" width=\"35%\"><b>SubCategoria:</b></td>\r\n                                <td class=\"infodown2\">";
            echo $subcategoria;
            echo "</td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td class=\"infodown\" align=\"right\"><b>Pre&ccedil;o:</b></td>\r\n                                <td class=\"infodown\">";
            echo $info[1];
            echo " golds</td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td class=\"infodown2\" align=\"right\"><b>Comprado:</b></td>\r\n                                <td class=\"infodown2\">";
            echo $info[2];
            echo " vezes</td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td class=\"infodown\" align=\"right\" width=\"35%\"><b>Promocao:</b></td>\r\n                                <td class=\"infodown\">";
            echo $check->simounao( $info[7] );
            echo "</td>\r\n                            </tr>   \r\n                            <tr>\r\n                                <td class=\"infodown2\" align=\"right\"><b>Customizar Level:</b></td>\r\n                                <td class=\"infodown2\">";
            echo $check->simounao( $opcoes[0] );
            echo " - ";
            echo $precos[0];
            echo " golds</td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td class=\"infodown\" align=\"right\"><b>Customizar Adicional:</b></td>\r\n                                <td class=\"infodown\">";
            echo $check->simounao( $opcoes[1] );
            echo " - ";
            echo $precos[1];
            echo " golds</td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td class=\"infodown2\" align=\"right\"><b>Customizar Skill:</b></td>\r\n                                <td class=\"infodown2\">";
            echo $check->simounao( $opcoes[2] );
            echo " - ";
            echo $precos[2];
            echo " golds</td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td class=\"infodown\" align=\"right\"><b>Customizar Luck:</b></td>\r\n                                <td class=\"infodown\">";
            echo $check->simounao( $opcoes[3] );
            echo " - ";
            echo $precos[3];
            echo " golds</td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td class=\"infodown2\" align=\"right\"><b>Customizar Opcional:</b></td>\r\n                                <td class=\"infodown2\">";
            echo $check->simounao( $opcoes[4] );
            echo " - ";
            echo $precos[4];
            echo " golds</td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td class=\"infodown\" align=\"right\"><b>Full:</b></td>\r\n                                <td class=\"infodown\">";
            echo $check->simounao( $opcoes[5] );
            echo "</td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td class=\"infodown2\" align=\"right\" width=\"35%\"><b>Imagens:</b></td>\r\n                                <td class=\"infodown2\"><a href=\"javascript:;\" onmouseover=\"Tip('<img src=\\'";
            echo $info[9];
            echo "\\'')\"><img src=\"";
            echo $info[8];
            echo "\" border=\"0\"></a></td>\r\n                            </tr>\r\n                            <tr>\r\n                            \t<td class=\"infodown\" align=\"center\" colspan=\"2\">\t\t\t\t\t\t\t\t<script language=\"JavaScript\">\r\n\t\t\t\t\t\t\t\t\t<!--\r\n\t\t\t\t\t\t\t\t\t//hide me\r\n\t\t\t\t\t\t\t\t\tif (document.images) {\r\n\t\t\t\t\t\t\t\t\t\tspecbut1On = new Image();\r\n\t\t\t\t\t\t\t\t\t\tspecbut1On.src = \"images/en/buttons/altitemo.gif\";\r\n\t\t\t\t\t\t\t\t\t\tspecbut1Off = new Image();\r\n\t\t\t\t\t\t\t\t\t\tspecbut1Off.src = \"images/en/buttons/altitem.gif\";\r\n\t\t\t\t\t\t\t\t\t\tspecbut2On = new Image();\r\n\t\t\t\t\t\t\t\t\t\tspecbut2On.src = \"images/en/buttons/remitemo.gif\";\r\n\t\t\t\t\t\t\t\t\t\tspecbut2Off = new Image();\r\n\t\t\t\t\t\t\t\t\t\tspecbut2Off.src = \"images/en/buttons/remitem.gif\";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t//-->\r\n\t\t\t\t\t\t\t\t\t</script>\r\n\t\t\t\t\t\t\t\t\t<a href=\"#\" onClick=\"javascript:location = 'index.php?page=shop&action=alterar&id=";
            echo $id;
            echo "';\" onMouseOver='ShowHide(\"specbut1\",\"specbut1On\");' onMouseOut='ShowHide(\"specbut1\",\"specbut1Off\")'><img src=\"images/en/buttons/altitem.gif\" Array border=\"0\" name=\"specbut1\"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n                                    <a href=\"#\" onClick=\"javascript:RemoverShop('";
            echo $info[0];
            echo "');\" onMouseOver='ShowHide(\"specbut2\",\"specbut2On\");' onMouseOut='ShowHide(\"specbut2\",\"specbut2Off\")'><img src=\"images/en/buttons/remitem.gif\" Array border=\"0\" name=\"specbut1\"></a></td>\r\n                            </tr>\r\n\t\t\t\t\t\t</table>\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        ";
        }
    }
}
?>
