Quellcode durchsuchen

prepping for title rank editing

pull/16/head
mauirixxx vor 7 Jahren
Ursprung
Commit
94dc001e2c
4 geänderte Dateien mit 14 neuen und 7 gelöschten Zeilen
  1. +0
    -1
      includes/title-update.php
  2. +6
    -4
      includes/titleranks-add.php
  3. +4
    -0
      includes/titleranks-editor.php
  4. +4
    -2
      titlemanager.php

+ 0
- 1
includes/title-update.php Datei anzeigen

@@ -22,5 +22,4 @@ if (isset($_POST['deltitle'])) {
echo 'Title updated, redirecting!';
header ("Refresh:1; url=titlemanager.php");
}
//echo 'Return to <a href="titlemanager.php" class="navlink">title manager</a>'; //this line needs to go away soon
?>

+ 6
- 4
includes/titleranks-add.php Datei anzeigen

@@ -10,6 +10,8 @@ mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
# investigate if we can put multiple input boxes and loop through them to insert into the database
# https://stackoverflow.com/questions/34469482/how-to-insert-multiple-inputs-into-the-database-using-the-power-of-php

unset($_SESSION['title']);

if (isset($_SESSION['tid'])) {
$_POST['tid'] = $_SESSION['tid'];
}
@@ -47,7 +49,7 @@ echo '<tr><td><input type="text" name="titlerankname" required autofocus></td><t
echo '</table><br /><input type="hidden" name="title" value="titleranksubmit"><input type="hidden" name="titlenameid" value="' . $_POST['tid'] . '"><input type="submit" value="Add title rank ..."></form>';

echo 'Here are the currently associated title ranks, starting with rank 1:<br />';
echo '<table border="1"><tr><th>stnameid</th><th>titlenameid</th><th>stname</th><th>stpoints</th><th>strank</th></tr>';
echo '<form action="titlemanager.php" method="post"><table border="1"><tr><th>stnameid</th><th>titlenameid</th><th>stname</th><th>stpoints</th><th>strank</th><th>Edit</th></tr>';
$stmtview = $con->prepare("SELECT * FROM gwsubtitles WHERE titlenameid = ? ORDER BY strank ASC");
$stmtview->bind_param("i", $_POST['tid']);
$stmtview->execute();
@@ -58,9 +60,9 @@ while ($row = $result->fetch_assoc()) {
$stname = $row['stname'];
$stpoints = $row['stpoints'];
$strank = $row['strank'];
echo '<tr><td>' . $stnid . '<td>' . $tnid . '</td><td>' . $stname . '</td><td>' . number_format($stpoints) . '</td><td>' . $strank . '</td></tr>';
echo '<tr><td>' . $stnid . '<td>' . $tnid . '</td><td>' . $stname . '</td><td>' . number_format($stpoints) . '</td><td>' . $strank . '</td><td><input type="checkbox" name="editstitle[]" value="' . $stnid . '"></td></tr>';
}
$stmtview->close();
echo '</table><br />If anything looks off, please fix it!<br /><br />';
echo 'Return to <a href="titlemanager.php" class="navlink">title manager</a>'; //this line needs to go away soon. Maybe?
echo '</table><br /><input type="hidden" name="title" value="modsubtitle"><input type="submit" value="Edit selected titles"></form><br />If anything looks off, please fix it!<br /><br />';
echo 'Return to <a href="titlemanager.php" class="navlink">title manager</a>';
?>

+ 4
- 0
includes/titleranks-editor.php Datei anzeigen

@@ -0,0 +1,4 @@
<?php
echo 'code to mod title ranks via an include goes here<br /><br />';
echo 'Return to <a href="titlemanager.php" class="navlink">title manager</a>';
?>

+ 4
- 2
titlemanager.php Datei anzeigen

@@ -32,6 +32,9 @@ if ($_SESSION['admin'] == 1) {
} else if ($_POST['title'] == "titleranksubmit") {
// this section doesn't require human interaction
include_once ('includes/titleranks-submit.php');
} else if ($_POST['title'] == "modsubtitle") {
// included file contains all code to edit a title rank
include_once ('includes/titleranks-editor.php');
} else {
unset($_SESSION['tid']);
echo 'Add titles <form action="titlemanager.php" method="post"><input type="hidden" name="title" value="addtitle"><input type="submit" value="Add title"></form><br />';
@@ -40,8 +43,7 @@ if ($_SESSION['admin'] == 1) {
echo '</select><noscript><input type="submit" value="Modify Title"></noscript></form><br /><br />';
echo 'Add title ranks and points to <form action="titlemanager" method="post"><input type="hidden" name="title" value="addsubtitle"><select name="tid" onchange="this.form.submit()"><option selected disabled>Add title rank(s)</option>';
include ('includes/title-select.php');
echo '</select><noscript><input type="submit" value="Add title rank"></noscript></form><br />';
echo 'Edit / Delete subtitle & points (code goes here)<br /><br />';
echo '</select><noscript><input type="submit" value="Add title rank"></noscript></form><br /><br />';
// now to view the last 5 title entries in the database
echo 'Here is the last 5 titles entered into the database, newest entry is on top:<br />';
echo '<table border="1"><tr><th>titleid</th><th>titlename</th><th>titletype</th><th>titletype</th></tr>';


Laden…
Abbrechen
Speichern