| @@ -63,6 +63,7 @@ while ($row = $result->fetch_assoc()) { | |||||
| 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>'; | 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(); | $stmtview->close(); | ||||
| $_SESSION['tid'] = $_POST['tid']; | |||||
| 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 '</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>'; | echo 'Return to <a href="titlemanager.php" class="navlink">title manager</a>'; | ||||
| ?> | ?> | ||||
| @@ -1,4 +1,45 @@ | |||||
| <?php | <?php | ||||
| echo 'code to mod title ranks via an include goes here<br /><br />'; | |||||
| # 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: <b>' . $_SESSION['tid'] . '</b><br />'; | |||||
| $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(); | |||||
| // 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 />'; | |||||
| } | |||||
| */ | |||||
| echo '<br />code to mod title ranks via an include goes here<br /><br />'; | |||||
| echo 'Return to <a href="titlemanager.php" class="navlink">title manager</a>'; | echo 'Return to <a href="titlemanager.php" class="navlink">title manager</a>'; | ||||
| ?> | ?> | ||||
| @@ -41,7 +41,7 @@ if ($_SESSION['admin'] == 1) { | |||||
| echo 'Modify titles <form action="titlemanager.php" method="post"><input type="hidden" name="title" value="modtitle"><select name="tid" onchange="this.form.submit()"><option selected disabled>Select title</option>'; | echo 'Modify titles <form action="titlemanager.php" method="post"><input type="hidden" name="title" value="modtitle"><select name="tid" onchange="this.form.submit()"><option selected disabled>Select title</option>'; | ||||
| include ('includes/title-select.php'); | include ('includes/title-select.php'); | ||||
| echo '</select><noscript><input type="submit" value="Modify Title"></noscript></form><br /><br />'; | 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>'; | |||||
| echo 'Add title ranks and points to <form action="titlemanager.php" 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'); | include ('includes/title-select.php'); | ||||
| echo '</select><noscript><input type="submit" value="Add title rank"></noscript></form><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 | // now to view the last 5 title entries in the database | ||||