ajax
addSiteXML.php
delete-notes.php
post-config.php
post-notes.php
saveTodoist.php
update-city.php
update.php
update_position.php
update_position_config.php
class
css
db
images
js
.htaccess
CURL.php
GoogleMeteo.php
addSite.php
add_note.html
blogs.php
blogs_last_post.php
calculator.html
config.php
getProjectsList.php
getUncompletedTasks.php
index.php
install-todoist.php
meteo.php
notepad.html
notes_extract.php
23 lines
697 B
PHP
23 lines
697 B
PHP
<?php
|
|
// Error reporting
|
|
error_reporting(E_ALL^E_NOTICE);
|
|
|
|
// Validating the input data:
|
|
if(!is_numeric($_GET['id']) || !is_numeric($_GET['x']) || !is_numeric($_GET['y']) || !is_numeric($_GET['z']))
|
|
die("0");
|
|
|
|
// Escaping:
|
|
$id = (int)$_GET['id'];
|
|
$x = (int)$_GET['x'];
|
|
$y = (int)$_GET['y'];
|
|
$z = (int)$_GET['z'];
|
|
|
|
|
|
// Saving the position and z-index of the note:
|
|
$xmla = simplexml_load_file('../db/notes.xml');
|
|
|
|
$target = -1;
|
|
$i = 0;
|
|
|
|
foreach ($xmla->note as $s) {
|
|
if ($s['id']==$id) { $target = $i; break; }
|
|
$i++;
|
|
}
|
|
|
|
$xmla->note[$target]->top = $y;
|
|
$xmla->note[$target]->left = $x;
|
|
$xmla->note[$target]->zindex = $z;
|
|
|
|
|
|
$xmla->asXML('../db/notes.xml');
|
|
|
|
echo $target;
|
|
?>
|