d2tools/wait.php
2021-03-24 09:57:02 -06:00

59 lines
1.6 KiB
PHP

<?php
require_once "./src/D2Functions.php";
require_once "./src/D2Database.php";
require_once './src/D2Files.php';
require_once './src/D2TxtParser.php';
define('FILTER_PROPERTIES_FILE', 'filterProperties.txt');
define('DB_FILE', 'db');
include "./_pdo.php";
$filename = 'd2im.conf';
if (file_exists($filename)) {
$p = file_get_contents($filename);
if (is_dir($p)) {
$path = $p;
define('TXT_PATH', $p);
}
}
// parse txt data
$files = new D2Files();
$parser = new D2TxtParser();
$db = new D2Database();
$data['Armor'] = $parser->parseFile($files->getFile('Armor'));
$data['Gems'] = $parser->parseFile($files->getFile('Gems'));
$data['ItemTypes'] = $parser->parseFile($files->getFile('ItemTypes'));
$data['Misc'] = $parser->parseFile($files->getFile('Misc'));
$prop = $parser->parseFile($files->getFile('Properties'));
$data['SetItems'] = $parser->parseFile($files->getFile('SetItems'));
$data['Sets'] = $parser->parseFile($files->getFile('Sets'));
$data['UniqueItems'] = $parser->parseFile($files->getFile('UniqueItems'));
$data['Weapons'] = $parser->parseFile($files->getFile('Weapons'));
foreach ($data as $k => $v) {
$db->createTables($files->getFile($k), $v);
$db->fillsTables($files->getFile($k), $v);
}
?>
<!doctype html>
<html lang="en">
<?php
/* Require the <head> section */
require_once "head.php";
?>
<div class="container container-top">
<h1><img src="/img/Diablo2.png" style="float:left">Files Processed</h1>
<a class="btn btn-outline-danger" style="color:red; font-size: 18px;float:right;" href="/">X</a>
<hr style="margin: 60px;">
<h1><a href="/"> Click here to go to the main application.</a></h1>
</div>
</body>
</html>