<?
$period = 3;
if (file_exists("last_time")) {
$last_time = @file_get_contents("last_time");
$current_time = time();
} else {
$current_time = time();
$last_time = $current_time-$period;
}
$steps = floor(($current_time - $last_time) / $period);
if ($steps > 0) {
$words_list = array("слово 1", "слово 2", "слово 3", "слово 4", "слово 5", "слово 6", "слово 7", "слово 8");
$words_add = array();
for ($i = 0; $i < $steps; $i++) {
$words_add[] = $words_list[rand(0, count($words_list)-1)];
}
$f = fopen("words", "a+");
fwrite($f, implode("<br>", $words_add) . "<br>");
fclose($f);
file_put_contents("last_time", $current_time);
}
echo @file_get_contents("words");
?>
<script>
setTimeout(function () {document.location.reload(); }, 3000);
</script>
// выводим в HTML-таблицу все данные клиентов из таблицы MySQL
while($data = mysqli_fetch_array($wwwlist)){
echo '<tr>';
echo '<td>' . $data['name'] . '</td>';
echo '<td><textarea name = "data[' . $data ['unid'] . '][email]">' . $data ['email'] . '</textarea></td>';
echo '<td> <textarea name = "data[' . $data ['unid'] . '][indexfiles]">' . $data ['indexfiles'] . '</textarea></td>';
echo '<td> <textarea name = "data[' . $data ['unid'] . '][alias]">' . $data ['alias'] . '</textarea></td>';
echo '<td> <textarea name = "data[' . $data ['unid'] . '][charset]">' . $data ['charset'] . '</textarea></td>';
echo '</tr>';
}
foreach ($_POST["data"] as $id => $fields) {
//UPDATE table WHERE unid = $id SET email = $fields[email], indexfiles= $fields[indexfiles]
}
select * from hotels
right join rooms ON hotels.id = rooms.hotel_id
AND rooms.price > 300
right join props ON hotels.id = props.hotel_id
AND props.room_id = rooms.id
AND props.prop_id = "wifi"