frigiec
Участник
Доброго времени суток товарищи. Проблема в том что вся сумма которую поплняет пользователь на сайте уходит напрямую на payeer кошелёк сайта.А вот админу прописанные в скрипте 10% не начисляются. Может кто силён в коде помогите пожалуйста.
Не знаю в каком точно файле искать ошибку.
Не знаю в каком точно файле искать ошибку.
PHP:
<?php
include('../conf.php');
include('../head.php');
if(!USER_LOGGED) { header ("Location: /login"); exit; }
?>
<!doctype html>
<html>
<head>
<title>Мои вклады</title>
<meta charset="utf-8">
<meta name="keywords" content="вклады" />
<meta name="description" content="Мои вклады" />
<link rel="shortcut icon" href="../images/favicon.ico">
<?php include('../conf_styles.php'); ?>
</head>
<body>
<?php include('../conf_navbar.php'); include('conf_menu.php'); ?>
<div class="container">
<div class="one_full">
<center>
<h2>Сделать вклад</h2>
На Вашем балансе: <?php echo $bal['bal']; ?> руб.<br /><br />
<input type="text" id="sum" value="<?php if ($bal['bal'] >= 50 && $bal['bal'] <= 15000) { echo floor($bal['bal']); } if ($bal['bal'] < 50) { echo '50'; } if ($bal['bal'] > 15000) { echo '15000'; } ?>" placeholder="Сумма вклада" style="padding-left:5px" />
<br /><br />
<a><input id="submit" type="submit" style="border: 1px solid #4682B4; min-width:181px; background:#4682B4;color: #fff;cursor:pointer" value="Вложить" class="input" /></a><br /><br />
Вы получите <font id="prib2"></font> руб. (+<font id="profit"></font>%)<br />
Минимальная сумма вклада - 50 рублей.
<div id="res1dfr78"></div>
<div class="ptable four">
<div class="row main">
<div class="date" style="width:100px;"></div>
<div class="date" style="width:200px;">Дата вклада</div>
<div class="date" style="width:200px;">Сумма вклада / %</div>
<div class="tarif" style="width:200px;">К зачислению</div>
<div class="stat" style="width:250px;">Статус</div>
</div>
<?php
$sd = "SELECT id,sum,sume,proc,st,dt FROM `t_dep` WHERE usr = '$u_id' ORDER BY id DESC";
$qd = mysqli_query($connect_db, $sd);
$hd = mysqli_num_rows($qd);
if ($hd > 0) {
while($row = mysqli_fetch_array($qd)) {
?>
<div class="row"><div class="date" style="width:100px;"></div>
<div class="date" style="width:200px;"><?php echo date("d.m.y H:i",$row['dt']); ?></div>
<div class="date" style="width:200px;"><?php echo $row["sum"]; ?> / <?php echo $row["proc"]; ?>%</div>
<div class="tarif" style="width:200px;"><?php echo $row["sume"]; ?></div>
<div class="stat" style="width:250px;"><?php if ($row["st"] == 0) { $cou = mysqli_fetch_assoc(mysqli_query($connect_db, "SELECT count(*) AS `c` FROM `t_dep` WHERE st = '0' AND id < '$row[id]'")); $coue = $cou['c']; echo 'Ожидание (Перед вами '.$coue.' чел.)'; } else { echo '<font color="green">Принято</font>'; } ?></div></div>
<?php } } else { echo '<div class="row"><div class="nachi" style="width:100%;">Нет вложений</div></div>'; } ?>
</center>
</div>
</div>
</div>
</div>
<?php include('../conf_footer.php'); ?>
<script type="text/javascript">
$(document).ready(function () {
$('#sum').keyup(function() {
var $th = $(this);
$th.val( $th.val().replace(/[^0-9\.]/g, function(){ return ''; }) );
});
});
$(document).ready(function(){
"use strict";
var sums = parseInt($("#sum").val()),
plans = [];
plans[plans.length] = {
"min": 50,
"max": 1999,
"percent": 25,
};
plans[plans.length] = {
"min": 2000,
"max": 15000,
"percent": 35,
};
$("#prib2").html(0);
for(var i = 0; i < plans.length; i+=1) {
if (sums >= plans[i].min && sums <= plans[i].max) {
var stprib2 = (sums / 100 * plans[i].percent) + sums;
var sprib2 = stprib2.toFixed(2);
$("#prib2").html(sprib2);
$("#profit").html(plans[i].percent);
}
}
});
$(document).ready(function(){
"use strict";
$('#sum').keyup(function () {
var sume = parseInt($("#sum").val()),
plans = [];
plans[plans.length] = {
"min": 50,
"max": 1999,
"percent": 25,
};
plans[plans.length] = {
"min": 2000,
"max": 15000,
"percent": 35,
};
$("#prib2").html(0);
for(var i = 0; i < plans.length; i+=1) {
if (sume >= plans[i].min && sume <= plans[i].max) {
var tprib2 = (sume / 100 * plans[i].percent) + sume;
var prib2 = tprib2.toFixed(2);
$("#prib2").html(prib2);
$("#profit").html(plans[i].percent);
}
}
});
});
$(function() {
$('#submit').click(function(){
var sum = $('#sum').val();
$.ajax({
type: 'POST',
url: '../actions/new.php',
data: {'sum': sum},
cache: false,
success: function(result){
if (result == '0') {
new_notification('Вы не указали сумму вклада', 'error');
}
if (result == '1') {
new_notification('Успешно', 'success'); $(location).attr('href','/cabinet/deposits');
}
if (result == '2') {
new_notification('Минимальная сумма вклада - 50 рублей', 'error');
}
if (result == '3') {
new_notification('На балансе Вашего аккаунта не хватает средств', 'error');
}
if (result == '4') {
new_notification('Баланс Вашего аккаунта менее 50 рублей', 'error');
}
if (result == '5') {
new_notification('Вы не авторизованы', 'error');
}
if (result == '6') {
new_notification('Ошибка', 'error');
}
if (result == '7') {
new_notification('Максимальная сумма вклада - 15000 рублей', 'error');
}
}
});
});
});
</script>
</body>
</html>
PHP:
<?php
include('../conf.php');
include('../head.php');
if(!USER_LOGGED) { header ("Location: /login"); exit; }
?>
<!doctype html>
<html>
<head>
<title>Мои вклады</title>
<meta charset="utf-8">
<meta name="keywords" content="вклады" />
<meta name="description" content="Мои вклады" />
<link rel="shortcut icon" href="../images/favicon.ico">
<?php include('../conf_styles.php'); ?>
</head>
<body>
<?php include('../conf_navbar.php'); include('conf_menu.php'); ?>
<div class="container">
<div class="one_full">
<center>
<h2>Сделать вклад</h2>
На Вашем балансе: <?php echo $bal['bal']; ?> руб.<br /><br />
<input type="text" id="sum" value="<?php if ($bal['bal'] >= 50 && $bal['bal'] <= 15000) { echo floor($bal['bal']); } if ($bal['bal'] < 50) { echo '50'; } if ($bal['bal'] > 15000) { echo '15000'; } ?>" placeholder="Сумма вклада" style="padding-left:5px" />
<br /><br />
<a><input id="submit" type="submit" style="border: 1px solid #4682B4; min-width:181px; background:#4682B4;color: #fff;cursor:pointer" value="Вложить" class="input" /></a><br /><br />
Вы получите <font id="prib2"></font> руб. (+<font id="profit"></font>%)<br />
Минимальная сумма вклада - 50 рублей.
<div id="res1dfr78"></div>
<div class="ptable four">
<div class="row main">
<div class="date" style="width:100px;"></div>
<div class="date" style="width:200px;">Дата вклада</div>
<div class="date" style="width:200px;">Сумма вклада / %</div>
<div class="tarif" style="width:200px;">К зачислению</div>
<div class="stat" style="width:250px;">Статус</div>
</div>
<?php
$sd = "SELECT id,sum,sume,proc,st,dt FROM `t_dep` WHERE usr = '$u_id' ORDER BY id DESC";
$qd = mysqli_query($connect_db, $sd);
$hd = mysqli_num_rows($qd);
if ($hd > 0) {
while($row = mysqli_fetch_array($qd)) {
?>
<div class="row"><div class="date" style="width:100px;"></div>
<div class="date" style="width:200px;"><?php echo date("d.m.y H:i",$row['dt']); ?></div>
<div class="date" style="width:200px;"><?php echo $row["sum"]; ?> / <?php echo $row["proc"]; ?>%</div>
<div class="tarif" style="width:200px;"><?php echo $row["sume"]; ?></div>
<div class="stat" style="width:250px;"><?php if ($row["st"] == 0) { $cou = mysqli_fetch_assoc(mysqli_query($connect_db, "SELECT count(*) AS `c` FROM `t_dep` WHERE st = '0' AND id < '$row[id]'")); $coue = $cou['c']; echo 'Ожидание (Перед вами '.$coue.' чел.)'; } else { echo '<font color="green">Принято</font>'; } ?></div></div>
<?php } } else { echo '<div class="row"><div class="nachi" style="width:100%;">Нет вложений</div></div>'; } ?>
</center>
</div>
</div>
</div>
</div>
<?php include('../conf_footer.php'); ?>
<script type="text/javascript">
$(document).ready(function () {
$('#sum').keyup(function() {
var $th = $(this);
$th.val( $th.val().replace(/[^0-9\.]/g, function(){ return ''; }) );
});
});
$(document).ready(function(){
"use strict";
var sums = parseInt($("#sum").val()),
plans = [];
plans[plans.length] = {
"min": 50,
"max": 1999,
"percent": 25,
};
plans[plans.length] = {
"min": 2000,
"max": 15000,
"percent": 35,
};
$("#prib2").html(0);
for(var i = 0; i < plans.length; i+=1) {
if (sums >= plans[i].min && sums <= plans[i].max) {
var stprib2 = (sums / 100 * plans[i].percent) + sums;
var sprib2 = stprib2.toFixed(2);
$("#prib2").html(sprib2);
$("#profit").html(plans[i].percent);
}
}
});
$(document).ready(function(){
"use strict";
$('#sum').keyup(function () {
var sume = parseInt($("#sum").val()),
plans = [];
plans[plans.length] = {
"min": 50,
"max": 1999,
"percent": 25,
};
plans[plans.length] = {
"min": 2000,
"max": 15000,
"percent": 35,
};
$("#prib2").html(0);
for(var i = 0; i < plans.length; i+=1) {
if (sume >= plans[i].min && sume <= plans[i].max) {
var tprib2 = (sume / 100 * plans[i].percent) + sume;
var prib2 = tprib2.toFixed(2);
$("#prib2").html(prib2);
$("#profit").html(plans[i].percent);
}
}
});
});
$(function() {
$('#submit').click(function(){
var sum = $('#sum').val();
$.ajax({
type: 'POST',
url: '../actions/new.php',
data: {'sum': sum},
cache: false,
success: function(result){
if (result == '0') {
new_notification('Вы не указали сумму вклада', 'error');
}
if (result == '1') {
new_notification('Успешно', 'success'); $(location).attr('href','/cabinet/deposits');
}
if (result == '2') {
new_notification('Минимальная сумма вклада - 50 рублей', 'error');
}
if (result == '3') {
new_notification('На балансе Вашего аккаунта не хватает средств', 'error');
}
if (result == '4') {
new_notification('Баланс Вашего аккаунта менее 50 рублей', 'error');
}
if (result == '5') {
new_notification('Вы не авторизованы', 'error');
}
if (result == '6') {
new_notification('Ошибка', 'error');
}
if (result == '7') {
new_notification('Максимальная сумма вклада - 15000 рублей', 'error');
}
}
});
});
});
</script>
</body>
</html>
Последнее редактирование: