Example #1
0
function typeOptions()
{
    $type_list = getAllEventTypes();
    foreach ($type_list as $options) {
        echo '<option value="' . $options['id'] . '">' . $options['type'] . '</option>';
    }
}
Example #2
0
<?php

if (count($argv) != 3) {
    echo 'usage: php -f jsonrpc.php AppKey SessionToken';
    exit(-1);
}
$APP_KEY = $argv[1];
$SESSION_TOKEN = $argv[2];
// Setting DEBUG to true will output all request / responses to api-ng.
$DEBUG = False;
echo "1. Get all Event Types....\n";
$allEventTypes = getAllEventTypes($APP_KEY, $SESSION_TOKEN);
echo "\n2. Extract Event Type Id for Horse Racing....\n";
$horseRacingEventTypeId = extractHorseRacingEventTypeId($allEventTypes);
echo "\n3. EventTypeId for Horse Racing is: {$horseRacingEventTypeId} \n";
echo "\n4. Get next horse racing market in the UK....\n";
$nextHorseRacingMarket = getNextUkHorseRacingMarket($APP_KEY, $SESSION_TOKEN, $horseRacingEventTypeId);
echo "\n5. Print static marketId, name and runners....\n";
printMarketIdAndRunners($nextHorseRacingMarket);
echo "\n6. Get volatile info for Market including best 3 exchange prices available...\n";
$marketBook = getMarketBook($APP_KEY, $SESSION_TOKEN, $nextHorseRacingMarket->marketId);
echo "\n7. Print volatile price data along with static runner info....\n";
printMarketIdRunnersAndPrices($nextHorseRacingMarket, $marketBook);
echo "\n\n8. Place a bet below minimum stake to prevent the bet actually being placed....\n";
$betResult = placeBet($APP_KEY, $SESSION_TOKEN, $nextHorseRacingMarket->marketId, $nextHorseRacingMarket->runners[0]->selectionId);
echo "\n9. Print result of bet....\n\n";
printBetResult($betResult);
function getAllEventTypes($appKey, $sessionToken)
{
    $jsonResponse = sportsApingRequest($appKey, $sessionToken, 'listEventTypes', '{"filter":{}}');
    return $jsonResponse[0]->result;
Example #3
0
        ?>
">
			<div class="edit-form">
				<span class="title">Edit Event</span>
					<input type="hidden" name="Event_ID_Value" value="<?php 
        echo $this_event['id'];
        ?>
">
				<span>Change Name</span>
					<input class="event-name" type="text" name="Event_Name" id="Event_Name">
				<span>Change Description</span>
					<textarea class="event-description" type="text" name="Event_Description" id="Event_Description"></textarea>
				<span>Change Type</span>
				<select class="event-type" name="Event_Type" id="Event_Type">
					<?php 
        $type_list = getAllEventTypes();
        foreach ($type_list as $options) {
            echo "<option value='" . $options['id'] . "'>" . $options['type'] . "</option>";
        }
        ?>
				</select>
				<span>Change Date</span>
				<div class="event-date">
					<select name="day" class="day"><?php 
        dayOptions();
        ?>
</select>
					<select name="month" class="month"><?php 
        monthOptions();
        ?>
</select>