예제 #1
0
파일: boosts.php 프로젝트: superwow/cms
                            <input type="hidden" name="boost" value="0" id="selected-boost-id" />
                        </form>

                        <div class="clear"></div>
                        
                    </div>
                    <!-- Purchase Aura.End -->
                        
                    <div class="active_boosts">
                        <h1>Active boosts</h1>
                        <ul class="active_boosts">
                        	<?php 
//Loop through the active boosts
foreach ($ActiveBoosts as $key => $BoostRecord) {
    //Get the boost details
    $BoostDetails = $Boosts->get((int) $BoostRecord['boosts']);
    //Get the time left in single measure
    $timeLeft = $CORE->singleMeasureTimeLeft((int) $BoostRecord['unsetdate']);
    echo '
								<li>
									<div class="icon" style="background-image:url(', $BoostDetails['icon'], ');"></div>
									<p>', $timeLeft, ' left</p>
								</li>';
    unset($timeLeft, $BoostDetails);
}
unset($key, $BoostRecord, $ActiveBoosts);
?>
                        </ul>
                    </div>
                    <div class="clear"></div>
                                 
예제 #2
0
$BoostId = isset($_POST['boost']) ? (int) $_POST['boost'] : false;
$currency = isset($_POST['currency']) ? (int) $_POST['currency'] : false;
$DurationId = isset($_POST['duration']) ? (int) $_POST['duration'] : false;
//Setup the finances class
$finance = new AccountFinances();
//prepare the log
$logs = new purchaseLog();
//The boosts storage
$BoostsStorage = new BoostsData();
######################################
############### CHECKs ###############
if (!$BoostId) {
    //no boost selected
    $ERRORS->Add('Please select boost first.');
} else {
    if (!($BoostDetails = $BoostsStorage->get($BoostId))) {
        //Verify the boost id
        $ERRORS->Add('The selected boost is invalid.');
    }
}
if (!$currency) {
    //no currency is selected
    $ERRORS->Add('Please select a currency for the purchase.');
} else {
    if (!$finance->IsValidCurrency($currency)) {
        //invalid currency
        $ERRORS->Add('Error, invalid currency selected.');
    }
}
if (!$DurationId) {
    $ERRORS->Add('Please select boost duration.');