本文整理汇总了PHP中Functions::Post_Int方法的典型用法代码示例。如果您正苦于以下问题:PHP Functions::Post_Int方法的具体用法?PHP Functions::Post_Int怎么用?PHP Functions::Post_Int使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Functions
的用法示例。
在下文中一共展示了Functions::Post_Int方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Module_JSON
function Module_JSON($db)
{
$card_id = Functions::Post_Int('card_id');
$normal = Functions::Post_Int('normal');
$gold = Functions::Post_Int('gold');
if (!Functions::Card_Load_Id($db, $card_id, $card)) {
return JSON_Response_Error('#Error#', 'Failed to load card');
}
if ($normal < 0 or !is_int($normal)) {
return JSON_Response_Error('#Error#', 'Invalid normal value');
}
if ($gold < 0 or !is_int($gold)) {
return JSON_Response_Error('#Error#', 'Invalid normal value');
}
if ($card['rarity'] == 'Legendary') {
$card['normal'] = $normal > 1 ? 1 : $normal;
$card['gold'] = $gold > 1 ? 1 : $gold;
} else {
$card['normal'] = $normal > 2 ? 2 : $normal;
$card['gold'] = $gold > 2 ? 2 : $gold;
}
if (!Functions::Card_Update($db, $card)) {
return JSON_Response_Global_Error();
}
return JSON_Response_Success();
}
示例2: Module_JSON
function Module_JSON($db)
{
$dust_am = Functions::Post_Int('dust_am');
$dust_de = Functions::Post_Int('dust_de');
$gold = Functions::Post_Int('gold');
if (!Functions::Account_Load($db, $account)) {
return JSON_Response_Error('#Error#', 'Failed to load account');
}
$account['dust_am'] = $dust_am;
$account['dust_de'] = $dust_de;
$account['gold'] = $gold;
if (!Functions::Account_Update($db, $account)) {
return JSON_Response_Global_Error();
}
return JSON_Response_Success();
}
示例3: Module_JSON
function Module_JSON($db)
{
$common = Functions::Post_Int('common');
$c_gold = Functions::Post_Int('c_gold');
$rare = Functions::Post_Int('rare');
$r_gold = Functions::Post_Int('r_gold');
$epic = Functions::Post_Int('epic');
$e_gold = Functions::Post_Int('e_gold');
$legend = Functions::Post_Int('legend');
$l_gold = Functions::Post_Int('l_gold');
if (!Functions::Pack_Load($db, $packs)) {
return JSON_Response_Error('#Error#', 'Failed to load pack data');
}
$packs['common'] = $packs['common'] + $common;
$packs['c_gold'] = $packs['c_gold'] + $c_gold;
$packs['rare'] = $packs['rare'] + $rare;
$packs['r_gold'] = $packs['r_gold'] + $r_gold;
$packs['epic'] = $packs['epic'] + $epic;
$packs['e_gold'] = $packs['e_gold'] + $e_gold;
$packs['legend'] = $packs['legend'] + $legend;
$packs['l_gold'] = $packs['l_gold'] + $l_gold;
$packs['opened']++;
if ($common + $c_gold + $rare + $r_gold + $epic + $e_gold + $legend + $l_gold != 5) {
return JSON_Response_Error('#Error#', 'Not a valid pack');
}
if (!Functions::Pack_Update($db, $packs)) {
return JSON_Response_Global_Error();
}
//Update account pack info (perhaps should be in packs)
if (!Functions::Account_Load($db, $account)) {
return JSON_Response_Error('#Error#', 'Failed to load account');
}
if ($legend + $l_gold != 0) {
$account['last_l'] = 0;
} else {
$account['last_l']++;
}
if ($epic + $e_gold != 0) {
$account['last_e'] = 0;
} else {
$account['last_e']++;
}
if (!Functions::Account_Update($db, $account)) {
return JSON_Response_Global_Error();
}
return JSON_Response_Success();
}
示例4: Module_JSON
function Module_JSON($db)
{
$opponent = Functions::Post('opponent');
$win = Functions::Post_Int('win');
$coin = Functions::Post_Int('coin');
if (!Functions::ArenaRun_Load_Active($db, $arena_run)) {
return JSON_Response_Error('#Error#', 'Failed to load active arena');
}
$arena_match['arena_id'] = $arena_run['id'];
$arena_match['opponent'] = $opponent;
$arena_match['win'] = $win;
$arena_match['coin'] = $coin;
if (!Functions::ArenaMatch_Validate($arena_match)) {
return JSON_Response_Global_Error();
}
return JSON_Response_Success();
}
示例5: arena
<?php
/*
INFO ON WHAT THIS PAGE WILL SHOW
Graphs of all my arena stats
Need to do importing of all my old arena runs
New feature of arena (how many of which rarity rarity)
*/
include_once "classes/functions.php";
include_once "classes/layout.php";
$functions = new Functions();
$layout = new Layout();
$database2 = new Database2();
$layout->title("HS Arena stats");
$layout->header();
$arena_id = Functions::Post_Int('ArenaID');
$new_arena = 0;
Functions::ClassList_Load_Classes($database2, $classes);
if (!Functions::ArenaRun_Load_ID($database2, $arena_id, $arena_run)) {
if (!Functions::ArenaRun_Load_Active($database2, $arena_run)) {
$new_arena = 1;
}
}
if (!$new_arena) {
Functions::ArenaRewards_Load_ArenaID($database2, $arena_run['id'], $arena_rewards);
Functions::ArenaMatchList_Load_ArenaID($database2, $arena_run['id'], $arena_matches);
}
?>
<a href="index.php">Home</a>
<h1 style="margin: 5px;">Arena Stats and Data</h1>
示例6: Update_Item
function Update_Item(&$db, $type, $date_input, $employee_id, $hours, $description, $billable, $custom_rate)
{
$item_id = Functions::Post_Int('item_id');
if (!Functions::Item_Load($db, $item_id, $loaded_item)) {
return JSON_Response_Error('#Error#', 'Item could not be found');
}
$item['id'] = $loaded_item['id'];
$item['rp_id'] = $loaded_item['rp_id'];
$item['date'] = date('Y-m-d', strtotime($date_input));
$item['type'] = $type;
$item['hours'] = $hours;
$item['employee_id'] = $employee_id;
$item['description'] = $description;
$item['billable'] = $billable;
$item['custom_rate'] = $custom_rate;
if (!Functions::Item_Update($db, $item)) {
return JSON_Response_Global_Error();
}
return JSON_Response_Success(array('real_id' => $item_id));
}