New We are sorting MAX channels into categories and territories. Read the news

<?php foreach ($students as $s): ?>


<option value="<?= $s['id'] ?>"><?= htmlspecialchars($s['name']) ?></option>
<?php endforeach; ?>
</select>
<input type="date" name="visit_date" value="<?= date('Y-m-d') ?>" required>
<select name="status" required>
<option value="came">Пришёл</option>
<option value="absent">Не пришёл</option>
<option value="warned">Предупредил</option>
</select>
<button>Сохранить</button>
</form>

<table>
<tr><th>Дата</th><th>Ученик</th><th>Статус</th></tr>
<?php foreach ($visits as $v): ?>
<tr>
<td><?= htmlspecialchars($v['visit_date']) ?></td>
<td><?= htmlspecialchars($v['name']) ?></td>
<td><?= htmlspecialchars($v['status']) ?></td>
</tr>
<?php endforeach; ?>
</table>
</section>

<section>
<h2>Оплата</h2>
<form method="post">
<input type="hidden" name="action" value="add_payment">
<select name="student_id" required>
<option value="">Выберите ученика</option>
<?php foreach ($students as $s): ?>
<option value="<?= $s['id'] ?>"><?= htmlspecialchars($s['name']) ?></option>
<?php endforeach; ?>
</select>
<input type="date" name="pay_date" value="<?= date('Y-m-d') ?>" required>
<input type="number" step="0.01" name="amount" placeholder="Сумма" required>
<input name="comment" placeholder="Комментарий">
<button>Добавить оплату</button>
</form>

<p class="total">Всего поступило: <?= number_format($total, 2) ?> ₽</p>

<table>
<tr><th>Дата</th><th>Ученик</th><th>Сумма</th><th>Комментарий</th></tr>
<?php foreach ($payments as $p): ?>
<tr>
<td><?= htmlspecialchars($p['pay_date']) ?></td>
<td><?= htmlspecialchars($p['name']) ?></td>
<td><?= number_format($p['amount'], 2) ?> ₽</td>
<td><?= htmlspecialchars($p['comment']) ?></td>
</tr>
<?php endforeach; ?>
</table>
</section>

</main>
</body>
</html>
Views: 5
Open in MAX Report an inaccuracy

Report an inaccuracy

Describe what needs fixing. If you have a source, add a link.

You are leaving datool.ru

The link leads to an external website. datool.ru is not responsible for its content — check the address before entering passwords or payment details.

Redirecting in 10 s

Go