The BID18xxStart Page

From BOARD18 Project WIKI
Jump to navigation Jump to search
BID18xx Design edit

Control is transferred to the bid18xxStart page from the index page. The index page also supplies the number of players to the bid18xxStart page as a URL parameter.
The bid18xxStart page displays a form in to which the names and email addresses of the players should be entered.

function SetupBid()

The SetupBid function uses the functions below to setup a new draft by creating a new row in the bid_table and then sending an email to each player to kick off the bid process.

function makePinfo()

The makePinfo function sets up the BID18.nlist array and the BID18.elist array by accessing the player name and email addresse fields from the setup form on the bid18xxStart page. It also checks for duplicate names.

function makeBidRow()

Function makeBidRow creates "", and then uses JSON.stringify to convert it to the JSON component of the new bid_table row for this bid. It then does an ajax call to makeBidRow.php.

function newBidOK(response)

Function newBidOK is the success callback function for the ajax makeBidRow.php call. It checks for a failure and then reports the new bid ID to the start page. Finally it adds a psudorandom url key to the array for each player calls the updatebid.php function.

The php/makeBid.php call returns the numeric bid_id of the new table row or the intiger 0 if a failure occured.

function updtBidResult(result)

Function updtBidResult is the success callback function for the ajax updtBid.php call made by the newBidOK() function. It checks for a failure or a collision and then it calls the emailBidRequests.php function.

Output from updateBid is an echo return status of "success", "collision" or "fail".

function startupEmailsResult(response)

Function startupEmailsResult is the call back function for the ajax calls to emailBidRequests.php. It will have to process returns from multiple emails for the same call. It only needs to check for errors and it only needs to report the first error.

function urlKeyGen(draftID, playerID)

The urlKeyGen() function creates a pseudo random url key for a given bidID and playerID.

Input consists of the bidID and the playerID

Output is the pseudo random url key based on the input.