<!DOCTYPE html> //人工进行审核 通过
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Guitar Wars - Approve a Hight Score</title>
<link rel="stylesheet" type="text/css" href="score.css">
</head>
<body>
<h2>Guitar Wars - Approve a Hight Score</h2>
<?php
require_once('dbc.php');
if (isset($_GET['id']) && isset($_GET['date']) && isset($_GET['name']) && isset($_GET['score']) && isset($_GET['screenshot'])) {
$id = $_GET['id'];
$date = $_GET['date'];
$name = $_GET['name'];
$score = $_GET['score'];
$screenshot = $_GET['screenshot'];
echo '<p>are you sure you want to approve the following hight score?</p>';
echo '<p><strong>Name:</strong>'.$name.'<br/>';
echo '<strong>Date:</strong>'.$date.'<br/>';
echo '<strong>Score:</strong>'.$score.'</p>';
echo '<form method="post" action="'.$_SERVER['PHP_SELF'].'"> ';
echo '<input type="radio" name="confirm" value="Yes" /> Yes';
echo '<input type="radio" name="confirm" value="No" checked="checked" /> No';
echo '<br><input type="submit" name="submit" value="submit"/>';
echo '<input type="hidden" name="id" value="'.$id.'">';
echo '<input type="hidden" name="score" value="'.$score.'">';
echo '<input type="hidden" name="name" value="'.$name.'">';
echo '<input type="hidden" name="screenshot" value="'.$screenshot.'">';
echo '</from>';
}
if (isset($_POST['submit'])) {
if ($_POST['confirm'] == 'Yes') {
$id = $_POST['id'];
$name = $_POST['name'];
$score = $_POST['score'];
$screenshot = $_POST['screenshot'];
$query = "update guitar set approved=1 where id='$id'";
mysqli_query($dbc,$query);
mysqli_close($dbc);
echo '<p>The hight score of '.$score.' for '.$name.' was successfuly approved.</p>';
<!-- header('Location: http://127.0.0.1/headfirst/guitar_admin.php'); -->
}else{
echo 'The hight score was not approve.';
}
}
//echo '<p><a href="guitar_admin.php"><<Back to admin page</a></p>';
?>
</body>
</html>