-
Notifications
You must be signed in to change notification settings - Fork 4
/
im_gui.php
67 lines (61 loc) · 1.68 KB
/
im_gui.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
61
62
63
64
65
66
67
<?php
include("include.php");
$update = $_GET["update"];
$id = $_GET["id"];
$eventId = $_GET["eventId"];
$name = $_GET["name"];
$x = $_GET["x"];
$y = $_GET["y"];
$w = $_GET["w"];
$h = $_GET["h"];
$load = $_GET["load"];
if ($update) {
$attr = array();
if ($update == "pos")
$attr = array("x" => $x, "y" => $y);
if ($update == "size") {
$attr = array("w" => $w, "h" => $h, "x" => $x, "y" => $y);
}
foreach ($attr as $key => $value) {
$query = "REPLACE into cdb (`title_id`,`name`,`key`,`value`) VALUES (\"$id\",\"$name\",\"$key\",\"$value\");";
echo($query);
dbquery($query);
}
}
if ($load == "attrs") {
$result = getTitle($id,$eventId,false)['geos'][$name];
echo("<h2>" . $result["name"] . "</h2>\n");
unset($result["name"]);
foreach ($result as $key => $value) {
$o = "";
$o .= "<form id=\"edit_form\" action\"javascript:true\" \"method=\"GET\">";
$o .= $key . ": ";
$o .= "\t<input type=\"hidden\" name=\"" . $id . "\" value=\"" . $name . "\" />";
$o .= "\t<input class=\"info\" type=\"text\" id=\"info-$key\" name=\"$key\" value=\"" . $value . "\" />\n";
$o .= "</form>\n";
echo $o;
}
?>
<script type="text/javascript">
$("form").submit(function() {
var form = $(this);
$.ajax({
type: "POST",
url: "cdb_update.php",
data: $(this).serializeArray(),
success: function(data) {
form.children("input:last").removeClass("outdated")
form.children("input:last").addClass("updated")
}
});
return false;
});
$("input").change(function(){
$(this).removeClass("updated");
$(this).addClass("outdated");
});
</script>
<?
} else if ($load == "layers") {
}
?>