mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-04-27 14:55:38 +00:00
Delete Mod button functional
This commit is contained in:
parent
f7e3fe9560
commit
57b78a139f
@ -13,9 +13,17 @@ if (file_exists("d2im.db")) {
|
|||||||
$sql = "SELECT * FROM d2im WHERE `modname`='{$_POST['modname']}'";
|
$sql = "SELECT * FROM d2im WHERE `modname`='{$_POST['modname']}'";
|
||||||
$mod = PDO_FetchRow($sql);
|
$mod = PDO_FetchRow($sql);
|
||||||
|
|
||||||
$_SESSION['modname'] = $mod['modname'];
|
if (isset($_POST['deletemod'])) {
|
||||||
$_SESSION['path'] = $mod['path'];
|
$sql = "DELETE FROM d2im WHERE modname='{$_POST['modname']}'";
|
||||||
header("Location: /");
|
PDO_Execute($sql);
|
||||||
|
unlink($_POST['modname'] . ".db");
|
||||||
|
header("Refresh:0");
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$_SESSION['modname'] = $mod['modname'];
|
||||||
|
$_SESSION['path'] = $mod['path'];
|
||||||
|
header("Location: /");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// if config db does not exist, go to config page
|
// if config db does not exist, go to config page
|
||||||
@ -35,21 +43,24 @@ if (file_exists("d2im.db")) {
|
|||||||
<a class="btn btn-outline-danger" style="color:red; font-size: 18px;float:right;" href="/">X</a>
|
<a class="btn btn-outline-danger" style="color:red; font-size: 18px;float:right;" href="/">X</a>
|
||||||
<hr style="margin: 60px;">
|
<hr style="margin: 60px;">
|
||||||
<div class="offset-2 col-8">
|
<div class="offset-2 col-8">
|
||||||
<h2>Select Mod</h2>
|
<h2>Manage Mods</h2>
|
||||||
<div style="margin-top: 20px;" class="ctrl-config">
|
<div style="margin-top: 20px;" class="ctrl-config">
|
||||||
<form class="" enctype="multipart/form-data" style="font-family: Lato; font-size: 14pt;text-align:center;" action="" method="post">
|
<form class="" enctype="multipart/form-data" style="font-family: Lato; font-size: 14pt;text-align:center;" action="" method="post">
|
||||||
<p>
|
<p>
|
||||||
<select id="mods" name="modname" required="required" class="custom-select"> <?php foreach ($mods as $mod) { ?>
|
<select id="mods" name="modname" required="required" class="custom-select"> <?php foreach ($mods as $mod) { ?>
|
||||||
<option value="<?php echo $mod['modname'] ?>"><?php echo $mod['modname'] ?>: <?php echo $mod['path'] ?></option>
|
<option value="<?php echo $mod['modname'] ?>">
|
||||||
|
<?php echo $mod['modname'] ?>: <?php echo $mod['path'] ?>
|
||||||
|
</option>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</select>
|
</select>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<input type="submit" value="Select" name="submit" class="btn-config">
|
<input type="submit" value="Select" name="submit" class="btn-outline-success btn">
|
||||||
</p>
|
|
||||||
<p>
|
<a style="font-weight: bold;" class="btn btn-outline-warning" href="/">Cancel</a>
|
||||||
<a style="font-weight: bold;" class="btn btn-danger" href="/">Cancel</a>
|
<input style="float:right;" type="submit" value="Delete Mod" name="deletemod" class="btn btn-outline-danger">
|
||||||
</p>
|
</p>
|
||||||
|
<p style="font-family: lato;font-size: 14px;">Set active mod for D2Modder. <br>If you delete a mod, select another mod to make it active. <br>Deleting a mod here will only delete the .db database file, and remove the mod entry from D2Modder. <br>Your mod files will not be deleted.</p>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user