-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patheditAttributes.php
More file actions
58 lines (42 loc) · 1.75 KB
/
editAttributes.php
File metadata and controls
58 lines (42 loc) · 1.75 KB
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
<html>
<head>
<title>Pipoca</title>
<link rel="stylesheet" type="text/css" href="css/main.css">
</head>
<body>
<div id="#tudo">
<object data="css/logo.svg" type="image/svg+xml" height=200 width=900></object>
<div id="menu">
<?php include("menu.html"); ?>
</div>
<div id="centro">
<h2>Edit attributes</h2>
<?php
include("connection.php");
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
//montando o seletor de codigos disponiveis
$sql = "SELECT * FROM (SELECT attributes.id, attributes.name, attributes.memo, sourceAttributes.value, sourceAttributes.source_id FROM attributes LEFT JOIN sourceAttributes ON attributes.id=sourceAttributes.attributes_id)fusao WHERE source_id=" . $_GET["idImage"];
$result = mysqli_query($conn, $sql);
echo "<form method=GET action='doEditAttributes.php'>\n";
echo "<table border=0 valign='top'>\n";
echo "<input type=hidden name='idImage' value='" . $_GET["idImage"] . "'>\n";
while($row = mysqli_fetch_assoc($result)) {
echo "<tr><td><input type=hidden name='idAttributes[]' value='" . $row["id"] . "'>\n";
echo "<span class='fieldname'>" . $row["name"] . "</td><td><input type=text name='values[]' value='" . $row["value"] . "'></td>\n";
echo "<td><span class='discrete'>" . $row["memo"] . "</span></td></tr>\n";
}
echo "<tr><td colspan=3 align=center><br/><input type='Submit' value='OK'></td></tr>\n</table>\n</form>\n";
mysqli_close($conn);
?>
<div>
<span class='fieldname'>Navigate: </span> <a href=viewImagewithBites.php?idImage=<?php echo $_GET["idImage"] ?> >Back to source</a> | <a href=viewAttributes.php>View all attributes</a>
</div>
</div>
</div>
</body>
</html>