Pārlūkot izejas kodu

added title max rank to editor and associated support

pull/16/head
mauirixxx pirms 7 gadiem
vecāks
revīzija
868c711d9d
3 mainītis faili ar 10 papildinājumiem un 8 dzēšanām
  1. +3
    -2
      includes/title-editor.php
  2. +5
    -4
      includes/title-submit.php
  3. +2
    -2
      includes/title-update.php

+ 3
- 2
includes/title-editor.php Parādīt failu

@@ -1,6 +1,6 @@
<?php <?php
echo '<form action="titlemanager.php" method="post">'; echo '<form action="titlemanager.php" method="post">';
echo '<table border="1"><tr><th>titlenameid</th><th>titlename</th><th>titletype</th></tr>';
echo '<table border="1"><tr><th>titlenameid</th><th>titlename</th><th>titletype</th><th>titlemaxrank</th></tr>';
$stmtview = $con->prepare("SELECT * FROM gwtitles WHERE titlenameid = ?"); $stmtview = $con->prepare("SELECT * FROM gwtitles WHERE titlenameid = ?");
$stmtview->bind_param("i", $_POST['tid']); $stmtview->bind_param("i", $_POST['tid']);
$stmtview->execute(); $stmtview->execute();
@@ -9,6 +9,7 @@ while ($row = $result->fetch_assoc()) {
$tid = $row['titlenameid']; $tid = $row['titlenameid'];
$tname = $row['titlename']; $tname = $row['titlename'];
$ttype = $row['titletype']; $ttype = $row['titletype'];
$tmr = $row['titlemaxrank'];
echo '<tr><td><input readonly size="3" name="titlenameid" value="' . $tid . '"></td><td><input size="40" type="text" name="titlename" value="' . $tname . '"></td><td style="text-align:left">'; echo '<tr><td><input readonly size="3" name="titlenameid" value="' . $tid . '"></td><td><input size="40" type="text" name="titlename" value="' . $tname . '"></td><td style="text-align:left">';
echo '<input type="radio" name="titletype" '; echo '<input type="radio" name="titletype" ';
if ($ttype == 0) { if ($ttype == 0) {
@@ -19,7 +20,7 @@ while ($row = $result->fetch_assoc()) {
if ($ttype == 1) { if ($ttype == 1) {
echo 'checked '; echo 'checked ';
} }
echo 'value="1">Character</td></tr>';
echo 'value="1">Character</td><td><input type="number" name="titlemaxrank" min="1" max="15" value="' . $tmr . '"></td></tr>';
} }
$stmtview->close(); $stmtview->close();
echo '</table><table><tr><th>Delete title?</th></tr><tr><td><input type="checkbox" name="deltitle" value="yes"></td></tr></table><br /><br />'; echo '</table><table><tr><th>Delete title?</th></tr><tr><td><input type="checkbox" name="deltitle" value="yes"></td></tr></table><br /><br />';


+ 5
- 4
includes/title-submit.php Parādīt failu

@@ -1,6 +1,6 @@
<?php <?php
$stmtins = $con->prepare("INSERT INTO gwtitles (titlename, titletype) VALUES (?, ?)");
$stmtins->bind_param("si", $_POST['titlename'], $_POST['titletype']);
$stmtins = $con->prepare("INSERT INTO gwtitles (titlename, titletype, titlemaxrank) VALUES (?, ?, ?)");
$stmtins->bind_param("sii", $_POST['titlename'], $_POST['titletype'], $_POST['titlemaxrank']);
$stmtins->execute(); $stmtins->execute();
$stmtins->close(); $stmtins->close();
echo 'New title added!<br /><br />'; echo 'New title added!<br /><br />';
@@ -11,8 +11,9 @@ while ($row = $result->fetch_assoc()) {
$tid = $row['titlenameid']; $tid = $row['titlenameid'];
$tname = $row['titlename']; $tname = $row['titlename'];
$ttype = $row['titletype']; $ttype = $row['titletype'];
echo '<table border="1"><tr><th>titleid</th><th>titlename</th><th>titletype</th></tr>';
echo '<tr><td>' . $tid . '</td><td>' . $tname . '</td><td>' . $ttype . '</td></tr></table><br />';
$tmr = $row['titlemaxrank'];
echo '<table border="1"><tr><th>titleid</th><th>titlename</th><th>titletype</th><th>titlemaxrank</th></tr>';
echo '<tr><td>' . $tid . '</td><td>' . $tname . '</td><td>' . $ttype . '</td><td>' . $tmr . '</td></tr></table><br />';
} }
$stmtview->close(); $stmtview->close();
echo 'Return to <a href="titlemanager.php" class="navlink">title manager</a>'; echo 'Return to <a href="titlemanager.php" class="navlink">title manager</a>';

+ 2
- 2
includes/title-update.php Parādīt failu

@@ -15,8 +15,8 @@ if (isset($_POST['deltitle'])) {
} }
} else { } else {
// this section updates the title name // this section updates the title name
$stmtupd = $con->prepare("UPDATE gwtitles SET titlename = ?, titletype = ? WHERE titlenameid = ?");
$stmtupd->bind_param("sii", $_POST['titlename'], $_POST['titletype'], $_POST['titlenameid']);
$stmtupd = $con->prepare("UPDATE gwtitles SET titlename = ?, titletype = ?, titlemaxrank = ? WHERE titlenameid = ?");
$stmtupd->bind_param("siii", $_POST['titlename'], $_POST['titletype'], $_POST['titlemaxrank'], $_POST['titlenameid']);
$stmtupd->execute(); $stmtupd->execute();
$stmtupd->close(); $stmtupd->close();
echo 'Title updated, redirecting!'; echo 'Title updated, redirecting!';


Notiek ielāde…
Atcelt
Saglabāt