$(function() {
// ----------- animate toast #hum
function info_show(){
$("#toast-container")
.delay(3000)
.fadeOut(500, function(){ // on complete
$("#hum").html('');
});
}
// ----------- admin
$('#RichLogin').click(function(e) {
e.preventDefault();
$.ajax({
type: 'post',
url: '/ajax/manager.php?p=1',
data: $('#manager_log').serialize(),
success: success,
dataType: "json",
async:false
});
function success( castData ) {
$result = castData.result;
$status = castData.status;
$('#hum').html($result);
}
info_show();
if($status == "OK"){
setTimeout('location.replace("/adminka")',2500);
}
});
// -----------
});
//--------------------------------- вход в админку
if($p == "1"){
$login=$_POST["login"];
$pass=$_POST["pass"];
if(!empty($login) AND !empty($pass)){
if($login == "123" AND $pass == "123")
{
$_SESSION['user'] = $login;
$_SESSION['admin'] = "Admin";
echo request($p,1,"Успешная авторизация");
} else echo request($p,2,"Данные введены неверно");
} else echo request($p,2,"Поля не заполнены");
}
// функция json ответа
function request($type,$ident,$text){
if($ident == "1"){
$result = success($text);
$status = "OK";
}else{
$result = error($text);
$status = "ERR";
}
$arrInfo = array(
'status' => $status,
'ident' => $ident,
'result' => $result,
'key' => $type
);
return json_encode($arrInfo);
}
<a href="/news/2017/11/22/cskago/">Подробнее</a>
function IDbeSum(a,b,c,d,e){
setInterval(calc_sum,1000,a,b,c,d,e);
}
IDbeSum(<?=$cfg["pf1"]?>,<?=$usdat["fa1"]?>,<?=$usdat["sbor"]?>,24,1);
IDbeSum(<?=$cfg["pf2"]?>,<?=$usdat["fa2"]?>,<?=$usdat["sbor"]?>,24,2);
IDbeSum(<?=$cfg["pf3"]?>,<?=$usdat["fa3"]?>,<?=$usdat["sbor"]?>,24,3);
IDbeSum(<?=$cfg["pf4"]?>,<?=$usdat["fa4"]?>,<?=$usdat["sbor"]?>,24,4);
IDbeSum(<?=$cfg["pf5"]?>,<?=$usdat["fa5"]?>,<?=$usdat["sbor"]?>,24,5);
<?
$ar = [];
$br = [];
$cr = [];
$query = $mysqli->query("SELECT * FROM rich_ninja WHERE nick = '".$usdat['nick']."' AND ninja_type='n1'");
$rows1=$query->num_rows;
$rowset = $rows1 + 1;
while($nj1 = $query->fetch_array()){
$ar[$nj1['n1']] = $nj1['percent'];
$br[$nj1['n1']] = $nj1['price'];
$cr[$nj1['n1']] = $nj1['sbor'];
$calc = SumCalc($ar[$nj1['n1']],$br[$nj1['n1']],$cr[$nj1['n1']]);
# Обновляем
$sql=$mysqli->query("UPDATE rich_users SET n1 = n1 + '$calc' WHERE email = '$em_ses'");
$sql=$mysqli->query("UPDATE rich_ninja SET sbor = '$dadd' WHERE nick = '".$usdat['nick']."' AND ninja_type='n1'");
}
?>
pays - таблица
в ней выплаты в структуре зовутся ['down']
вложения ['up']
адреса сайтов, как ['url']