Przeglądaj źródła

can display select title ranks in a table now

pull/16/head
mauirixxx 7 lat temu
rodzic
commit
4e9f410491
2 zmienionych plików z 21 dodań i 32 usunięć
  1. +15
    -32
      includes/titleranks-editor.php
  2. +6
    -0
      includes/titleranks-update.php

+ 15
- 32
includes/titleranks-editor.php Wyświetl plik

@@ -6,40 +6,23 @@ error_reporting(E_ALL);
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
# delete the above when shit finally works

$tid = $_SESSION['tid'];
echo 'the session tid number is: <b>' . $_SESSION['tid'] . '</b><br />';
# $tid = $_SESSION['tid'] = titlenameid from database
# $stid = $_POST['editstitle'] = stnameid from database and it should return an array of numbers

$stid = array();
foreach ($_POST['editstitle'] as $tredit) {
$stid[] = (int)$tredit;
}
$stid = implode(',', $stid);
echo 'the value of stid is now: ' . $stid . '<br />';
$sredit = $con->prepare("SELECT * FROM gwsubtitles WHERE titlenameid = ? AND stnameid IN (?)");
$sredit->bind_param("is", $tid, $stid);
$sredit->execute();
$sredit->store_result();
$sredit->bind_result($gwtid, $gwstid);
while ($sredit->fetch()) {
echo 'farts <br />';
}
$sredit->free_result();
$sredit->close();
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></tr>'; //save this line!!!

// keep this section
/* if (isset($_POST['editstitle'])) {
$sredit = $con->prepare("SELECT * FROM gwsubtitles WHERE stnameid = ? AND titlenameid = ?");
foreach ($_POST['editstitle'] as $tredit) {
$sredit->bind_param("ii", $tid, $tredit);
$sredit->execute();
$sredit->store_result();
$sredit->bindresult(
echo 'the value is: <b>' . $tredit . '</b><br />';
}
} else {
echo 'nothing is set?? <br />';
$ph = implode(",", $_POST['editstitle']);

$sredit = $con->prepare("SELECT * FROM gwsubtitles WHERE titlenameid = ? AND stnameid IN ($ph)");
$sredit->bind_param("i", $_SESSION['tid']);
$sredit->execute();
$result = $sredit->get_result();
while ($row = $result->fetch_assoc()) {
echo '<tr><td><input type="text" readonly size="4" name="stnameid" value="' . $row['stnameid']. '"></td><td><input type="text" readonly size="4" name="titlenameid" value="' . $row['titlenameid'] . '"></td>';
echo '<td><input type="text" name="stname" value="' . $row['stname'] . '"></td><td><input type="number" min="1" name="stpoints" value="' . $row['stpoints'] . '"></td>';
echo '<td><input type="number" size="4" min="1" max="15" name="strank" value="' . $row['strank'] . '"></td></tr>';
}
*/
echo '<br />code to mod title ranks via an include goes here<br /><br />';
echo '</table><br /><input type="hidden" name="title" value="updatesubtitle"><input type="submit" value="Modify title rank(s)"></form>';
echo '<br /><br />';
echo 'Return to <a href="titlemanager.php" class="navlink">title manager</a>';
?>

+ 6
- 0
includes/titleranks-update.php Wyświetl plik

@@ -0,0 +1,6 @@
<?php
echo 'this page will either update the title rank(s) with no human interaction, or<br />';
echo 'delete the specified title rank(s), but require a verification page!<br /><br />';

echo 'Return to <a href="titlemanager.php" class="navlink">title manager</a>';
?>

Ładowanie…
Anuluj
Zapisz