In memory data refactor, less queries, cube/unique doc backend working fast

This commit is contained in:
color.diff=auto
2021-05-12 19:00:56 -06:00
parent ca04aa615f
commit 5eced413cb
7 changed files with 15188 additions and 133 deletions

View File

@@ -123,7 +123,25 @@ $htmltop = <<<EOT
text-align: $align;
font-family: Lato;
}
.item {
text-align: left;
position:relative;
right:0px;
}
.item_desc {
height: 600px;
width: 620px;
position: relative;
left: 0px;
top: 0px;
text-align: center;
padding: 10px;
text-transform: uppercase;
}
.item_stats{
width: auto;
@@ -163,7 +181,7 @@ $htmltop = <<<EOT
$(document).ready(function() {
// $('.cubetable').dataTable();
$('.cubetable').dataTable();
} );
@@ -201,8 +219,8 @@ EOT;
*
*/
$dir = getcwd() . "/docs/{$_SESSION['modname']}";
mkdir($dir, 0777, true);
if ($cmd == "genDocUniqueItems") {
// grab unique item index only (to save on memory)
@@ -369,7 +387,7 @@ if ($cmd == "genDocCube") {
body{
background: white;
color: black;
font-family: ExocetLight;
font-family: ExocetHeavy;
text-transform: uppercase;
}
@@ -411,16 +429,36 @@ if ($cmd == "genDocCube") {
}
.desc {
width: 25%;
width: 200px;
font-family: ExocetHeavy;
font-size: 1.25em;
text-transform: uppercase;
background: #111;
}
.input1,.input3,.input5,.input7{
background: #444;
}
.input2, .input4, .input6 {
background: #333;
}
.output1{
background: #222;
}
.output2 {
background: #222;
}
.output3 {
background: #222;
}
td {
width: auto;
height: 240px;
text-align: center;
vertical-align: middle;
padding: 10px;
padding: 10px;
}
</style>
EOT;
@@ -493,7 +531,11 @@ EOT;
*/
foreach ($res as $r) {
$desc = $r['description'];
$desc = str_replace('+', '<br>+<br>', $r['description']);
$desc = str_replace('->', '<br><span class="" style="color: gold;font-size:1.25em;">=<br>', $desc);
$desc .= "</span>";
//ddump($desc);
//var_dump($r);
// grab all inputs
$input_codes = array_filter(
@@ -955,7 +997,7 @@ EOT;
$htmlFinal .= $tableBottom . $htmlbottom;
file_put_contents("$dir/cubemain.html", $htmlFinal);
header("Location: /docs/{$_SESSION['modname']}/cubemain.html");
header("Location: docs/{$_SESSION['modname']}/cubemain.html");
}
@@ -965,28 +1007,45 @@ if ($cmd == "getIscStrings") {
// $sql = "SELECT p.`code` as prop,
// p.stat1,
// i.descstrpos,
// i.descstr2,
// i.descfunc,
// i.descval,
// s1.String as string1,
// s2.String as string2
// FROM properties as p
// LEFT JOIN itemstatcost as i
// ON p.stat1 = i.Stat
// LEFT JOIN strings as s1
// ON i.descstrpos = s1.Key
// LEFT JOIN strings as s2
// ON i.descstr2 = s2.Key";
// $res = PDO_FetchAll($sql);
//
// $isc = null;
// foreach ($res as $r) {
// $isc[$r['prop']] = $r;
// $isc[$r['prop']]['prop'] = $r['prop'];
// }
$sql = "
SELECT p.`code` as prop,
p.stat1,
i.descstrpos,
i.descstr2,
i.descfunc,
i.descval,
i.dgrp,
i.dgrpfunc,
i.dgrpval,
i.dgrpstrpos,
i.dgrpstrneg,
s1.String as string1,
s2.String as string2,
s3.String as gstring1,
s4.String as gstring2
FROM properties as p
LEFT JOIN itemstatcost as i
ON p.stat1 = i.Stat
LEFT JOIN strings as s1
ON i.descstrpos = s1.Key
LEFT JOIN strings as s2
ON i.descstr2 = s2.Key
LEFT JOIN strings as s3
ON i.dgrpstrpos = s3.Key
LEFT JOIN strings as s4
ON i.dgrpstr2= s4.Key
";
$res = PDO_FetchAll($sql);
$isc = null;
foreach ($res as $r) {
$isc[$r['prop']] = $r;
$isc[$r['prop']]['prop'] = $r['prop'];
}
var_dump($isc);