-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsubmitProblem.php
60 lines (55 loc) · 1.85 KB
/
submitProblem.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php $dir = ""; include($dir . "header.php"); ?>
<script type="text/javascript">
$(document).ready(function()
{
$.ajaxSetup(
{
cache: false,
beforeSend: function() {
//$('#content').hide();
},
complete: function() {
//$('#content').show();
},
success: function() {
//$('#content').show();
}
});
var $container = $("#content");
$container.load("loadTeamStatus.php");
var refreshId = setInterval(function()
{
$container.load('loadTeamStatus.php');
}, 9000);
});
</script>
<link rel="stylesheet" href="css/table.css">
<form action="uploads/upload.php" method="post" enctype="multipart/form-data">
<h2>Upload File</h2>
<label for="fileSelect">Filename:</label>
<input type="file" name="java" id="fileSelect" /><br>
<label for="problemNumber">Problem Number:</label>
<select class="number" name="problemNumber">
<!-- TODO: get from problem names, keep value same -->
<?php
$servername = "localhost";
$username = "root";
$password = "admin";
$dbname = "cscomp";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql1 = "SELECT * FROM problems";
$result1 = $conn->query($sql1);
while($row = $result1->fetch_assoc()){
echo "<option value = '".$row['number']."'>".$row['name']."</option>";
}
?>
</select><br><br>
<input type="submit"id = 'problemSubmit' name="submit" value="Upload">
</form>
<div id = "content">
</div>