Location: PHPKode > projects > EverQuest Roster/Gallery > html/includes/read_bank.php
<?
        /**********************************************************************************
        *                                                                                 *
        *                               read_bank.php                                     *
        *                            -------------------                                  *
        * File Started      : Saturday, Aug 03, 2002                                      *
        * Last Updated      : Sunday, Aug 04, 2002                                        *
        *                                                                                 *
        * Program           : EverQuest Roster/Gallery v1.6                               *
        * Copyright         : (C) 2001 - 2002 BladeTek Internet Services &                *
        *                                                     The EQRG Developement Team  *
        * Website           : http://eqrg.roleplayersinteraction.com                      *
        * Project Website   : http://www.sourceforge.net/projects/eqrostergallery         *
        * Email             : hide@address.com                                        *
        *                                                                                 *
        * For license information, please read the COPYING file which                     *
        * came with this edition                                                          *
        *                                                                                 *
        **********************************************************************************/

        function read_bank(&$bank) {

                        $query  = "select *";
                        $query .= "  from bank";
                        $query .= " where id = 1";

                        query_db($query, $bank);

                return $err;
        }

        function update_bank($vars) {
                global $SESSION;

                if ($SESSION["level"] != ADMIN) {
                        $err = ERR_NOT_ENOUGH_ACCESS;
                } else {
                        $temp = array_keys($vars);
                        $err = "";
                        $query = "";

                        if (eregi("[^[:digit:]]", $vars["plat"])) {
                                $err = "The Platinum field must be numeric.";
                        } elseif (eregi("[^[:digit:]]", $vars["gold"])) {
                                $err = "The Gold field must be numeric.";
                        } elseif (eregi("[^[:digit:]]", $vars["silv"])) {
                                $err = "The Silver field must be numeric.";
                        } elseif (eregi("[^[:digit:]]", $vars["copp"])) {
                                $err = "The Copper field must be numeric.";
                        } elseif ($vars["plat"] < 0) {
                                $err = "The Platinum field cannot be blank, It must have at least be zero (0).";
                        } elseif ($vars["gold"] < 0) {
                                $err = "The Gold field cannot be blank, It must have at least be zero (0).";
                        } elseif ($vars["silv"] < 0) {
                                $err = "The Silver field cannot be blank, It must have at least be zero (0).";
                        } elseif ($vars["copp"] < 0) {
                                $err = "The Copper field cannot be blank, It must have at least be zero (0).";
                        }

                        if (!$err) {
                                $bank_query  = "update bank";
                                $bank_query .= "   set plat = '" . $vars["plat"] . "', ";
                                $bank_query .= "       gold = '" . $vars["gold"] . "', ";
                                $bank_query .= "       silv = '" . $vars["silv"] . "', ";
                                $bank_query .= "       copp = '" . $vars["copp"] . "', ";
                                $bank_query .= "       weap = '" . $vars["weap"] . "', ";
                                $bank_query .= "       armo = '" . $vars["armo"] . "', ";
                                $bank_query .= "       spel = '" . $vars["spel"] . "', ";
                                $bank_query .= "       misc = '" . $vars["misc"] . "'";
                                $bank_query .= " where id = 1";

                                update_db($bank_query);

                        }
                }


                return $err;
        }
?>
Return current item: EverQuest Roster/Gallery