[an error occurred while processing this directive]
[<a href="index.shtml">Package Index</a></code> | <a href="index_std.shtml">Mudlib Index</a></code> | <a href="index_eff.shtml">Effect Index</a></code>]<br><h2>File /d/am/handlers/bernita_handler.c</h2> This handler retrieves information about customers in
Bernita's Flower Store, and performs basic maintainence
functions.
<p><p>Written by Taffyd<p>Started 8/2/1999.
<h2>Includes</h2>
This class includes the following files <a href="include.login_handler.h.shtml">/include/login_handler.h</a>, <a href="include.player_handler.h.shtml">/include/player_handler.h</a>, <a href="include.login.h.shtml">/include/login.h</a> and <a href="include.library.h.shtml">/include/library.h</a><h2>Method index</h2>
<dl><ul>
<li><a href="#add_new_customer">add_new_customer</a>(int, string)<br/>
This method adds a new customer.
<li><a href="#add_new_purchase">add_new_purchase</a>(string, string, int, string)<br/>
This method is used to add a new purchase into the customer's save
file.
<li><a href="#find_flower_id">find_flower_id</a>(int, string)<br/>
This method finds a flower's id.
<li><a href="#find_player_id">find_player_id</a>(int, string)<br/>
This method finds a player's id.
<li><a href="#player_refreshed">player_refreshed</a>(mixed, int)<li><a href="#query_bernita_flowers">query_bernita_flowers</a>()<br/>
This returns a mapping of all the flowers in Bernita's
database.
<li><a href="#query_total_spent">query_total_spent</a>(string)<br/>
This method returns how much has been spent by the player at
Bernita's Flower Shop.
<li><a href="#sql_query">sql_query</a>(int, string)<br/>
This method performs an SQL query.
<li><a href="#top_flower_buyers">top_flower_buyers</a>(int)<li><a href="#top_selling_flowers">top_selling_flowers</a>(int)</ul><h2>Public Functions</h2>
These are functions that everyone can access.<p>
.<ul><a name="add_new_customer">
add_new_customer</a><pre>
int add_new_customer(int fd,
                     string name)
</pre></br>
This method adds a new customer.
<br/><ul>
<li><b>Parameters:</b>
<br/>fd - the database's file description
<br/>name - the customer's name to add
<li><b>Returns:</b>
<br/>1 if the customer could be successfully
added, 0 if they could not be.

</dl>

<ul><a name="add_new_purchase">
add_new_purchase</a><pre>
int add_new_purchase(string p_name,
                     string flower,
                     int value,
                     string recipient)
</pre></br>
This method is used to add a new purchase into the customer's save
file.
<br/><ul>
<li><b>Parameters:</b>
<br/>p_name - the player's name
<br/>flower - the type of flower being added
<br/>value - the value of the flower
<br/>recipient - who the flower is being sent to.
<li><b>Returns:</b>
<br/>always returns 1.

</dl>

<ul><a name="player_refreshed">
player_refreshed</a><pre>
void player_refreshed(mixed p_name,
                      int total)
</pre>
<ul><a name="query_bernita_flowers">
query_bernita_flowers</a><pre>
mapping query_bernita_flowers()
</pre></br>
This returns a mapping of all the flowers in Bernita's
database.  It is used by Bernita to do weird and wonderful
things.
<br/><ul>
<li><b>Returns:</b>
<br/>a mapping of flowers, where the key is the flower's
name and the values are the plural and description.

</dl>

<ul><a name="query_total_spent">
query_total_spent</a><pre>
int query_total_spent(string p_name)
</pre></br>
This method returns how much has been spent by the player at
Bernita's Flower Shop.
<br/><ul>
<li><b>Parameters:</b>
<br/>p_name - the player's name to check
<li><b>Returns:</b>
<br/>the number of brass coins that they have spent in the
shop on flowers.

</dl>

<ul><a name="top_flower_buyers">
top_flower_buyers</a><pre>
varargs mixed * top_flower_buyers(int limit)
</pre>
<ul><a name="top_selling_flowers">
top_selling_flowers</a><pre>
varargs mixed * top_selling_flowers(int limit)
</pre>

<h2>Protected Functions</h2>
These are functions that only objects inheriting the class can access.<p>
<ul><a name="find_flower_id">
find_flower_id</a><pre>
int find_flower_id(int fd,
                   string flower_name)
</pre></br>
This method finds a flower's id.
<br/><ul>
<li><b>Parameters:</b>
<br/>fd - the database's file descriptor
<br/>flower_name - the flower's name
<li><b>Returns:</b>
<br/>the flower's id, -1 if it could not be found

</dl>

<ul><a name="find_player_id">
find_player_id</a><pre>
int find_player_id(int fd,
                   string player)
</pre></br>
This method finds a player's id.
<br/><ul>
<li><b>Parameters:</b>
<br/>fd - the database's file descriptor
<br/>player - the player's name
<li><b>Returns:</b>
<br/>the player's id, -1 if they could not be found

</dl>

<ul><a name="sql_query">
sql_query</a><pre>
mixed * sql_query(int fd,
                  string query)
</pre></br>
This method performs an SQL query.  It returns
the data from the query in a lovely array
that you can then interpret however you wish.
<br/><ul>
<li><b>Parameters:</b>
<br/>fd - the database file descriptor
<br/>query - the query to be executed
<li><b>Returns:</b>
<br/>an empty array if the query could not
be executed, otherwise the query results.

</dl>


[an error occurred while processing this directive]

