From 1cfc60dad9540cad552c025048e662e06e847c4d Mon Sep 17 00:00:00 2001 From: mauirixxx Date: Mon, 6 Aug 2018 16:37:48 -1000 Subject: [PATCH] editing title ranks is broken still --- includes/titleranks-add.php | 1 + includes/titleranks-editor.php | 43 +++++++++++++++++++++++++++++++++++++++++- titlemanager.php | 2 +- 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/includes/titleranks-add.php b/includes/titleranks-add.php index 30dc1bf..6ccef1e 100644 --- a/includes/titleranks-add.php +++ b/includes/titleranks-add.php @@ -63,6 +63,7 @@ while ($row = $result->fetch_assoc()) { echo '' . $stnid . '' . $tnid . '' . $stname . '' . number_format($stpoints) . '' . $strank . ''; } $stmtview->close(); +$_SESSION['tid'] = $_POST['tid']; echo '

If anything looks off, please fix it!

'; echo 'Return to title manager'; ?> \ No newline at end of file diff --git a/includes/titleranks-editor.php b/includes/titleranks-editor.php index 4b748e4..1bad404 100644 --- a/includes/titleranks-editor.php +++ b/includes/titleranks-editor.php @@ -1,4 +1,45 @@
'; + +# delete this block when shit finally works. +ini_set('display_errors', 'on'); +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: ' . $_SESSION['tid'] . '
'; + +$stid = array(); +foreach ($_POST['editstitle'] as $tredit) { + $stid[] = (int)$tredit; +} +$stid = implode(',', $stid); +echo 'the value of stid is now: ' . $stid . '
'; +$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
'; +} +$sredit->free_result(); +$sredit->close(); + +// 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: ' . $tredit . '
'; + } +} else { + echo 'nothing is set??
'; +} +*/ +echo '
code to mod title ranks via an include goes here

'; echo 'Return to title manager'; ?> \ No newline at end of file diff --git a/titlemanager.php b/titlemanager.php index ccdc32e..88c8c7c 100644 --- a/titlemanager.php +++ b/titlemanager.php @@ -41,7 +41,7 @@ if ($_SESSION['admin'] == 1) { echo 'Modify titles


'; - echo 'Add title ranks and points to


'; // now to view the last 5 title entries in the database