testing changes

This commit is contained in:
color.diff=auto
2021-05-07 03:18:29 -06:00
parent 54ecb62674
commit 776e9d31c6
1020 changed files with 2894 additions and 274500 deletions

View File

@@ -43,7 +43,7 @@ session_start();
*/
ini_set('display_errors',1);
ini_set('display_errors', 1);
error_reporting(E_ALL ^ E_WARNING);
ini_set('log_errors', 1);
@@ -60,7 +60,7 @@ if (!isset($_SESSION['modname']) || (!file_exists(APP_DB)) || (!file_exists($_SE
$sql = "SELECT * FROM D2Modder ORDER BY lastused DESC LIMIT 1";
$lastUsedMod = PDO_FetchRow($sql);
$_SESSION['modname'] = $lastUsedMod['modname'];
$_SESSION['path'] = $lastUsedMod['path'];
@@ -84,9 +84,7 @@ if (!isset($_SESSION['modname']) || (!file_exists(APP_DB)) || (!file_exists($_SE
require_once './src/D2Files.php';
require_once './src/D2TxtParser.php';
require_once './src/D2ItemDesc.php';
$idesc = new D2ItemDesc();
$db = new D2Database();
$parser = new D2TxtParser();
@@ -109,11 +107,9 @@ if (!isset($_SESSION['modname']) || (!file_exists(APP_DB)) || (!file_exists($_SE
$prop = $parser->filterProps('Properties.txt');
// If there's data, process it and save
if (!empty($_POST)) {
// save db name from post into conf file
// save db name from post into conf file... why?
require_once './src/D2SaveFile.php';
$saver = new D2SaveFile();
@@ -135,6 +131,19 @@ if (!isset($_SESSION['modname']) || (!file_exists(APP_DB)) || (!file_exists($_SE
}
}
// last 3 items are not in d2 txt, rid of them
// why did I set formtype? I can't rememer, need to comment code more
/*
*
*
* Unique Items Form was posted here
*
*/
if ($_POST['formtype'] == "uniqueitems") {
unset($post['formtype']);
@@ -150,19 +159,30 @@ if (!isset($_SESSION['modname']) || (!file_exists(APP_DB)) || (!file_exists($_SE
}
$sql = "SELECT rowid,`index` from `uniqueitems` WHERE `index`='{$post['index']}'";
$res = PDO_FetchRow($sql);
$sql = "SELECT rowid,`index` from `uniqueitems` WHERE `index`=\"{$post['index']}\"";
$res = PDO_FetchRow($sql);
if ($res['index'] == $post['index']) {
$sql = "UPDATE `uniqueitems` SET ";
foreach ($post as $k => $v) {
$sql .= "`$k`='$v',";
$sql .= "`$k`=\"$v\",";
}
$sql = rtrim($sql, ",");
$sql .= " WHERE `index`='{$post['index']}'";
$x = PDO_Execute($sql);
ddump($x);
} else {
$sql .= ' WHERE `index`="'.$post['index'].'"';
PDO_Execute($sql, [$post['index']]);
//ddump($x);
}
/*
*
*
* Set Items Form was posted here
*
*/ else {
$sql = "INSERT INTO `uniqueitems` (";
foreach ($post as $k => $v) {