mirror of
https://github.com/slawkens/myaac.git
synced 2025-07-06 19:50:14 +02:00
Add Coins Transferable to accounts editor
This commit is contained in:
parent
c92148d467
commit
45d6047031
@ -27,6 +27,13 @@ $nameOrNumberColumn = getAccountIdentityColumn();
|
|||||||
|
|
||||||
$hasSecretColumn = $db->hasColumn('accounts', 'secret');
|
$hasSecretColumn = $db->hasColumn('accounts', 'secret');
|
||||||
$hasCoinsColumn = $db->hasColumn('accounts', 'coins');
|
$hasCoinsColumn = $db->hasColumn('accounts', 'coins');
|
||||||
|
|
||||||
|
$hasCoinsTransferableColumn = $db->hasColumn('accounts', 'coins_transferable');
|
||||||
|
$hasTransferableCoinsColumn = $db->hasColumn('accounts', 'transferable_coins');
|
||||||
|
$coinsTransferableColumn =
|
||||||
|
$hasTransferableCoinsColumn ?
|
||||||
|
'transferable_coins' : 'coins_transferable';
|
||||||
|
|
||||||
$hasPointsColumn = $db->hasColumn('accounts', 'premium_points');
|
$hasPointsColumn = $db->hasColumn('accounts', 'premium_points');
|
||||||
$hasTypeColumn = $db->hasColumn('accounts', 'type');
|
$hasTypeColumn = $db->hasColumn('accounts', 'type');
|
||||||
$hasGroupColumn = $db->hasColumn('accounts', 'group_id');
|
$hasGroupColumn = $db->hasColumn('accounts', 'group_id');
|
||||||
@ -136,11 +143,18 @@ else if (isset($_REQUEST['search'])) {
|
|||||||
if (!Validator::email($email))
|
if (!Validator::email($email))
|
||||||
$errors['email'] = Validator::getLastError();
|
$errors['email'] = Validator::getLastError();
|
||||||
|
|
||||||
//tibia coins
|
// tibia coins
|
||||||
if ($hasCoinsColumn) {
|
if ($hasCoinsColumn) {
|
||||||
$t_coins = $_POST['t_coins'];
|
$t_coins = $_POST['t_coins'];
|
||||||
verify_number($t_coins, 'Tibia coins', 12);
|
verify_number($t_coins, 'Tibia coins', 12);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// transferable tibia coins
|
||||||
|
if ($hasCoinsTransferableColumn || $hasTransferableCoinsColumn) {
|
||||||
|
$t_coins_transferable = $_POST['t_coins_transferable'];
|
||||||
|
verify_number($t_coins_transferable, 'Transferable Tibia coins', 12);
|
||||||
|
}
|
||||||
|
|
||||||
// prem days
|
// prem days
|
||||||
$p_days = (int)$_POST['p_days'];
|
$p_days = (int)$_POST['p_days'];
|
||||||
verify_number($p_days, 'Prem days', 11);
|
verify_number($p_days, 'Prem days', 11);
|
||||||
@ -185,12 +199,18 @@ else if (isset($_REQUEST['search'])) {
|
|||||||
if ($hasSecretColumn) {
|
if ($hasSecretColumn) {
|
||||||
$account->setCustomField('secret', $secret);
|
$account->setCustomField('secret', $secret);
|
||||||
}
|
}
|
||||||
|
|
||||||
$account->setCustomField('key', $key);
|
$account->setCustomField('key', $key);
|
||||||
$account->setEMail($email);
|
$account->setEMail($email);
|
||||||
|
|
||||||
if ($hasCoinsColumn) {
|
if ($hasCoinsColumn) {
|
||||||
$account->setCustomField('coins', $t_coins);
|
$account->setCustomField('coins', $t_coins);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($hasCoinsTransferableColumn || $hasTransferableCoinsColumn) {
|
||||||
|
$account->setCustomField($coinsTransferableColumn, $t_coins_transferable);
|
||||||
|
}
|
||||||
|
|
||||||
$lastDay = 0;
|
$lastDay = 0;
|
||||||
if($p_days != 0 && $p_days != OTS_Account::GRATIS_PREMIUM_DAYS) {
|
if($p_days != 0 && $p_days != OTS_Account::GRATIS_PREMIUM_DAYS) {
|
||||||
$lastDay = time();
|
$lastDay = time();
|
||||||
@ -401,6 +421,12 @@ else if (isset($_REQUEST['search'])) {
|
|||||||
<input type="text" class="form-control" id="t_coins" name="t_coins" autocomplete="off" maxlength="11" value="<?php echo $account->getCustomField('coins') ?>"/>
|
<input type="text" class="form-control" id="t_coins" name="t_coins" autocomplete="off" maxlength="11" value="<?php echo $account->getCustomField('coins') ?>"/>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
<?php if ($hasCoinsTransferableColumn || $hasTransferableCoinsColumn): ?>
|
||||||
|
<div class="col-12 col-sm-12 col-lg-6">
|
||||||
|
<label for="t_coins_transferable">Transferable Tibia Coins:</label>
|
||||||
|
<input type="text" class="form-control" id="t_coins_transferable" name="t_coins_transferable" autocomplete="off" maxlength="11" value="<?php echo $account->getCustomField($coinsTransferableColumn) ?>"/>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
<div class="col-12 col-sm-12 col-lg-6">
|
<div class="col-12 col-sm-12 col-lg-6">
|
||||||
<label for="p_days">Premium Days:</label>
|
<label for="p_days">Premium Days:</label>
|
||||||
<input type="text" class="form-control" id="p_days" name="p_days" autocomplete="off" maxlength="11" value="<?php echo $account->getPremDays(); ?>"/>
|
<input type="text" class="form-control" id="p_days" name="p_days" autocomplete="off" maxlength="11" value="<?php echo $account->getPremDays(); ?>"/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user