License Admin

Enter password to manage licenses

Invalid password. Please try again.
getMessage()); } $message = ''; $error = ''; // Handle Actions if ($_SERVER['REQUEST_METHOD'] === 'POST') { try { if (isset($_POST['action'])) { switch ($_POST['action']) { case 'toggle_status': $id = (int)$_POST['id']; $new_status = $_POST['status'] === 'active' ? 'suspended' : 'active'; $stmt = $pdo->prepare("UPDATE licenses SET status = ? WHERE id = ?"); $stmt->execute([$new_status, $id]); $message = "License status updated to $new_status."; break; case 'delete_license': $id = (int)$_POST['id']; $stmt = $pdo->prepare("DELETE FROM licenses WHERE id = ?"); $stmt->execute([$id]); $message = "License deleted successfully."; break; case 'issue': $prefix = strtoupper(trim($_POST['prefix'] ?? 'FLAT')); $max_activations = (int)($_POST['max_activations'] ?? 1); $max_counters = (int)($_POST['max_counters'] ?? 1); $owner = trim($_POST['owner'] ?? ''); $address = trim($_POST['address'] ?? ''); // Generate key $key = $prefix . '-' . strtoupper(bin2hex(random_bytes(2))) . '-' . strtoupper(bin2hex(random_bytes(2))) . '-' . strtoupper(bin2hex(random_bytes(2))); $stmt = $pdo->prepare("INSERT INTO licenses (license_key, max_activations, max_counters, owner, address, status) VALUES (?, ?, ?, ?, ?, 'active')"); $stmt->execute([$key, $max_activations, $max_counters, $owner, $address]); $message = "New license issued successfully: $key"; break; } } } catch (Exception $e) { $error = "Operation failed: " . $e->getMessage(); } } // Fetch Licenses try { $licenses = $pdo->query("SELECT * FROM licenses ORDER BY created_at DESC")->fetchAll(); } catch (Exception $e) { $licenses = []; $error = "Failed to fetch licenses: " . $e->getMessage(); } ?> Manage Licenses | Admin Panel
Licenses Dashboard
License Key Owner & Notes Machines Counters Status Created Actions
prepare("SELECT COUNT(*) FROM activations WHERE license_id = ?"); $stmt->execute([$l['id']]); $count = $stmt->fetchColumn(); } catch (Exception $e) { $count = 0; } $max = $l['max_activations'] ?: 1; $percent = ($count / $max) * 100; $bar_color = $percent >= 100 ? 'bg-danger' : ($percent >= 80 ? 'bg-warning' : 'bg-success'); ?>
/
Limit
Fingerprint Domain / Product Activated Date

No machines currently activated.

No licenses found in the database.