-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_sportactivity.php
37 lines (36 loc) · 1.21 KB
/
update_sportactivity.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
<?php
$pdo = new PDO('mysql:host=localhost;dbname=scripting', 'root', 'root');
?>
<?php
$sql = "SELECT id, name, amount, date FROM sportactivity where id=".$_GET['id'] ." LIMIT 1";
$query = $pdo->query($sql);
foreach ($query as $row) {
?>
<html>
<head>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
</head>
<body>
<form action="save_activity.php" method="GET">
<input name="id" type="hidden" value="<?php echo $_GET["id"]; ?>"/>
<input name="name" placeholder="name" type="text" value="<?php echo $row["name"];?>" /><br />
<input name="amount" placeholder="amount" type="text" value="<?php echo $row["amount"];?>" /><br />
<input name="date" placeholder="Date" type="text" class="datepicker" value="<?php echo $row["date"];?>" /><br />
<input type="submit" value="Submit" />
</form>
<?php
}
?>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script
src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"
integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU="
crossorigin="anonymous"></script>
<script>
$(function() {
$(".datepicker").datepicker();
});
</script>
</body>
</html>