d2tools/test.php

70 lines
1.9 KiB
PHP
Raw Normal View History

2022-04-27 04:23:04 +00:00
<?php
error_reporting(E_ERROR | E_PARSE);
set_time_limit(-1);
ini_set('max_input_time', '-1');
ini_set('max_execution_time', '0');
session_start();
ob_start();
require_once './config.php';
require_once './_pdo.php';
require_once "./src/D2Functions.php";
require_once './src/D2ItemData.php';
require_once './src/D2ItemDesc.php';
require_once './src/D2DocGenerator.php';
define('DB_FILE', $_SESSION['modname'] . ".db");
PDO_Connect("sqlite:" . DB_FILE);
$sql = "SELECT code FROM uniqueitems";
$res = PDO_FetchAll($sql);
foreach ($res as $code){
$c = $code['code'];
$sql = "SELECT flippyfile FROM misc WHERE code = '$c'";
$ret = PDO_FetchOne($sql);
if(empty($ret)){
$sql = "SELECT flippyfile FROM armor WHERE code = '$c'";
$ret = PDO_FetchOne($sql);
}
if(empty($ret)){
$sql = "SELECT flippyfile FROM armor WHERE normcode = '$c'";
$ret = PDO_FetchOne($sql);
}
if(empty($ret)){
$sql = "SELECT flippyfile FROM armor WHERE ubercode = '$c'";
$ret = PDO_FetchOne($sql);
}
if(empty($ret)){
$sql = "SELECT flippyfile FROM armor WHERE ultracode = '$c'";
$ret = PDO_FetchOne($sql);
}
if(empty($ret)){
$sql = "SELECT flippyfile FROM weapons WHERE code = '$c'";
$ret = PDO_FetchOne($sql);
}
if(empty($ret)){
$sql = "SELECT flippyfile FROM weapons WHERE normcode = '$c'";
$ret = PDO_FetchOne($sql);
}
if(empty($ret)){
$sql = "SELECT flippyfile FROM weapons WHERE ubercode = '$c'";
$ret = PDO_FetchOne($sql);
}
if(empty($ret)){
$sql = "SELECT flippyfile FROM weapons WHERE ultracode = '$c'";
$ret = PDO_FetchOne($sql);
}
$return[] = $ret;
echo $ret . "_uni<br>";
}
//dump($return);