Admin CP Adding new Grades.

Results 1 to 5 of 5
  1. #1
    Account Upgraded | Title Enabled! randy1234 is offline
    MemberRank
    Mar 2009 Join Date
    SingaporeLocation
    1,196Posts

    ! Admin CP Adding new Grades.

    i have edited my accounts.php

    in the admin cp so that i can set the user to event winner in cp( yes i know there is a command but i wana add to the cp too)


    but when i try to set my user to event winner it says Invaild Grade

    Code:
    <?php
        if( !ereg("index.php", $_SERVER['PHP_SELF']) )
        {
            header("Location: index.php");
            die();
        }
    
        showmessage();
    
        if( isset($_POST['changeuserid']) )
        {
            $type = clean_sql($_POST['type']);
            $id = clean_sql($_POST['id']);
            $nuserid = clean_sql($_POST['nuserid']);
    
            if( $type == "" || $id == "" || $nuserid == "" )
            {
                setmessage("UserID Change", $_STR[Msg1]);
                redirect("index.php?do=accounts");
                die();
            }
    
            $query01 = odbc_exec($connection, "SELECT AID FROM {$_CONFIG[AccountTable]}(nolock) WHERE UserID = '$nuserid'");
            if( num_rows($query01) != 0 )
            {
                setmessage("UserID Change", sprintf($_STR[Acc15], $nuserid));
                redirect("index.php?do=accounts");
                die();
            }
    
            if( $type == 0 )
            {
                $query02 = odbc_exec($connection, "SELECT AID FROM {$_CONFIG[AccountTable]}(nolock) WHERE UserID = '$id'");
                $part = "UserID";
            }
            elseif( $type == 1 )
            {
                $query02 = odbc_exec($connection, "SELECT UserID FROM {$_CONFIG[AccountTable]}(nolock) WHERE AID = '$id'");
                $part = "AID";
            }
            else
            {
                redirect("index.php?do=accounts");
                die();
            }
    
            if( num_rows($query02) != 1 )
            {
                setmessage("UserID Change", $_STR[Acc16]);
                redirect("index.php?do=accounts");
                die();
            }
            else
            {
                odbc_exec($connection, "UPDATE {$_CONFIG[AccountTable]} SET UserID = '$nuserid' WHERE $part = '$id'");
                writetolog( sprintf($_STR[Log0], $part, $id, $nuserid) );
                setmessage("UserID Change", $_STR[Acc17]);
                redirect("index.php?do=accounts");
                die();
            }
        }
        elseif( isset($_POST['changepassword']) )
        {
            $type = clean_sql($_POST['type']);
            $id = clean_sql($_POST['id']);
            $passw = clean_sql($_POST['npassw']);
    
            if( $type == "" || $id == "" || $passw == "" )
            {
                setmessage("Password Change", $_STR[Msg1]);
                redirect("index.php?do=accounts");
                die();
            }
    
            if( $type == 0 )
            {
                $query02 = odbc_exec($connection, "SELECT AID FROM {$_CONFIG[AccountTable]}(nolock) WHERE UserID = '$id'");
                $part = "UserID";
            }
            elseif( $type == 1 )
            {
                $query02 = odbc_exec($connection, "SELECT UserID FROM {$_CONFIG[AccountTable]}(nolock) WHERE AID = '$id'");
                $part = "AID";
            }
            else
            {
                redirect("index.php?do=accounts");
                die();
            }
    
            if( num_rows($query02) != 1 )
            {
                setmessage("Password Change", $_STR[Acc16]);
                redirect("index.php?do=accounts");
                die();
            }
            else
            {
                odbc_exec($connection, "UPDATE {$_CONFIG[LoginTable]} SET Password = '$passw' WHERE $part = '$id'");
                writetolog( sprintf($_STR[Log1], $part, $id, $passw) );
                setmessage("Password Change", $_STR[Acc18]);
                redirect("index.php?do=accounts");
                die();
            }
        }
        elseif( isset($_POST['changeugradeid']) )
        {
            $type = clean_sql($_POST['type']);
            $id = clean_sql($_POST['id']);
            $rank = clean_sql($_POST['rank']);
    
            if($rank != 253 && $rank != 0 && $rank != 252 && $rank != 254 && $rank != 255)
            {
                setmessage("Rank Change", "Invalid Rank");
                redirect("index.php?do=accounts");
                die();
            }
    
            if( $type == "" || $id == "" || $rank == "" )
            {
                setmessage("Rank Change", $_STR[Msg1]);
                redirect("index.php?do=accounts");
                die();
            }
    
            if( $type == 0 )
            {
                $query02 = odbc_exec($connection, "SELECT AID FROM {$_CONFIG[AccountTable]}(nolock) WHERE UserID = '$id'");
                $part = "UserID";
            }
            elseif( $type == 1 )
            {
                $query02 = odbc_exec($connection, "SELECT UserID FROM {$_CONFIG[AccountTable]}(nolock) WHERE AID = '$id'");
                $part = "AID";
            }
            elseif( $type == 2 )
            {
                $query02 = odbc_exec($connection, "SELECT AID FROM {$_CONFIG[CharTable]}(nolock) WHERE Name = '$id'");
                if( num_rows($query02) != 1 )
                {
                    setmessage("Rank Change", $_STR[Acc16]);
                    redirect("index.php?do=accounts");
                    die();
                }
                else
                {
                    odbc_fetch_row($query02);
                    $id = odbc_result($query02, 1);
                    $part = "AID";
                }
            }
            else
            {
                redirect("index.php?do=accounts");
                die();
            }
    
            if( $type != 2 && num_rows($query02) != 1 )
            {
                setmessage("Rank Change", $_STR[Acc16]);
                redirect("index.php?do=accounts");
                die();
            }
            else
            {
                odbc_exec($connection, "UPDATE {$_CONFIG[AccountTable]} SET UgradeID = '$rank' WHERE $part = '$id'");
                writetolog( sprintf($_STR[Log2], $part, $id, $rank) );
                setmessage("Rank Change", $_STR[Acc19]);
                redirect("index.php?do=accounts");
                die();
            }
        }
        elseif( isset($_POST['sendallstorage']) )
        {
            $itemid = clean_sql($_POST['itemid']);
            $rentperiod = clean_sql($_POST['rentperiod']);
    
            if($rentperiod == "")
                $rentperiod = 0;
    
            if( !is_numeric($itemid) || !is_numeric($rentperiod) )
            {
                setmessage("Send Item", $_STR[Acc20]);
                redirect("index.php?do=accounts");
                die();
            }
    
            if($rentperiod == 0)
            {
                odbc_exec($connection, "
                            INSERT INTO {$_CONFIG[AItemTable]} (AID, ItemID, RentDate, cnt)
                            (SELECT ac.AID, '$itemid', GETDATE(), 1 FROM {$_CONFIG[AccountTable]}(nolock) ac)");
            }
            else
            {
                $rentperiod = $rentperiod*24;
                odbc_exec($connection, "
                            INSERT INTO {$_CONFIG[AItemTable]} (AID, ItemID, RentDate, RentHourPeriod, cnt)
                            (SELECT ac.AID, '$itemid', GETDATE(), '$rentperiod', 1 FROM {$_CONFIG[AccountTable]}(nolock) ac)");
            }
                writetolog( sprintf($_STR[Log3], $itemid) );
                setmessage("Send Item", $_STR[Acc21]);
                redirect("index.php?do=accounts");
                die();
    
        }
        elseif( isset($_POST['sendstorage']) )
        {
            $type = clean_sql($_POST['type']);
            $id = clean_sql($_POST['id']);
            $itemid = clean_sql($_POST['itemid']);
            $rentperiod = clean_sql($_POST['rentperiod']);
    
            if($rentperiod == "")
                $rentperiod = 0;
    
            if( !is_numeric($itemid) || !is_numeric($rentperiod) )
            {
                setmessage("Send Item", $_STR[Acc20]);
                redirect("index.php?do=accounts");
                die();
            }
    
            if( $type == 0 )
            {
                $query02 = odbc_exec($connection, "SELECT AID FROM {$_CONFIG[AccountTable]}(nolock) WHERE UserID = '$id'");
            }
            elseif( $type == 1 )
            {
                $query02 = odbc_exec($connection, "SELECT UserID FROM {$_CONFIG[AccountTable]}(nolock) WHERE AID = '$id'");
            }
            else
            {
                redirect("index.php?do=accounts");
                die();
            }
    
            if( num_rows($query02) != 1 )
            {
                setmessage("Send Item", $_STR[Acc16]);
                redirect("index.php?do=accounts");
                die();
            }
            else
            {
                if( $type == 0 )
                {
                    odbc_fetch_row($query02);
                    $id = odbc_result($query02, 1);
                }
    
                if($rentperiod == 0)
                {
                    odbc_exec($connection, "
                                INSERT INTO {$_CONFIG[AItemTable]} (AID, ItemID, RentDate, cnt)
                                VALUES('$id', '$itemid', GETDATE(), 1)");
                }
                else
                {
                    $rentperiod = $rentperiod*24;
                    odbc_exec($connection, "
                                INSERT INTO {$_CONFIG[AItemTable]} (AID, ItemID, RentDate, RentHourPeriod, cnt)
                                VALUES('$id', '$itemid', GETDATE(), '$rentperiod', 1)");
                }
    
                writetolog( sprintf($_STR[Log4], $itemid, $id) );
                setmessage("Send Item", $_STR[Acc22]);
                redirect("index.php?do=accounts");
                die();
            }
    
    
    
        }
    ?>
    
    <table border="1" style="border-collapse: collapse" id="changeuserid">
    <tr><td colspan="2"><b><?php echo $_STR[Acc0]; ?></b></td></tr>
    <tr><td colspan="2">&nbsp;</td></tr>
    <form method="post" action="index.php?do=accounts">
    <tr>
        <td>
        <select name="type">
            <option value="0">UserID</option>
            <option value="1">AID</option>
        </select>:&nbsp;&nbsp;<input type="text" name="id" />&nbsp;&nbsp;<?php echo $_STR[Acc1]; ?>:&nbsp;&nbsp;<input type="text" name="nuserid" />
        &nbsp;&nbsp;<input type="submit" name="changeuserid" value="<?php echo $_STR[Acc2]; ?>" />
        </td>
    </tr>
    <tr><td colspan="2">&nbsp;</td></tr>
    </form>
    </table>
    <br />
    <table border="1" style="border-collapse: collapse" id="changepassword">
    <tr><td colspan="2"><b><?php echo $_STR[Acc3]; ?></b></td></tr>
    <tr><td colspan="2">&nbsp;</td></tr>
    <form method="post" action="index.php?do=accounts">
    <tr>
        <td>
        <select name="type">
            <option value="0">UserID</option>
            <option value="1">AID</option>
        </select>:&nbsp;&nbsp;<input type="text" name="id" />&nbsp;&nbsp;<?php echo $_STR[Acc4]; ?>:&nbsp;&nbsp;<input type="text" name="npassw" />
        &nbsp;&nbsp;<input type="submit" name="changepassword" value="<?php echo $_STR[Acc2]; ?>" />
        </td>
    </tr>
    <tr><td colspan="2">&nbsp;</td></tr>
    </form>
    </table>
    <br />
    <table border="1" style="border-collapse: collapse" id="changeugradeid">
    <tr><td colspan="2"><b><?php echo $_STR[Acc5]; ?></b></td></tr>
    <tr><td colspan="2">&nbsp;</td></tr>
    <form method="post" action="index.php?do=accounts">
    <tr>
        <td>
        <select name="type">
            <option value="0">UserID</option>
            <option value="1">AID</option>
            <option value="2"><?php echo $_STR[Search7];?></option>
        </select>:&nbsp;&nbsp;<input type="text" name="id" />&nbsp;&nbsp;
        <select name="rank">
            <option value="253"><?php echo $_STR[Acc6];?></option>
            <option value="0"><?php echo $_STR[Acc7];?></option>
            <option value="252"><?php echo $_STR[Acc8];?></option>
            <option value="254"><?php echo $_STR[Acc9];?></option>
            <option value="255"><?php echo $_STR[Acc10];?></option>
            <option value="104">Muted</option>
            <option value="2">Event Winner</option>( This is what i added) 
        </select>
        &nbsp;&nbsp;<input type="submit" name="changeugradeid" value="<?php echo $_STR[Acc2]; ?>" />
        </td>
    </tr>
    <tr><td colspan="2">&nbsp;</td></tr>
    </form>
    </table>
    <br />
    <table border="1" style="border-collapse: collapse" id="sendallstorage">
    <tr><td colspan="2"><b><?php echo $_STR[Acc11]; ?></b></td></tr>
    <tr><td colspan="2">&nbsp;</td></tr>
    <form method="post" action="index.php?do=accounts">
    <tr>
        <td>
        ItemID:&nbsp;&nbsp;<input type="text" name="itemid" />&nbsp;&nbsp;<?php echo $_STR[Acc12]; ?>:&nbsp;&nbsp;<input type="text" name="rentperiod" />
        &nbsp;&nbsp;<input type="submit" name="sendallstorage" value="<?php echo $_STR[Acc14]; ?>" />
        </td>
    </tr>
    <tr><td colspan="2">&nbsp;</td></tr>
    </form>
    </table>
    <br />
    <table border="1" style="border-collapse: collapse" id="sendstorage">
    <tr><td colspan="2"><b><?php echo $_STR[Acc13]; ?></b></td></tr>
    <tr><td colspan="2">&nbsp;</td></tr>
    <form method="post" action="index.php?do=accounts">
    <tr>
        <td>
        <select name="type">
            <option value="0">UserID</option>
            <option value="1">AID</option>
        </select>
        :&nbsp;&nbsp;<input type="text" name="id" />
        ItemID:&nbsp;&nbsp;<input type="text" name="itemid" /><br /><br /><?php echo $_STR[Acc12]; ?>:&nbsp;&nbsp;<input type="text" name="rentperiod" />
        &nbsp;&nbsp;<input type="submit" name="sendstorage" value="<?php echo $_STR[Acc14]; ?>" />
        </td>
    </tr>
    <tr><td colspan="2">&nbsp;</td></tr>
    </form>
    </table>
    <br /><br />
    Last edited by randy1234; 12-06-10 at 09:49 AM.


  2. #2
    Account Upgraded | Title Enabled! 00niels00 is offline
    MemberRank
    Sep 2008 Join Date
    The NetherlandsLocation
    1,041Posts

    Re: Admin CP Adding new Grades.

    PHP Code:
            if($rank != 253 && $rank != && $rank != 252 && $rank != 254 && $rank != 255
    change to:
    PHP Code:
            if($rank != 253 && $rank != && $rank != 252 && $rank != 254 && $rank != 255 && $rank != 2

  3. #3
    ★ Nick ★ fenixdoido is offline
    MemberRank
    Nov 2008 Join Date
    BrazilLocation
    243Posts

    Re: Admin CP Adding new Grades.

    Look at my ..
    My version of the Admin CP is the former ..
    Because of a problem to 'Version 3' does not work for me +_+


    PHP Code:
        <select name="lvlnumber" style=" background-color:#2A3F55; color:#A0A0A4">
           <option value="255">Administrador</option>
           <option value="254">Moderador</option>
           <option value="252">Moderador Invisivel</option>
           <option value="253">Banido</option>
           <option value="1">Test uGrade ID</option>
           <option value="0">Normal</option>
           <option value="2">Event Winner</option>
           <option value="3">Donator 1 (Roxo)</option>
           <option value="4">Donator 2 (Laranja)</option>
           <option value="5">Donator 3 (Verde)</option>
           <option value="6">Donator 4 (Roza Shoke)</option>
           <option value="7">Donator 5 (Amarelo)</option>
           <option value="8">Donator 6 (Vermelho)</option>
           <option value="9">Donator 7 (Rosa Barbie)</option>
           <option value="10">Donator 8 (Vermelhor Bosta)</option>
           <option value="104">Chat Block (Mutted)</option>
         </select>

         <input type="submit" name="Submit6" value="Mudar Rank" />
        </form>
        </td>
      </tr>
      <tr>
        <td>Resultados:
        <?php require 'config.php';
            if (
    $_GET['do'] == 'changeaccess')
    {
        
    $usuario sqlseguro($_POST['userlvl']);
        
    $nivel sqlseguro($_POST['lvlnumber']);
        if (
    valida($usuario) == true and valida($nivel) == true)
        {
            if (
    $nivel != and $nivel != 255 and $nivel != 254 and $nivel != 253 and $nivel != 252 and $nivel != and $nivel != and $nivel != and $nivel != and $nivel != and $nivel != and $nivel != and $nivel != and $nivel != and $nivel != 10 and $nivel != 104)
    Last edited by fenixdoido; 11-06-10 at 04:32 PM.

  4. #4
    Account Upgraded | Title Enabled! randy1234 is offline
    MemberRank
    Mar 2009 Join Date
    SingaporeLocation
    1,196Posts

    Re: Admin CP Adding new Grades.

    /Close Thread

  5. #5
    Doggie And Rice. Military is offline
    MemberRank
    Jun 2009 Join Date
    Here and AboutLocation
    3,302Posts

    Re: Admin CP Adding new Grades.

    close it your self.



Advertisement