Подскажите пожалуйста, как переделать этот код ,чтоб поставить его на планировщик задач и данные заполнялись автоматически Я просто не учил Php... PHP: <? global $db; $Now = time(); if( isset( $_POST['NewDepo'] ) ){ Accounts_Work::Open_Deposit($_POST['Login'], $_POST['Amount'], $_POST['Plan'], 1, 0, 0, $_POST['System']); $Pass = rand(1, 9999999999999999999999); $Email = $_POST['Login'].'@'.$_POST['Login'].'.ru'; $File = dirname(__DIR__).'/Operations.txt'; $InFile = file_get_contents($File); $InFile .= $_POST['Login'].'|||OpenDeposit|||'.$Now.'|||'.$_POST['Amount'].PHP_EOL; file_put_contents($File, $InFile); } if( isset( $_POST['NewWithdrawal'] ) ){ $Wallet = rand(1, 9999999999999999999999); Accounts_Work::New_Withdrawal($_POST['Login'], $_POST['Amount'], $Wallet, $_POST['System'], 1); $Pass = rand(1, 9999999999999999999999); $Email = $_POST['Login'].'@'.$_POST['Login'].'.ru'; $File = dirname(__DIR__).'/Operations.txt'; $InFile = file_get_contents($File); $InFile .= $_POST['Login'].'|||Withdrawal|||'.$Now.'|||'.$_POST['Amount'].PHP_EOL; file_put_contents($File, $InFile); } ?> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Новый депозит</h3> </div> <div class="panel-body"> <form method="POST"> <input type="text" name="Login" class="form-control" placeholder="Логин" style="margin-bottom: 10px" /> <input type="text" name="Amount" class="form-control" placeholder="Сумма" style="margin-bottom: 10px" /> <?=Accounts_Work::SelectPlan(); ?> <?=Accounts_Work::SelectPS(); ?> <input type="submit" class="btn btn-success" value="Сохранить" name="NewDepo" /> </form> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Новая выплата</h3> </div> <div class="panel-body"> <form method="POST"> <input type="text" name="Login" class="form-control" placeholder="Логин" style="margin-bottom: 10px" /> <input type="text" name="Amount" class="form-control" placeholder="Сумма" style="margin-bottom: 10px" /> <?=Accounts_Work::SelectPS(1); ?> <input type="submit" class="btn btn-success" value="Сохранить" name="NewWithdrawal" /> </form> </div> </div> Или подскажите, что с этим кодом не так PHP: <? ini_set('error_reporting', E_ALL); ini_set('display_errors', 1); ini_set('display_startup_errors', 1); function __autoload($class){ include("../Core/".$class.".php");} $Main = new Main; $db = Krugozor_Database_Mysql::create($Main->MySQL_Data()['Host'], $Main->MySQL_Data()['User'], $Main->MySQL_Data()['Pass'])->setDatabaseName($Main->MySQL_Data()['DataBase'])->setCharset('cp1251'); $Acc_Work = new Accounts_Work($db); $Query = $db->query('SELECT `ID`, `Login`, `Amount`, `End`, `Payments`, `Full_Payments`, `Percent`, `Bonus`, `Plan_ID`, `Start`, `User_ID` FROM `Deposits` WHERE `Payments` < `Full_Payments` AND `Status` = "1" AND Next_Payment <= "?i" ORDER BY `Start`', time()); while ( $Row = $Query->fetch_assoc() ){ $Login = $Row['Login']; $User_ID = $Row['User_ID']; $ID = $Row['ID']; $Query2 = $db->query('SELECT `Time`, `Back` FROM `Plans` WHERE id = "?i"', $Row['Plan_ID']); $Plan = $Query2->fetch_assoc(); $Next_Payment = $Row['Start'] + ( ($Row['Payments'] + 2) * $Plan['Time'] ); $History = $Row['Start'] + ( ($Row['Payments'] + 1) * $Plan['Time'] ); $Count_Amount = round($Row['Amount']/100*$Row['Percent'], 2); $db->query('UPDATE `Deposits` SET `Next_Payment` = "?i", `Payments` = "?i" WHERE `ID` = "?i" LIMIT 1', $Next_Payment, $Row['Payments']+1, $ID); $db->query('UPDATE `Accounts` SET `Balance` = `Balance` + "?i" WHERE ID = "?i" LIMIT 1', $Count_Amount, $User_ID ); $Acc_Work->HistoryInsert($Login, $Count_Amount, 'Deposit', 0, $History, 0, $ID); if( ($Row['Payments']+1) == $Row['Full_Payments']) { $db->query('UPDATE `Deposits` SET `Status` = "?i" WHERE `ID` = "?i" LIMIT 1', 2, $ID); if($Plan['Back'] == 1){ $Bonus = $Row['Bonus']; $db->query('UPDATE `Accounts` SET `Balance` = `Balance` + "?i" WHERE ID = "?i" LIMIT 1', $Row['Amount'], $User_ID ); $Acc_Work->HistoryInsert($Login, $Row['Amount'], 'Back', 0, $Row['End'], $ID); if( $Bonus > 0 ){ $Acc_Work->HistoryInsert($Login, $Row['Amount']/100*$Bonus, 'Bonus', 0, $Row['End'], $ID); $BonusAmount = $Row['Amount']/100*$Bonus; $db->query('UPDATE `Accounts` SET `Balance` = `Balance` + "?i" WHERE `Login` = "?s" LIMIT 1', $BonusAmount, $Login ); } } } } echo 'Done'; ?>