Файловый менеджер - Редактировать - /var/www/jonas-eriksen.dk/admin/subscription.php
Назад
<?php require_once('../include.php'); error_reporting(0); $admin = new admin($db); $admin->passwordResetCheck(); $user = new user($db); if (!$admin->admin_level(0)) { header("location: /static/401.php"); die(); } $stmt = $db->prepare("SELECT cpr, shooterId, fullname, adress, birthday, phone, email, subscriptionPaid, ownWeapon, id FROM result_users WHERE subscriptionPaid = 0 AND isDeleted != 1"); $stmt->execute(); if (isset($_POST['reset'])) { $stmt = $db->prepare("SELECT id FROM result_users WHERE subscriptionPaid = 1"); $stmt->execute(); foreach ($stmt->fetchAll() as $row) { $user->updateSubcription($row[0], 0); } $admin->redirect('/admin/subscription.php'); } if ($_POST) { if (isset($_POST['cross'])) { $user->updateSubcription($_POST['cross'], 1); } if (isset($_POST['checkmark'])) { $user->updateSubcription($_POST['checkmark'], 0); } $admin->redirect('/admin/subscription.php'); } include('../static/header.php'); ?> <style> div.container { width: 100%; } </style> <div class="container"> <div class="row"> <div class="col-lg-12"> <h2>Ubetalte kontingenter</h2> <?php if ($admin->admin_level(1)) { ?> <form method="post"> <button name='reset' value='true'>Nulstil alle</button> </form> <?php } ?> <table class="table-bordered" cellspacing="0" width="100%"> <thead> <tr> <th>CPR</th> <th>Skyttenummer</th> <th>Navn</th> <th>Adresse</th> <th>Fødselsdag</th> <th>Telefon</th> <th>Email</th> <th>Kontingent betalt</th> <th>Ejer våben</th> </tr> </thead> <tbody> <?php foreach ($stmt->fetchAll() as $row) { $birthday = date_format(new DateTime($row[4]), 'd-m-Y'); echo "<tr>"; echo "<td>" . decrypt($row[0], $encryptKey) . "</td>"; echo "<td><a href='/user/show.php?user=$row[9]'>$row[1]</a></td>"; echo "<td><a href='/user/show.php?user=$row[9]'>$row[2]</a></td>"; echo "<td>$row[3]</td>"; echo "<td>$birthday</td>"; echo "<td>$row[5]</td>"; echo "<td>$row[6]</td>"; echo "<form method='POST'>"; if ($row[7] == 1) { echo "<td align='center'><button style=\"background-color: white;\" name='checkmark' value='$row[9]'><img src='/static/checkmark.jpeg' alt='Ja' width='40'></button></td>"; } else { echo "<td align='center'><button style=\"background-color: white;\" name='cross' value='$row[9]'><img src='/static/red_cross.jpg' alt='nej' width='40'></button></td>"; } echo "</form>"; if ($row[8] != 0) { echo "<td align='center'><img src='/static/checkmark.jpeg' alt='Ja' width='40'></td>"; } else { echo "<td align='center'><img src='/static/red_cross.jpg' alt='nej' width='40'></td>"; } echo "</tr>"; echo "</tbody>"; } ?> </table> </div> </div> </div>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка