Example #1
0
    // call the function getRoundResult
    $result = calculateValue($player_value, $dealer_value);
} elseif (isset($_POST['hit'])) {
    // use the remaining cards from the previous round
    $rest_cards = $_SESSION['rest_cards'];
    //assign the previous hand to a variable
    $player = $_SESSION['player'];
    $dealer = $_SESSION['dealer'];
    // call removeCard function and get the next card
    $card = removeCard($rest_cards);
    // extend the array with the card to show
    array_push($player, $card[0]);
    // store in the session for the next round
    $_SESSION['player'] = $player;
    // get the result
    $result = calculateValue($player);
    // store the remaining cards for the next round
    $_SESSION['rest_cards'] = $card['rest_cards'];
} elseif (isset($_POST['stand'])) {
}
?>
<div class = "container">
<div class = "row">
<div class = "col-md-6">
<h2 class = "text-left">Play Now?</h2>

</div>
<div class = "col-md-3">
<h4 class = "text-left">Dealer</h4>
</div>
<div class = "col-md-3">
Example #2
0
function date_period($field, $value)
{
    $val = calculateValue($value);
    if ($val === 'LAST_YEAR') {
        $val = "sysdate-TO_YMINTERVAL('01-00')";
    } elseif ($val === 'LAST_MONTH') {
        $val = "ADD_MONTHS(sysdate,-1)";
    } elseif ($val === 'LAST_WEEK') {
        $val = "sysdate -7";
    } elseif ($val === 'LAST_DAY') {
        $val = "sysdate -1";
    } elseif ($val === 'LAST_HOUR') {
        $val = "sysdate -(1/24)";
    } elseif ($val === 'LAST_QUARTER') {
        $val = "sysdate -(1/96)";
    } else {
        return "1<>1";
    }
    return $field . " > " . $val;
}