mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-10-13 16:34:23 -05:00
minimal wp/quest editing works, need refactor to better form
This commit is contained in:
@@ -42,7 +42,7 @@ $form = new Formr\Formr();
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
// ddump($charData);
|
||||
// ddump($charData);
|
||||
?>
|
||||
|
||||
|
||||
@@ -82,28 +82,44 @@ EOT;
|
||||
|
||||
$quests = null;
|
||||
foreach ($c->charData['Quests'] as $quest) {
|
||||
foreach ($quest as $difficulty => $q) {
|
||||
foreach ($quest as $difficulty => $q) {
|
||||
$quests .= "<h2>$difficulty</h2>";
|
||||
foreach ($q as $k => $v) {
|
||||
$kD = str_replace("_", " ", $k);
|
||||
$kD = str_replace(" NM", "", $kD);
|
||||
$kD = str_replace(" Hell", "", $kD);
|
||||
|
||||
if ($v == 1) {
|
||||
$quests .= "<input type='checkbox' $k = $v checked disabled>$k<br>";
|
||||
$quests .= "<input type='checkbox' value='1' name='quest[$k]' id='$k' checked><label for='$k'>$kD</label><br>";
|
||||
} else {
|
||||
$quests .= "<input type='checkbox' $k = $v disabled>$k<br>";
|
||||
$quests .= "<input type='checkbox' value='1' name='quest[$k]' id='$k'><label for='$k'>$kD</label><br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$wps = null;
|
||||
foreach ($c->charData['Waypoints'] as $waypoints) {
|
||||
$wps .= "<input type='radio' value='1' name='wp_all' id='wp_all'><label style='font-size: 1.3em;color:green;' for='wp_all'>Enable All Waypoints</label><br><input type='radio' value='0' name='wp_all' id='wp_all_off'><label style='font-size: 1.3em; color: red;' for='wp_all_off'>Disable All Waypoints</label><hr>";
|
||||
foreach ($c->charData['Waypoints'] as $diff => $waypoints) {
|
||||
$wps .= "<h2>$diff</h2>";
|
||||
array_pop($waypoints);
|
||||
foreach ($waypoints as $k => $v) {
|
||||
if ($v == 1 && $k != ''){
|
||||
$wps .= "<input type='checkbox' $k = $v checked disabled>$k<br>";
|
||||
$kD = str_replace("_", " ", $k);
|
||||
$kD = str_replace(" NM", "", $kD);
|
||||
$kD = str_replace(" Hell", "", $kD);
|
||||
if ($v == 1 && $k != ''){
|
||||
$wps .= "<input type='checkbox' value='1' name='wp[$k]' id='$k' checked disabled><label for='$k'>$kD</label><br>";
|
||||
} else {
|
||||
$wps .= "<input type='checkbox' $k = $v disabled>$k<br>";
|
||||
$wps .= "<input type='checkbox' value='1' name='wp[$k]' id='$k' disabled><label for='$k'>$kD</label><br>";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$option = '';
|
||||
if ($c->charData['CharacterClass'] == 'Amazon'){
|
||||
@@ -171,36 +187,52 @@ EOT;
|
||||
|
||||
|
||||
|
||||
if ($c->charData['Quests'][0]['Norm']["DenOfEvil"]) $a1q1 = "checked";
|
||||
if ($c->charData['Quests'][0]['Norm']["SistersBurialGrounds"]) $a1q2 = "checked";
|
||||
if ($c->charData['Quests'][0]['Norm']["TheSearchForCain"]) $a1q3 = "checked";
|
||||
if ($c->charData['Quests'][0]['Norm']["TheForgottenTower"]) $a1q4 = "checked";
|
||||
if ($c->charData['Quests'][0]['Norm']["ToolsOfTheTrade"]) $a1q5 = "checked";
|
||||
if ($c->charData['Quests'][0]['Norm']["SistersToTheSlaughter"]) $a1q6 = "checked";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// dump($c['Waypoints']);
|
||||
$tabContent .= <<<EOT
|
||||
<div style="background: white;" class="tab-pane fade" id="{$c->charData['CharacterName']}" role="tabpanel" aria-labelledby="{$c->charData['CharacterName']}-tab">
|
||||
|
||||
<h1 style="margin: 15px;">{$c->charData['CharacterName']}</h1>
|
||||
|
||||
|
||||
<form method="POST" action="/saveCharacter.php">
|
||||
<input type="hidden" name="filePath" id="filePath" value="{$c->charData['filePath']}">
|
||||
<div class="container" style="font-size: 14px;">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<img src="/img/chars/{$c->charData['CharacterClass']}.gif">
|
||||
</div>
|
||||
<div class="col">
|
||||
<input type="text" id="ChracterName" name="ChracterName" maxlength="16" value="{$c->charData['CharacterName']}">
|
||||
<select id='CharacterClass'>
|
||||
$option
|
||||
</select>
|
||||
<input style="border: 1px solid black;width: 34px;" type="number" id="CharacterLevel" value="{$c->charData['CharacterLevel']}"><br>
|
||||
$radio
|
||||
</div>
|
||||
<div class="col"><h2>Quests</h2>$quests</div>
|
||||
<div class="col"><h2>Waypoints</h2>$wps</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h1 style="margin: 15px;">{$c->charData['CharacterName']}</h1>
|
||||
<input class="btn btn-danger" style="" type="submit" value="Save Character">
|
||||
<img src="/img/chars/{$c->charData['CharacterClass']}.gif"><br>
|
||||
<input type="text" id="ChracterName" name="ChracterName" maxlength="16" value="{$c->charData['CharacterName']}">
|
||||
<select id='CharacterClass'>
|
||||
$option
|
||||
</select>
|
||||
<input style="border: 1px solid black;width: 34px;" type="number" id="CharacterLevel" value="{$c->charData['CharacterLevel']}"><br>
|
||||
$radio
|
||||
</div>
|
||||
<div class="col"><h2>Quests</h2>
|
||||
$quests
|
||||
</div>
|
||||
<div class="col"><h2>Waypoints</h2>
|
||||
$wps
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<input class="btn btn-danger" style="" type="submit" value="Save Character">
|
||||
</form>
|
||||
</div>
|
||||
EOT;
|
||||
|
||||
|
Reference in New Issue
Block a user