forked from chaosarium/lwt
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathinline_edit.php
51 lines (44 loc) · 1.16 KB
/
inline_edit.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
<?php
/**
* Call: inline_edit.php?...
* ...
*
* PHP version 8.1
*
*/
require_once 'inc/session_utility.php';
$value = (isset($_POST['value'])) ? $_POST['value'] : "";
$value = trim($value);
$id = (isset($_POST['id'])) ? $_POST['id'] : "";
if (substr($id, 0, 5) == "trans") {
$id = substr($id, 5);
if($value == '') { $value='*';
}
runsql(
'update ' . $tbpref . 'words set WoTranslation = ' .
convert_string_to_sqlsyntax(repl_tab_nl($value)) . ' where WoID = ' . $id,
""
);
echo get_first_value("select WoTranslation as value from " . $tbpref . "words where WoID = " . $id);
exit;
}
if (substr($id, 0, 5) == "roman") {
if ($value == '*') { $value='';
}
$id = substr($id, 5);
runsql(
'update ' . $tbpref . 'words set WoRomanization = ' .
convert_string_to_sqlsyntax(repl_tab_nl($value)) . ' where WoID = ' . $id,
""
);
$value = get_first_value("select WoRomanization as value from " . $tbpref . "words where WoID = " . $id);
if ($value == '') {
echo '*';
}
else {
echo $value;
}
exit;
}
echo "ERROR - please refresh page!";
?>