138 lines
6.2 KiB
PHP
138 lines
6.2 KiB
PHP
<?php
|
|
if (!defined('GAME') || !$u->info['bukmeker'] && !$u->info['admin']) {
|
|
die();
|
|
}
|
|
$pl = mysql_fetch_array(mysql_query('SELECT * FROM `bank_table` ORDER BY `time` DESC LIMIT 1'));
|
|
$ba = mysql_fetch_array(mysql_query("SELECT * FROM `bank_alh` WHERE `uid` = " . $u->info['id']));
|
|
?>
|
|
<script>
|
|
let elem = document.getElementById('se-pre-con');
|
|
elem.parentNode.removeChild(elem);
|
|
</script>
|
|
<script type="text/javascript" src='https://img.new-combats.com/js/commoninf.js'></script>
|
|
<style>
|
|
.modpow {
|
|
background-color: #ddd5bf;
|
|
}
|
|
|
|
.mt {
|
|
background-color: #b1a993;
|
|
padding-left: 10px;
|
|
padding-right: 10px;
|
|
padding-top: 5px;
|
|
padding-bottom: 5px;
|
|
}
|
|
|
|
.md {
|
|
padding: 10px;
|
|
}
|
|
</style>
|
|
<h4>Ïàíåëü Áóêìåêåðà</h4>
|
|
<div style="float: right">
|
|
Ïðèâåò, <?= $u->info['login'] ?>.
|
|
<INPUT TYPE="button" onclick="location.href='main.php?bukmeker=1';" value="Îáíîâèòü" class="btn"
|
|
title="Îáíîâèòü">
|
|
<INPUT TYPE="button" onclick="location.href='main.php';" class="btn" value="Âåðíóòüñÿ" title="Âåðíóòüñÿ">
|
|
</div>
|
|
|
|
|
|
<?php
|
|
if (isset($ba['id'])): ?>
|
|
<table width=320>
|
|
<tr>
|
|
<td>
|
|
<h4>Äîñòóïíî</h4>
|
|
<b><?= $ba['cr'] ?></b> êð.
|
|
<hr/>
|
|
<form method="post" action="main.php?bukmeker=1">
|
|
<?
|
|
if (isset($_POST['buy_cr'])) {
|
|
$uba = mysql_fetch_array(
|
|
mysql_query(
|
|
'SELECT * FROM `users` WHERE `login` = "' . mysql_real_escape_string(
|
|
$_POST['buy_cr']
|
|
) . '" LIMIT 1'
|
|
)
|
|
);
|
|
if (isset($uba['login'])) {
|
|
echo 'Ïåðåâîäèì êð ïåðñîíàæó: ' . $u->microLogin($uba['id'], 1) . '<br>';
|
|
} else {
|
|
echo '<font color=red>Áàíêîâñêèé ñ÷åò çàáëîêèðîâàí, ëèáî íå íàéäåí.</font><hr>';
|
|
unset($_POST['buy_cr']);
|
|
}
|
|
echo '<hr>';
|
|
if (isset($uba['login'])) {
|
|
$_POST['buk_cr'] = round($_POST['buk_cr'], 2);
|
|
if (isset($_POST['buk_cr']) && $_POST['buk_cr'] < 1) {
|
|
echo '<font color=red>Ìèíèìàëüíàÿ ñóììà ïåðåâîäà: 1 êð.</font><hr>';
|
|
unset($_POST['buk_cr']);
|
|
} elseif ($_POST['buk_cr'] > $ba['cr']) {
|
|
echo '<font color=red>Íåäîñòàòî÷íî ñðåäñòâ íà ñ÷åòå</font><hr>';
|
|
unset($_POST['buk_cr']);
|
|
}
|
|
if (isset($_POST['buygoodluck'])) {
|
|
echo '<script>alert("Çà÷èñëåíî ' . $_POST['buk_cr'] . ' êð!");location.href="main.php?bukmeker=1";</script>';
|
|
$ba['cr'] -= $_POST['buk_cr'];
|
|
$ba['USD'] += round($_POST['buk_cr'] * $ucur, 2);
|
|
mysql_query(
|
|
'UPDATE `bank_alh` SET `cr` = "' . mysql_real_escape_string(
|
|
$ba['cr']
|
|
) . '",`USD` = "' . mysql_real_escape_string(
|
|
$ba['USD']
|
|
) . '" WHERE `id` = "' . $ba['id'] . '" LIMIT 1'
|
|
);
|
|
mysql_query(
|
|
'UPDATE `users` SET `money` = `money` + ' . mysql_real_escape_string(
|
|
$_POST['buk_cr']
|
|
) . ' WHERE `login` = "' . $uba['login'] . '" LIMIT 1'
|
|
);
|
|
|
|
$money = round($_POST['buk_cr'] * $pl['cur'], 2);
|
|
$money = round($money / 100 * (100 - $ba['procent']), 2);
|
|
|
|
} else {
|
|
echo 'Ñóììà êð.:';
|
|
if (!isset($_POST['buk_cr'])) {
|
|
echo ' <input name="buk_cr" style="width:50px;" value="0.00" /> <input class="btn btn-success" value="Äàëåå" type="submit" /><br>';
|
|
} else {
|
|
echo ' <b>' . round(
|
|
(int)$_POST['buk_cr'], 2
|
|
) . '</b> êð.<input name="buk_cr" type="hidden" value="' . $_POST['buk_cr'] . '" />';
|
|
echo ' <input type="submit" name="buygoodluck" class="btn btn-danger" value="Íà÷èñëèòü êð">';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (isset($_POST['buy_cr'])) { ?><input name="buy_cr" type="hidden"
|
|
value="<?= $_POST['buy_cr'] ?>" /> <?
|
|
} else { ?>Ïåðåâåñòè êð ïåðñîíàæó: <input name="buy_cr" style="width:50px;"
|
|
value="<?= $_POST['buy_cr'] ?>"/> <input
|
|
class="btn btn-success" value="Äàëåå" type="submit"/><?
|
|
} ?>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<?php
|
|
endif;
|
|
|
|
if (!$u->info['bukmeker'] && !$u->info['admin']) {
|
|
return;
|
|
}
|
|
if (!empty($_POST['systemM'])) {
|
|
$r = "<strong>Âíèìàíèå: <span style='color: darkgreen;'>{$_POST['sysMes']}</span> [Áóêìåêåðñêàÿ Êîíòîðà]</strong>";
|
|
mysql_query("INSERT INTO `chat` (`new`,`text`,`time`,`type`) VALUES ('1','" . $r . "', unix_timestamp(),'6')");
|
|
echo "<br><b style='color: red;'>Ñèñòåìíîå ñîîáùåíèå îòïðàâëåíî.</b>";
|
|
}
|
|
?>
|
|
<div style="width: 500px;">
|
|
<form method='POST'>
|
|
<label>Ñèñòåìêà â ÷àò: <br>
|
|
<textarea name="sysMes" rows="4" cols="80"></textarea>
|
|
</label>
|
|
<br>
|
|
<input type='submit' name='systemM' class='btn' value='Îòïðàâèòü'>
|
|
</form>
|
|
</div>
|