editing license 44
This commit is contained in:
parent
2ab1263a06
commit
e1475a70f5
@ -1,22 +1,12 @@
|
||||
<?php
|
||||
// Configuration for omanaap.cloud
|
||||
// 1. Database Credentials (for the live server)
|
||||
define('DB_HOST', 'localhost');
|
||||
define('DB_NAME', 'u128023052_meezan_license');
|
||||
define('DB_USER', 'u128023052_meezan_license');
|
||||
define('DB_PASS', 'Meezan@2026');
|
||||
// Configuration for local VM
|
||||
// 1. Database Credentials (using local project DB)
|
||||
require_once __DIR__ . '/../db/config.php';
|
||||
|
||||
// 2. The Secret Key (Just the code, not the command)
|
||||
// 2. The Secret Key
|
||||
define('SERVER_SECRET', '1485-5215-2578');
|
||||
|
||||
// Overwrite DB constants if needed, or just use the db() function.
|
||||
function db_manager() {
|
||||
static $pdo;
|
||||
if (!$pdo) {
|
||||
$dsn = "mysql:host=" . DB_HOST . ";dbname=" . DB_NAME . ";charset=utf8mb4";
|
||||
$pdo = new PDO($dsn, DB_USER, DB_PASS, [
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||
]);
|
||||
}
|
||||
return $pdo;
|
||||
return db();
|
||||
}
|
||||
|
||||
@ -106,12 +106,24 @@ $licenses = $pdo->query("SELECT * FROM licenses ORDER BY created_at DESC")->fetc
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css">
|
||||
<style>
|
||||
body { background: #f8f9fa; }
|
||||
.navbar { background: #1e293b; }
|
||||
.card { border: none; box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); border-radius: 0.5rem; }
|
||||
.status-active { color: #10b981; }
|
||||
.status-suspended { color: #ef4444; }
|
||||
.table thead th { background: #f1f5f9; border-top: none; }
|
||||
body { background: #f1f5f9; font-family: 'Inter', system-ui, -apple-system, sans-serif; }
|
||||
.navbar { background: #0f172a; padding: 1rem 0; box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1); }
|
||||
.navbar-brand { font-weight: 700; letter-spacing: -0.025em; }
|
||||
.card { border: none; border-radius: 0.75rem; box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); }
|
||||
.card-header { background-color: #fff; border-bottom: 1px solid #e2e8f0; font-weight: 600; padding: 1.25rem; }
|
||||
.form-label { font-weight: 500; color: #475569; font-size: 0.875rem; }
|
||||
.form-control, .form-select { border-radius: 0.5rem; border: 1px solid #cbd5e1; padding: 0.625rem 0.875rem; }
|
||||
.form-control:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }
|
||||
.btn-primary { background-color: #2563eb; border: none; padding: 0.625rem 1.25rem; font-weight: 600; border-radius: 0.5rem; transition: all 0.2s; }
|
||||
.btn-primary:hover { background-color: #1d4ed8; transform: translateY(-1px); }
|
||||
.status-active { background: #dcfce7; color: #166534; padding: 0.25rem 0.75rem; border-radius: 1rem; font-size: 0.75rem; font-weight: 600; }
|
||||
.status-suspended { background: #fee2e2; color: #991b1b; padding: 0.25rem 0.75rem; border-radius: 1rem; font-size: 0.75rem; font-weight: 600; }
|
||||
.table thead th { text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05em; color: #64748b; background: #f8fafc; padding: 1rem; }
|
||||
.table tbody td { padding: 1rem; vertical-align: middle; border-bottom: 1px solid #f1f5f9; }
|
||||
code { background: #f1f5f9; color: #0f172a; padding: 0.25rem 0.5rem; border-radius: 0.375rem; font-weight: 500; }
|
||||
.modal-content { border: none; border-radius: 1rem; }
|
||||
.modal-header { border-bottom: 1px solid #f1f5f9; padding: 1.5rem; }
|
||||
.modal-footer { border-top: 1px solid #f1f5f9; padding: 1.5rem; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@ -187,24 +199,31 @@ $licenses = $pdo->query("SELECT * FROM licenses ORDER BY created_at DESC")->fetc
|
||||
<?php foreach ($licenses as $l): ?>
|
||||
<tr>
|
||||
<td><code><?= htmlspecialchars($l['license_key']) ?></code></td>
|
||||
<td class="small"><?= htmlspecialchars($l['owner'] ?? '-') ?></td>
|
||||
<td><span class="text-secondary small"><?= htmlspecialchars($l['owner'] ?: 'N/A') ?></span></td>
|
||||
<td>
|
||||
<?php
|
||||
$stmt = $pdo->prepare("SELECT COUNT(*) FROM activations WHERE license_id = ?");
|
||||
$stmt->execute([$l['id']]);
|
||||
$count = $stmt->fetchColumn();
|
||||
$percent = ($l['max_activations'] > 0) ? ($count / $l['max_activations']) * 100 : 0;
|
||||
$bar_class = $percent >= 100 ? 'bg-danger' : ($percent >= 80 ? 'bg-warning' : 'bg-success');
|
||||
?>
|
||||
<span class="fw-bold"><?= $count ?></span> / <?= $l['max_activations'] ?>
|
||||
<div class="d-flex align-items-center">
|
||||
<span class="me-2 fw-bold"><?= $count ?>/<?= $l['max_activations'] ?></span>
|
||||
</div>
|
||||
<div class="progress mt-1" style="height: 4px; width: 60px;">
|
||||
<div class="progress-bar <?= $bar_class ?>" role="progressbar" style="width: <?= min(100, $percent) ?>%"></div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<span class="fw-bold"><?= $l['max_counters'] ?? 0 ?></span>
|
||||
<span class="badge bg-light text-dark border"><?= $l['max_counters'] ?? 0 ?></span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="status-<?= $l['status'] ?>">
|
||||
<i class="bi bi-circle-fill small me-1"></i> <?= ucfirst($l['status']) ?>
|
||||
<?= ucfirst($l['status']) ?>
|
||||
</span>
|
||||
</td>
|
||||
<td class="small text-muted"><?= date('M d, Y', strtotime($l['created_at'])) ?></td>
|
||||
<td class="small text-muted"><?= date('M d, y', strtotime($l['created_at'])) ?></td>
|
||||
<td class="text-end">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-outline-info btn-sm" data-bs-toggle="modal" data-bs-target="#modal-<?= $l['id'] ?>" title="View Activations">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user