($response !== 'NOK'), 'response' => $response]); } else { header('Content-Type: application/json'); echo json_encode(['success' => false, 'error' => 'Not allowed']); } exit; } } catch (Exception $e) { header('Content-Type: application/json'); echo json_encode(['error' => 'Server error', 'message' => $e->getMessage()]); exit; } } //GET PARAMETERS $pagination_page = isset($_GET['p']) ? $_GET['p'] : 1; $status = isset($_GET['status']) ? '&status='.$_GET['status'] : ''; $search = isset($_GET['search']) ? '&search='.$_GET['search'] : ''; // Determine the URL $url = 'index.php?page=licenses'.$status.$search; //GET Details from URL $GET_VALUES = urlGETdetails($_GET) ?? ''; //CALL TO API $api_url = '/v2/products_software_licenses/'.$GET_VALUES; $responses = ioServer($api_url,''); //Decode Payload if (!empty($responses)){$responses = json_decode($responses);}else{$responses = null;} //Return QueryTotal from API $api_url = '/v2/products_software_licenses/'.$GET_VALUES.'&totals='; $query_total = ioServer($api_url,''); //Decode Payload if (!empty($query_total)){$query_total = json_decode($query_total,);}else{$query_total = null;} // Handle success messages if (isset($_GET['success_msg'])) { if ($_GET['success_msg'] == 1) { $success_msg = 'Licenses created successfully!'; } if ($_GET['success_msg'] == 2) { $success_msg = 'License updated successfully!'; } if ($_GET['success_msg'] == 3) { $success_msg = 'License deleted successfully!'; } } // Get software versions for dropdown $api_url = '/v2/products_software_versions/list=&status=1'; $software_versions = ioServer($api_url,''); if (!empty($software_versions)){$software_versions = json_decode($software_versions);}else{$software_versions = null;} template_header('Licenses', 'licenses','view'); $view = '
Manage and create software licenses for devices
'.$success_msg.'
| License Key | Software Version | Status | Transaction ID | Starts At | Expires | Assigned To (Serial) |
|---|---|---|---|---|---|---|
| No licenses found | ||||||
| '.$response->license_key.' | '.$response->version_name.' | '.$status_text.' | '.($response->transaction_id ?? '-').' | '.$starts_display.' | '.$expires_display.' | '.($response->assigned_serial ?? '-').' |