Invalid plan type selected!"; } else { // Generate the two 4-character serial segments $serial1 = generate_random_alphanumeric(4); $serial2 = generate_random_alphanumeric(4); // Assemble the full license key $license_key = "WBPN-{$plan_code}-{$serial1}-{$serial2}"; try { // Prepare and execute the SQL query to insert the new key into the 'licenses' table // The status is initially 'inactive' as it hasn't been activated by a plugin installation yet. $stmt = $pdo->prepare("INSERT INTO licenses (license_key, plan_type, serial1, serial2, status) VALUES (?, ?, ?, ?, 'inactive')"); $stmt->execute([$license_key, $plan_code, $serial1, $serial2]); // Set success message and store the generated key for display $message = "
Key generated and saved: " . htmlspecialchars($license_key) . "
"; $generated_key = $license_key; } catch (PDOException $e) { // Handle database errors if ($e->getCode() == 23000) { // SQLSTATE for Duplicate entry (unlikely for random keys, but good to catch) $message = "
Error: Generated key already exists (unlikely, but retry).
"; } else { $message = "
Database error: " . $e->getMessage() . "
"; } } } } ?> Webpinn POS License Key Generator

Webpinn POS License Key Generator


Existing Licenses (Recently Generated)

query("SELECT license_key, plan_type, status, activated_on_domain, expiry_date, created_at FROM licenses ORDER BY created_at DESC LIMIT 20"); $licenses = $stmt->fetchAll(); if ($licenses) { foreach ($licenses as $license) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } } else { echo ""; } ?>
Key Plan Status Domain Expires Created
" . htmlspecialchars($license['license_key']) . "" . htmlspecialchars($license['plan_type']) . "" . htmlspecialchars($license['status']) . "" . htmlspecialchars($license['activated_on_domain'] ?? 'N/A') . "" . ($license['expiry_date'] ? htmlspecialchars(date('Y-m-d', strtotime($license['expiry_date']))) : 'N/A') . "" . htmlspecialchars(date('Y-m-d H:i', strtotime($license['created_at']))) . "
No licenses found.