File manager - Edit - /home/webtrixia/mynetronix.webtrixia.com/pay.php
Back
<?php require_once __DIR__ . '/includes/config.php'; require_once __DIR__ . '/includes/db.php'; require_once __DIR__ . '/includes/auth.php'; require_once __DIR__ . '/includes/epay.php'; require_once __DIR__ . '/includes/layout.php'; $client = require_client(); $eur = number_format($client['price_bgn'] / BGN_EUR, 2); $invoice_id = 'INV-' . $client['client_number'] . '-' . date('Ym') . '-' . time(); $descr = 'Абонамент ' . $client['package'] . ' — ' . date('m.Y'); $epay_form = epay_build_form($client, (float)$client['price_bgn'], $invoice_id, $descr); page_header('Плащане'); ?> <div class="breadcrumb"><a href="<?= SITE_URL ?>/dashboard.php">🏠 Начало</a> › 💳 Плащане</div> <div class="page-title">💳 Плащане на абонамент</div> <div style="display:grid;grid-template-columns:1fr 1fr;gap:20px"> <div class="card"> <div class="card-header">📋 Детайли за плащане</div> <div class="card-body"> <div class="info-list"> <div class="info-row"> <span class="info-label">Клиент</span> <span class="info-value"><?= htmlspecialchars($client['name']) ?></span> </div> <div class="info-row"> <span class="info-label">Клиентски №</span> <span class="info-value"><?= htmlspecialchars($client['client_number']) ?></span> </div> <div class="info-row"> <span class="info-label">Пакет</span> <span class="info-value"><?= htmlspecialchars($client['package'] ?: '—') ?></span> </div> <div class="info-row"> <span class="info-label">Период</span> <span class="info-value"><?= date('m.Y') ?></span> </div> <div class="info-row"> <span class="info-label">Сума</span> <span class="info-value" style="font-size:20px;color:#e20116"> <?= $eur ?> € <small style="font-size:12px;color:#888">(<?= number_format($client['price_bgn'],2) ?> лв.)</small> </span> </div> <div class="info-row"> <span class="info-label">Фактура №</span> <span class="info-value" style="font-size:12px"><?= $invoice_id ?></span> </div> </div> </div> </div> <div class="card"> <div class="card-header blue">💳 Метод на плащане</div> <div class="card-body"> <div class="price-box" style="margin-bottom:20px"> <div class="price-big"><?= $eur ?> €</div> <div class="price-eur"><?= number_format($client['price_bgn'],2) ?> лв.</div> </div> <?= $epay_form ?> <div style="margin-top:16px;padding:14px;background:#f8f9fa;border-radius:10px;font-size:13px;color:#666"> 🔒 Плащането се извършва през защитената платформа на <strong>ePay.bg</strong>. Поддържа се плащане с <strong>карта (Visa/Mastercard)</strong> и <strong>интернет банкиране</strong>. </div> </div> </div> </div> <!-- Payment history --> <div class="card" style="margin-top:20px"> <div class="card-header dark">📜 История на плащанията</div> <div class="card-body" style="padding:0"> <?php $pays = db()->prepare("SELECT * FROM payments WHERE client_id=? ORDER BY created_at DESC LIMIT 20"); $pays->execute([$client['id']]); $rows = $pays->fetchAll(); if ($rows): ?> <table class="tbl"> <thead> <tr> <th>Фактура №</th><th>Сума</th><th>Статус</th><th>Дата</th><th>Платено на</th> </tr> </thead> <tbody> <?php foreach ($rows as $r): ?> <tr> <td><?= htmlspecialchars($r['invoice_id']) ?></td> <td><strong><?= number_format($r['amount_eur'],2) ?> €</strong><br> <small><?= number_format($r['amount_bgn'],2) ?> лв.</small></td> <td><span class="badge badge-<?= $r['status'] ?>"><?= $r['status'] ?></span></td> <td><?= $r['created_at'] ?></td> <td><?= $r['paid_at'] ?: '—' ?></td> </tr> <?php endforeach; ?> </tbody> </table> <?php else: ?> <div class="empty-state"><div class="empty-icon">💳</div><p>Все още няма плащания</p></div> <?php endif; ?> </div> </div> <?php page_footer(); ?>
| ver. 1.4 |
Github
|
.
| PHP 8.2.31 | Generation time: 0 |
proxy
|
phpinfo
|
Settings