Файл: hostbiter.ru/Core/cron/cron1.php
Строк: 29
<?
require ($_SERVER['DOCUMENT_ROOT'].'/Core/core.php');
$users = $db->prepare("SELECT * FROM `users`");
$users->execute();
$us = $users->fetchAll();
foreach($us as $row){
$tar = $db->prepare("SELECT * FROM `tarifs` WHERE `id` = ?");
$tar->execute([$row['tarif']]);
$tar = $tar->fetch();
if($row['balance'] >= $tar['cost']){
$sql1 = $db->prepare("UPDATE `users` SET `balance` = `balance` - ? WHERE `id` = ?");
$sql1->execute([$tar['cost'],$row['id']]);
$api = file_get_contents($config['PanelUrl']."/ispmgr?authinfo=".$config['RootAccountName'].":".$config['RootAccountPassword']."&func=user.resume&out=xml&elid=".$row['login']."");
$parse = simplexml_load_string($api);
}else{
$api = file_get_contents($config['PanelUrl']."/ispmgr?authinfo=".$config['RootAccountName'].":".$config['RootAccountPassword']."&func=user.suspend&out=xml&elid=".$row['login']."");
$parse = simplexml_load_string($api);
}
}