$stock) { $stockName = $stock['stock']; $cleanName = cleanStockSymbol($stockName); $safeName = safeFieldName($stockName); // FIX: Create safe version for form field // --- Update exchange market if provided --- // FIX: Look for the safe field name (PNG_V instead of PNG.V) if (isset($_POST['exchange_' . $safeName])) { $newExchange = trim($_POST['exchange_' . $safeName]); if ($newExchange !== '') { $updatedStocks[$index]['exchange_market'] = $newExchange; } } // --- Cyclic & volatile attributes --- $stockAttrs = []; // Cyclic setting (including 'memestock') if (isset($_POST['cyclic_' . $cleanName])) { $cyclicValue = $_POST['cyclic_' . $cleanName]; if ($cyclicValue !== 'none') { $stockAttrs['cyclic'] = $cyclicValue; } } // Volatile setting if (isset($_POST['volatile_' . $cleanName])) { $volatileValue = $_POST['volatile_' . $cleanName]; if ($volatileValue !== 'none') { $stockAttrs['volatile'] = $volatileValue; } } if (!empty($stockAttrs)) { $newAttributes[$cleanName] = $stockAttrs; } } // Save updated stocks.json file_put_contents($stocksFile, json_encode($updatedStocks, JSON_PRETTY_PRINT)); // Save stockattributes.json file_put_contents($attributesFile, json_encode($newAttributes, JSON_PRETTY_PRINT)); // Reload data for display $originalStocks = $updatedStocks; $displayStocks = array_reverse($originalStocks); $attributes = $newAttributes; echo "

✓ Attributes and exchange markets saved successfully!

"; } ?> Stock Attributes Manager

Stock Attributes Manager

Configure cyclic (including memestock), volatility, and exchange market for each stock.

Underlined stocks have an ISIN field.

Stock Symbol Cleaned Symbol Price Currency Date Exchange Market
(editable)
Cyclic Setting Volatile


Current Stock Attributes (stockattributes.json)

No attributes saved yet.

$attrs): ?>
Stock (Cleaned) Cyclic Setting Volatile

Raw JSON: