Advertisement
plirof2

SGD-md008a9untested_phpdesktopONLY.php 241126

Nov 20th, 2024 (edited)
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /*
  3. v008a5 - QAOP running (Case sensitive - Must do a search to check capitalazation in filesystem)
  4. v008a4 - Fixed BUG008a2 . Now filtered games are saved correctly
  5. v008a3 - Fixed Memrory and Score alligment issues after update
  6. v008a2 - BUG008a2 when you modify a game that was filtered it clones it.
  7. v008a - Filter works, pathIndex shows (needs SGD.ini)
  8. v007a2 241120b
  9.  
  10.  
  11. */
  12.  
  13.  
  14. $host = $_SERVER['HTTP_HOST'];
  15.  
  16. //$dat_file='SGD_sample.dat';
  17. //$dat_file='/opt/lampp/htdocs/zx/ROMSMINE/_SGD304/Arcade4.dat';
  18. $dat_file='ROMSMINE/_SGD304/Arcade4.dat';
  19. #$qaopURL='http://localhost/zx/QAOP/qaop.html';
  20. $qaopURL='QAOP/qaop.html';
  21. $snapPATH="ROMSMINE/";
  22. //$snapsURL='http://localhost/zx/'.$snapPATH;
  23. $snapsURL='http://'.$host.'/zx/'.$snapPATH;
  24. $SGDfilePathPrefix='E:\\\OPT\\\SPECTRUM\\\ROMSMINE';
  25.  
  26. //$iniFilePath = '/opt/lampp/htdocs/zx/ROMSMINE/_SGD304/sgd.ini';
  27. $iniFilePath = 'ROMSMINE/_SGD304/sgd.ini';
  28. //echo "</td><td><a href=".$qaopURL."?#l=".$snapsURL.get_path($fields[4]).$fields[4]. ">".$fields[4]."</a> "; //added Letter path ROMSMINE
  29.  
  30.  
  31.  
  32.  
  33. //==========get SGD.ini paths :=======================
  34.  
  35. // Define the path to your .ini file
  36.  
  37.  
  38. // Define the new prefix you want to set
  39. $newPrefix = 'NEW_PREFIX_FOR_PATH'; // Change this to what you need
  40.  
  41. // Initialize an array to hold the GameDir paths
  42. $gameDirs = [];
  43.  
  44. // Open the file for reading
  45. if ($fileHandle = fopen($iniFilePath, 'r')) {
  46.     // Read each line of the file
  47.     while (($line = fgets($fileHandle)) !== false) {
  48.         // Trim whitespace from the line
  49.         $line = trim($line);
  50.        
  51.         // Check if the line starts with 'GameDir'
  52.         if (strpos($line, 'GameDir') === 0) {
  53.             // Extract the path after the '=' sign
  54.             $parts = explode('=', $line);
  55.             if (count($parts) === 2) {
  56.                 $path = trim($parts[1]);
  57.                 // Adjust path with the new prefix
  58.                 ///$newPath = preg_replace('/^E:\\OPT\\SPECTRUM\\ROMSMINE\\/', $newPrefix . '\\', $path);
  59.                 // Store the modified path
  60.                 $gameDirs[]=$path;
  61.                 //$gameDirs[] = $newPath;
  62.             }
  63.         }
  64.     }
  65.     // Close the file handle
  66.     fclose($fileHandle);
  67. } else {
  68.     echo "Unable to open the file.";
  69. }
  70. // Convert PHP array to JSON
  71. $jsonGameDirs = json_encode($gameDirs);
  72.  
  73. // Output the modified GameDir paths
  74. foreach ($gameDirs as $gameDir) {
  75.     //echo $gameDir . PHP_EOL."<BR>";
  76. }
  77.  
  78. //==END of========get SGD.ini paths :=======================
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90. // Database field definitions
  91. $fieldDefinitions = [
  92.     'Name' => ['start' => 1, 'length' => 36],
  93.     'Year' => ['start' => 38, 'length' => 4],
  94.     'Publisher' => ['start' => 43, 'length' => 36],
  95.     'Memory' => ['start' => 80, 'length' => 3],
  96.     'NoOfPlayers' => ['start' => 84, 'length' => 1],    
  97.     'Together' => ['start' => 86, 'length' => 1],
  98.     'Joysticks' => ['start' => 88, 'length' => 5],
  99.     'PC-Name' => ['start' => 94, 'length' => 12],
  100.     'Type' => ['start' => 107, 'length' => 7],
  101.     'PathIndex' => ['start' => 115, 'length' => 3],
  102.     'FileSize' => ['start' => 119, 'length' => 7],
  103.     'Orig_screen' => ['start' => 127, 'length' => 1],
  104.     'Origin' => ['start' => 129, 'length' => 1],
  105.     'FloppyId' => ['start' => 131, 'length' => 4],
  106.     'Emul_override' => ['start' => 136, 'length' => 2],
  107.     'AYSound' => ['start' => 139, 'length' => 1],
  108.     'MultiLoad' => ['start' => 141, 'length' => 1],
  109.     'Language' => ['start' => 143, 'length' => 3],
  110.     'Score' => ['start' => 147, 'length' => 3],
  111.     'Author' => ['start' => 151, 'length' => 100],
  112.  
  113.  
  114. ];
  115.  
  116. // Helper function to extract a field from a line
  117. /* ORIGINAL
  118. function getField($line, $field) {
  119.     global $fieldDefinitions;
  120.     $start = $fieldDefinitions[$field]['start'];
  121.     $length = $fieldDefinitions[$field]['length'];
  122.     return trim(substr($line, $start - 1, $length));
  123. } */
  124.  
  125. // Helper function to extract a field from a line
  126. function getField($line, $field) {
  127.     global $fieldDefinitions;
  128.     $start = $fieldDefinitions[$field]['start'];
  129.     $length = $fieldDefinitions[$field]['length'];
  130.  
  131.     // Special case for Memory field, pad it to the left with spaces if needed
  132.     if ($field === 'Memory' || $field === 'Score' ) {
  133.         $value = trim(substr($line, $start - 1, $length));
  134.         return str_pad($value, 3, ' ', STR_PAD_LEFT); // Ensure it is always 3 characters and right-aligned
  135.     }
  136.     if ($field === 'FloppyId') {
  137.         $value = trim(substr($line, $start - 1, $length));
  138.         return str_pad($value, 4, ' ', STR_PAD_LEFT); // Ensure it is always 3 characters and right-aligned
  139.     }
  140.     if ($field === 'FileSize') {
  141.         $value = trim(substr($line, $start - 1, $length));
  142.         return str_pad($value, 7, ' ', STR_PAD_LEFT); // Ensure it is always 3 characters and right-aligned
  143.     }    
  144.  
  145.  
  146.  
  147.     return trim(substr($line, $start - 1, $length));
  148. }//end ofgetField
  149.  
  150. //Get the filename with correct case from the filesystem
  151. function getActualFileName($dir, $filename) {
  152.     // Scan the directory
  153.     $files = scandir($dir);
  154.  
  155.     // Iterate through the files in the directory
  156.     foreach ($files as $file) {
  157.         // Check if the file matches the name exactly (case-sensitive)
  158.         if (strtolower($file) == strtolower($filename)) {
  159.             return $file; // Return the actual filename with correct capitalization
  160.         }
  161.     }
  162.     return false; // Return false if the file doesn't exist
  163. }
  164.  
  165.  
  166. // Read the file and build the games list
  167. $file = fopen($dat_file, 'r');
  168. $games = [];
  169. while (($line = fgets($file)) !== false) {
  170.     $game = [];
  171.     foreach ($fieldDefinitions as $field => $definition) {
  172.         $game[$field] = getField($line, $field);
  173.     }
  174.     $games[] = $game;
  175. }
  176. fclose($file);
  177.  
  178. // Handle game update via POST
  179. if ($_SERVER['REQUEST_METHOD'] === 'POST') {
  180.     $gameData = $_POST;
  181.     $lineIndex = $gameData['lineIndex']; // Index of the game to update
  182.     unset($gameData['lineIndex']); // Remove the lineIndex from POST data
  183.  
  184.     // Update the game data logic here
  185.     $fileLines = file($dat_file);
  186.     $lineToUpdate = $fileLines[$lineIndex];
  187.     foreach ($fieldDefinitions as $field => $definition) {
  188.         $start = $definition['start'] - 1;
  189.         $length = $definition['length'];
  190.         $lineToUpdate = substr_replace($lineToUpdate, str_pad($gameData[$field], $length), $start, $length);
  191.     }
  192.     $fileLines[$lineIndex] = $lineToUpdate;
  193.     file_put_contents($dat_file, implode('', $fileLines));
  194.  
  195.     // Return the updated game as well
  196.     $updatedGame = [];
  197.     foreach ($fieldDefinitions as $field => $definition) {
  198.         $updatedGame[$field] = $gameData[$field];
  199.     }
  200.    
  201.     echo json_encode(['status' => 'success', 'updatedGame' => $updatedGame, 'lineIndex' => $lineIndex]);
  202.     exit;
  203. }
  204. ?>
  205. <!DOCTYPE html>
  206. <html lang="en">
  207. <head>
  208.     <meta charset="UTF-8">
  209.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  210.     <title>Game Database</title>
  211.     <style>
  212.         body {
  213.             display: flex;
  214.             margin: 0;
  215.             #font-family: Arial, sans-serif;
  216.             background-color: lightgrey;
  217.             font-family: "Courier New", Courier, monospace;
  218.         }
  219.         #left-panel, #right-panel {
  220.             padding: 20px;
  221.             overflow-y: auto;
  222.         }
  223.         #left-panel {
  224.             width: 60%;
  225.             border-right: 1px solid #ccc;
  226.             background-color: lightgrey;
  227.         }
  228.         #right-panel {
  229.             #flex: 1;
  230.             position: fixed;
  231.             top: 10px; /* Distance from the top */
  232.             right: 10px; /* Distance from the right */
  233.             background-color: gainsboro; /* Semi-transparent background */
  234.             border: 1px solid #ccc;
  235.             padding: 10px;
  236.             box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  237.             z-index: 1000; /* Make sure it appears above other content */
  238.             max-height: calc(100vh - 20px); /* max height minus top and bottom offsets */
  239.             overflow-y: auto; /* Enable vertical scrolling when needed */
  240.         }
  241.         .game-item {
  242.             padding: 10px;
  243.             border-bottom: 1px solid #ddd;
  244.             cursor: pointer;
  245.         }
  246.         .game-item:hover {
  247.             background-color: #eee;
  248.         }
  249.         .game-item.active {
  250.             background-color: #dcdcdc;
  251.         }
  252.         .form-field {
  253.             margin-bottom: 10px;
  254.         }
  255.         .form-field label {
  256.             font-weight: bold;
  257.         }
  258.         .form-field input, .form-field textarea {
  259.             padding: 8px;
  260.             border: 1px solid #ddd;
  261.             border-radius: 4px;
  262.             background-color: Silver;
  263.         }
  264.         table {
  265.             width: 100%;
  266.             border-collapse: collapse;
  267.         }
  268.         th, td {
  269.             text-align: left;
  270.             padding: 8px;
  271.         }
  272.         th {
  273.             background-color: #f2f2f2;
  274.         }
  275.     </style>
  276.     <script>
  277.         // Assign the PHP JSON array to a JavaScript variable
  278.         const gameDirs = <?php echo $jsonGameDirs; ?>;
  279.         selectedGameDirectoryDisplay=''; //This variable will be used in file opening
  280.         // Now you can use `gameDirs` in your JavaScript code
  281.         //console.log(gameDirs);
  282.         // Function to update display based on PathIndex input
  283.         function updateGameDirectoryDisplay() {
  284.             const pathIndex = document.getElementById('PathIndex').value;
  285.             const displayElement = document.getElementById('gameDirectoryDisplay');
  286.             //console.log('updateGameDirectoryDisplay()');
  287.             // Validate the input to ensure it's a valid index
  288.             const index = parseInt(pathIndex, 10);
  289.             if (!isNaN(index) && index >= 0 && index < gameDirs.length) {
  290.                 displayElement.textContent = gameDirs[index]; // Display the corresponding game directory
  291.                 selectedGameDirectoryDisplay =gameDirs[index];
  292.             } else {
  293.                 displayElement.textContent = 'Invalid index'; // Show an error message
  294.             }
  295.         }
  296.     </script>
  297.  
  298.     <script>
  299. document.addEventListener('DOMContentLoaded', () => {
  300.     const gameItems = document.querySelectorAll('.game-item');
  301.     const form = document.getElementById('game-form');
  302.     const fields = <?php echo json_encode(array_keys($fieldDefinitions)); ?>;
  303.     const gameImage = document.getElementById('game-screenshot');
  304.     const gameImageContainer = document.getElementById('game-image');
  305.     const filterInput = document.getElementById('filter-input');
  306.     const filterSelect = document.getElementById('filter-select');
  307.     const toggleRightPanelButton = document.getElementById('toggle-right-panel');
  308.     const rightPanel = document.getElementById('right-panel');
  309.     const originalGames = <?php echo json_encode($games); ?>; // Store the original games from the PHP response
  310.     const host='<?php echo $host; ?>';
  311.  
  312.     // Attach click handlers to game items
  313.     gameItems.forEach(item => {
  314.         item.addEventListener('click', () => {
  315.             // Remove active class from all items
  316.             document.querySelectorAll('.game-item').forEach(i => i.classList.remove('active'));
  317.             item.classList.add('active');
  318.  
  319.             // Load game data into form
  320.             const gameData = JSON.parse(item.dataset.game);
  321.             fields.forEach(field => {
  322.                 const input = form.querySelector(`[name="${field}"]`);
  323.                 if (input) input.value = gameData[field];
  324.             });
  325.             form.querySelector('[name="lineIndex"]').value = item.dataset.index; // Store the index for the form submission
  326.  
  327.             // Load and display the game image
  328.             const pcName = gameData['PC-Name']; // Get the PC-Name from the game data
  329.             //imagePath = `SCRSHOT/${pcName}.gif`; // Create the image path
  330.             myimagename=pcName.slice(0, -4).toUpperCase().replace(/\s+/g, '');
  331.             //imagePath = `INLAYS/${pcName}.GIF`; // Create the image path
  332.            
  333.            // mypath="scr2png.php?scrimg="+'ROMSMINE/R/SCRSHOT/'+myimagename+".SCR"; //'ROMSMINE/R/INLAYS/'+myimagename+'.GIF'; // Create the image path
  334.             mypath='ROMSMINE/R/INLAYS/'+myimagename+'.GIF'; // Create the image path
  335.             imagePath = "http://"+host+'/'+mypath; // Create the image path
  336.             console.log("============line335:===== imagepath="+imagePath);
  337.  
  338.             // Set the image source
  339.             gameImage.src = imagePath;
  340.            
  341.             // Check if the image exists, then display it
  342.             const img = new Image();
  343.             img.onload = () => {
  344.                 gameImage.style.display = 'block'; // Show the image if it loads
  345.                 gameImage.src = imagePath; // Set the image source
  346.             };
  347.             img.onerror = () => {
  348.                 gameImage.style.display = 'none'; // Hide image if it doesn't exist
  349.             };
  350.             img.src = imagePath; // Trigger the image load
  351.             updateGameDirectoryDisplay();//console.log("updateGameDirectoryDisplay();");
  352.         });
  353.     });
  354.  
  355.     // Handle form submission
  356.     form.addEventListener('submit', (e) => {
  357.         e.preventDefault();
  358.         const formData = new FormData(form);
  359.  
  360.         fetch('', {
  361.             method: 'POST',
  362.             body: formData
  363.         })
  364.         .then(response => response.json())
  365.         .then(data => {
  366.             if (data.status === 'success') {
  367.                 // Update the left panel with the updated game
  368.                 const updatedGame = data.updatedGame;
  369.                 const lineIndex = data.lineIndex;
  370.                 const updatedGameItem = document.querySelector(`.game-item[data-index="${lineIndex}"]`);
  371.                 if (updatedGameItem) {
  372.                     updatedGameItem.dataset.game = JSON.stringify(updatedGame);
  373.                     updatedGameItem.querySelector('strong').textContent = updatedGame.Name;
  374.                 }
  375.  
  376.                 alert('Game updated successfully!');
  377.             }
  378.         });
  379.     });
  380.  
  381.    // Filter game list based on multiple input fields
  382.     const nameFilterInput = document.getElementById('nameFilter');
  383.     const typeFilterInput = document.getElementById('typeFilter');
  384.     const yearFilterInput = document.getElementById('yearFilter');
  385.     const firstLetterFilterInput = document.getElementById('firstLetterFilter');
  386.  
  387.     nameFilterInput.addEventListener('input', filterGames);
  388.     typeFilterInput.addEventListener('input', filterGames);
  389.     yearFilterInput.addEventListener('input', filterGames);
  390.     firstLetterFilterInput.addEventListener('input', filterGames);
  391.  
  392.     function filterGames() {
  393.         const nameFilterValue = nameFilterInput.value.toLowerCase();
  394.         const typeFilterValue = typeFilterInput.value.toLowerCase();
  395.         const yearFilterValue = yearFilterInput.value.toLowerCase();
  396.         const firstLetterFilterValue = firstLetterFilterInput.value.toLowerCase();
  397.  
  398.         const filteredGames = originalGames.filter(game => {
  399.             const nameMatch = game.Name.toLowerCase().includes(nameFilterValue);
  400.             const typeMatch = game.Type.toLowerCase().includes(typeFilterValue);
  401.             const yearMatch = game.Year.includes(yearFilterValue);
  402.             const firstLetterMatch = game.Name.toLowerCase().startsWith(firstLetterFilterValue);
  403.  
  404.             return (
  405.                 (nameFilterValue === '' || nameMatch) &&
  406.                 (typeFilterValue === '' || typeMatch) &&
  407.                 (yearFilterValue === '' || yearMatch) &&
  408.                 (firstLetterFilterValue === '' || firstLetterMatch)
  409.             );
  410.         });
  411.  
  412.         // Update the game list in the left panel
  413.         const gameList = document.getElementById('game-list');
  414.         gameList.innerHTML = '';
  415.  
  416.         filteredGames.forEach((game, index) => {
  417.             const gameItem = document.createElement('tr');
  418.             gameItem.classList.add('game-item');
  419.             const originalIndex = originalGames.indexOf(game);
  420.             gameItem.dataset.game = JSON.stringify(game);
  421.             gameItem.dataset.index = originalIndex;
  422.             gameItem.innerHTML = `
  423.                 <td><strong>${game.Name}</strong></td>
  424.                 <td>${game.Type}</td>
  425.                 <td>${game.Year}</td>
  426.                 <td>${game['PC-Name']}</td>
  427.                 <td>${game.Author}</td>
  428.             `;
  429.             gameList.appendChild(gameItem);
  430.  
  431.             // Attach click handler to the newly created item
  432.             gameItem.addEventListener('click', () => {
  433.                 // Remove active class from all items
  434.                 document.querySelectorAll('.game-item').forEach(i => i.classList.remove('active'));
  435.                 gameItem.classList.add('active');
  436.  
  437.                 // Load game data into form
  438.                 const gameData = JSON.parse(gameItem.dataset.game);
  439.                 fields.forEach(field => {
  440.                     const input = form.querySelector(`[name="${field}"]`);
  441.                     if (input) input.value = gameData[field];
  442.                 });
  443.                 form.querySelector('[name="lineIndex"]').value = gameItem.dataset.index; // Store the index for the form submission
  444.  
  445.                 // Load and display the game image
  446.                 const pcName = gameData['PC-Name']; // Get the PC-Name from the game data
  447.                 //const imagePath = `SCRSHOT/${pcName}.gif`; // Create the image path
  448.                 myimagename=pcName.slice(0, -4).toUpperCase().replace(/\s+/g, '');
  449.                 //imagePath = `INLAYS/${pcName}.GIF`; // Create the image path
  450.                 // mypath="scr2png.php?scrimg="+'ROMSMINE/R/SCRSHOT/'+myimagename+".SCR"; //'ROMSMINE/R/INLAYS/'+myimagename+'.GIF'; // Create the image path
  451.                 mypath='ROMSMINE/R/INLAYS/'+myimagename+'.GIF'; // Create the image path
  452.                 imagePath = "http://"+host+'/'+mypath; // Create the image path
  453.                 // Set the image source
  454.                 gameImage.src = imagePath;
  455.  
  456.                 // Check if the image exists, then display it
  457.                 const img = new Image();
  458.                 img.onload = () => {
  459.                     gameImage.style.display = 'block'; // Show the image if it loads
  460.                     gameImage.src = imagePath; // Set the image source
  461.                 };
  462.                 img.onerror = () => {
  463.                     gameImage.style.display = 'none'; // Hide image if it doesn't exist
  464.                 };
  465.                 img.src = imagePath; // Trigger the image load
  466.  
  467.                 // Call to update the game directory display based on the PathIndex
  468.                 updateGameDirectoryDisplay();
  469.             });
  470.         });
  471.     }
  472.  
  473.     // Toggle right panel visibility
  474.     toggleRightPanelButton.addEventListener('click', () => {
  475.         if (rightPanel.style.display === 'none' || rightPanel.style.display === '') {
  476.             rightPanel.style.display = 'block';
  477.         } else {
  478.             rightPanel.style.display = 'none';
  479.         }
  480.     });
  481. });
  482.  
  483. /* Also exists in header (don't know which is used)
  484. function updateGameDirectoryDisplay() {
  485.     const pathIndex = document.getElementById('PathIndex').value;
  486.     const displayElement = document.getElementById('gameDirectoryDisplay');
  487.     //console.log('updateGameDirectoryDisplay()');
  488.     // Validate the input to ensure it's a valid index
  489.     const index = parseInt(pathIndex, 10);
  490.     if (!isNaN(index) && index >= 0 && index < gameDirs.length) {
  491.         displayElement.textContent = gameDirs[index]; // Display the corresponding game directory
  492.         selectedGameDirectoryDisplay=gameDirs[index];
  493.     } else {
  494.         displayElement.textContent = 'Invalid index'; // Show an error message
  495.     }
  496. }
  497. */
  498. function processFilename(str) {
  499.     var SGDfilePathPrefix='<?php echo $SGDfilePathPrefix; ?>';
  500.     var filepath=selectedGameDirectoryDisplay;
  501.     var filepath=selectedGameDirectoryDisplay.replace(SGDfilePathPrefix+'\\', "");
  502.     filepath.replace(/\s+/g, '');
  503.     str=str.replace(/\s+/g, '');// Removes all spaces from the string
  504.     str=filepath+"/"+str;
  505.     str='<?php echo $qaopURL; ?>?#l=<?php echo $snapsURL; ?>'+str;
  506.     console.log("======================================");
  507.     console.log('filepath='+filepath+"____selectedGameDirectoryDisplay="+selectedGameDirectoryDisplay+"_______-SGDfilePathPrefix="+SGDfilePathPrefix+"_____str="+str);
  508.     console.log("======================================");
  509.     return str;
  510.     //return str.replace(/\s+/g, ''); // Removes all spaces from the string
  511. }
  512.  
  513.     </script>
  514. </head>
  515. <body>
  516.     <div id="left-panel">
  517.         <h3>Game List</h3>
  518.  
  519.         <div>
  520.             <input type="text" id="nameFilter" placeholder="Filter by Name">
  521.             <input type="text" id="typeFilter" placeholder="Filter by Type">
  522.             <input type="text" id="yearFilter" placeholder="Filter by Year">
  523.             <input type="text" id="firstLetterFilter" placeholder="Filter by First Letter">
  524.             <BR><button id="toggle-right-panel">Toggle Right Panel</button>
  525.         </div>
  526.  
  527.  
  528.        
  529.         <table id="game-list">
  530.             <thead>
  531.                 <tr>
  532.                     <th>Name</th>
  533.                     <th>Type</th>
  534.                     <th>Year</th>
  535.                     <th>PC-Name</th>
  536.                     <th>Author</th>
  537.                 </tr>
  538.             </thead>
  539.             <tbody>
  540.                 <?php foreach ($games as $index => $game): ?>
  541.                     <tr class="game-item" data-game='<?php echo json_encode($game); ?>' data-index="<?php echo $index; ?>">
  542.                         <td><strong><?php echo htmlspecialchars($game['Name']); ?></strong></td>
  543.                         <td><?php echo htmlspecialchars($game['Type']); ?></td>
  544.                         <td><?php echo htmlspecialchars($game['Year']); ?></td>
  545.                         <td><?php echo htmlspecialchars($game['PC-Name']); ?></td>
  546.                         <td><?php echo htmlspecialchars($game['Author']); ?></td>
  547.                     </tr>
  548.                 <?php endforeach; ?>
  549.             </tbody>
  550.         </table>
  551.     </div>
  552.  
  553.     <div id="right-panel">
  554.         <h3>Game Details</h3>
  555.         <form id="game-form">
  556.             <input type="hidden" name="lineIndex" value="">
  557. <!--
  558.             <button type="button" onclick="window.open('<?php echo $qaopURL; ?>?#l=<?php echo $snapsURL; ?>' + processFilename(document.getElementById('PC-Name').value), '_blank');">PLAY</button>
  559.  
  560.     -->
  561.             <button type="button" onclick="window.open(processFilename(document.getElementById('PC-Name').value), '_blank');">PLAY</button>
  562.  
  563.             <button type="submit">SAVE</button>
  564.  
  565.             <div class="form-field">
  566.                 <label for="Name">Name:</label>
  567.                 <input type="text" id="Name" name="Name" value="" maxlength="36" size="36" />
  568.             </div>
  569.  
  570.             <div class="form-field">
  571.                 <label for="Publisher">Publisher:</label>
  572.                 <input type="text" id="Publisher" name="Publisher" value="" maxlength="36" size="36" />
  573.             </div>
  574.  
  575.             <div class="form-field">
  576.                 <label for="Author">Author:</label>
  577.                 <input type="text" id="Author" name="Author" value="" maxlength="50" size="50" />
  578.             </div>
  579.  
  580.             <div class="form-field"></div>
  581.  
  582.             <div class="form-field">
  583.                 <label for="Year">Year:</label>
  584.                 <input type="text" id="Year" name="Year" value="" maxlength="4" size="4" />
  585.                 <label for="Memory">Memory:</label>
  586.                 <input type="text" id="Memory" name="Memory" value="" maxlength="3" size="3" />
  587.             </div>
  588.  
  589.             <div class="form-field">
  590.                 <label for="NoOfPlayers">NoOfPlayers:</label>
  591.                 <input type="text" id="NoOfPlayers" name="NoOfPlayers" value="" maxlength="1" size="1" />
  592.                 <label for="Together">Together:</label>
  593.                 <input type="text" id="Together" name="Together" value="" maxlength="1" size="1" />
  594.                 <label for="Score">Score:</label>
  595.                 <input type="text" id="Score" name="Score" value="" maxlength="3" size="3" />
  596.             </div>
  597.  
  598.             <div class="form-field">
  599.                 <label for="PC-Name">PC-Name:</label>
  600.                 <input type="text" id="PC-Name" name="PC-Name" value="" maxlength="12" size="12" />
  601.                 <label for="Type">Type:</label>
  602.                 <input type="text" id="Type" name="Type" value="" maxlength="7" size="7" />
  603.             </div>
  604.  
  605.             <div class="form-field">
  606.                 <label for="Joysticks">Joysticks:</label>
  607.                 <input type="text" id="Joysticks" name="Joysticks" value="" maxlength="5" size="5" />
  608.             </div>
  609.  
  610.             <div class="form-field">
  611.                 <label for="Orig_screen">Orig_screen:</label>
  612.                 <input type="text" id="Orig_screen" name="Orig_screen" value="" maxlength="1" size="1" />
  613.                 <label for="Origin">Origin:</label>
  614.                 <input type="text" id="Origin" name="Origin" value="" maxlength="1" size="1" />
  615.             </div>
  616.  
  617.             <div class="form-field">
  618.                 <label for="AYSound">AYSound:</label>
  619.                 <input type="text" id="AYSound" name="AYSound" value="" maxlength="1" size="1" />
  620.                 <label for="MultiLoad">MultiLoad:</label>
  621.                 <input type="text" id="MultiLoad" name="MultiLoad" value="" maxlength="1" size="1" />
  622.                 <label for="FloppyId">FloppyId:</label>
  623.                 <input type="text" id="FloppyId" name="FloppyId" value="" maxlength="4" size="4" />
  624.             </div>
  625.  
  626.             <div class="form-field">
  627.                 <label for="Language">Language:</label>
  628.                 <input type="text" id="Language" name="Language" value="" maxlength="3" size="3" />
  629.                 <label for="Emul_override">Emul_override:</label>
  630.                 <input type="text" id="Emul_override" name="Emul_override" value="" maxlength="2" size="2" />
  631.             </div>
  632.  
  633.             <div class="form-field">
  634.                 <label for="PathIndex">PathIndex:</label>
  635.                 <input type="text" id="PathIndex" name="PathIndex" value="" maxlength="3" size="3" />
  636.                 <label for="FileSize">FileSize:</label>
  637.                 <input type="text" id="FileSize" name="FileSize" value="" maxlength="7" size="7" />
  638.             </div>
  639.             <div id="gameDirectoryDisplay"></div>
  640.  
  641.             <div class="form-field"></div>
  642.             <button type="submit">SAVE</button>
  643.         </form>
  644.             <!-- Image Placeholder -->
  645.         <div id="game-image" style="margin-bottom: 20px; text-align: center;">
  646.             <img id="game-screenshot" src="" alt="Game Screenshot" style="max-width: 100%; height: auto; display: none;">
  647.         </div>
  648.  
  649.     </div>
  650. </body>
  651. </html>
  652.  
  653.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement