-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathupdateAttributesMultipleImages.php
More file actions
78 lines (60 loc) · 2.24 KB
/
Copy pathupdateAttributesMultipleImages.php
File metadata and controls
78 lines (60 loc) · 2.24 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<html>
<head>
<title>Pipoca</title>
<link rel="stylesheet" type="text/css" href="css/main.css">
<script>
function checkImages() {
var img = new Image();
var listaNames = document.getElementById("name").value;
var arrayNomes = listaNames.split(";");
for (i = 0; i < arrayNomes.length; i++) {
img.src = "sources/" + arrayNomes[i];
img.style = "visibility: hidden;";
img.onerror = function() {
alert("Algum nome de arquivo esta errado");
}
}
}
</script>
</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>Update atribute of several images</h2>
<form method="post" action="doUpdateAttributesMultipleImages.php">
<table border=0>
<tr><td><span class='fieldname'>images:</td><td><input type="text" id="ids" name="ids" size="40" placeholder="Use ; to separate the ids of the images"></td></tr>
<tr><td colspan=2><h2>Atribute</h2></td></tr>
<?php
include("connection.php");
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
// lista de atributos
$sql = "SELECT id, name FROM attributes";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
echo "<tr><td><select id='attributes_id' name='attributes_id'>";
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_assoc($result)) {
echo "<option value='" . $row["id"] . "'>" . $row["name"] . "</option>";
}
echo "</select></td>\n";
}
echo '<td><input type="text" id="valueAttribute" name="valueAttribute" size="40" placeholder="New value for the attribute"></td></tr></table>';
mysqli_close($conn);
}
?>
<tr><td colspan=2><input type="submit" name="submit" value="Send"></form></td></tr>
</table>
</div>
</div>
</body>
</html>