Ajout de la fonctionnalité d'upload de module.

This commit is contained in:
Chouchen
2010-09-27 14:37:14 +00:00
parent 734e6f4829
commit 5a8dbbb330
12 changed files with 78 additions and 138 deletions

View File

@@ -1,25 +0,0 @@
<?// Escaping the input data:
$rid = $_POST['id'];
$explodeid = explode("-",$rid);
$id = intval($explodeid[1]);
$xmla = simplexml_load_file('../db/notes.xml');
$target = false;
$i = 0;
foreach ($xmla->note as $s) {
if ($s['id']==$id) { $target = $i; break; }
$i++;
}
if ($target !== false) {
unset($xmla->note[$target]);
}
$xmla->asXML('../db/notes.xml');
$target++;
echo $target;
?>

View File

@@ -1,29 +0,0 @@
<?// Escaping the input data:
$body = $_POST['body'];
$color = $_POST['color'];
$zindex = $_POST['zindex'];
$nb = 1;
$xmla = simplexml_load_file('../db/notes.xml');
$field_count = count($xmla->note);
/*foreach($xmla->note as $test){
if($nb < $test['id']){$nb=$test['id'];}
}*/
$test = $xmla->note;
for($i=0;$i<$field_count;$i++){
if($nb <= $test[$i]['id']) $nb = $test[$i]['id']+1;
}
$newnote = $xmla->addChild('note');
$newnote->addAttribute("id", $nb);
$newnote->addChild('text', $body);
$newnote->addChild('color', $color);
$newnote->addChild('zindex', $zindex);
$newnote->addChild('top', '0');
$newnote->addChild('left', '0');
$xmla->asXML('../db/notes.xml');
echo $nb;
?>

View File

@@ -1,10 +0,0 @@
<?php
// Error reporting
error_reporting(E_ALL^E_NOTICE);
// Escaping:
$city = $_GET['city'];
include '../class/AccueilModules.php';
echo AccueilModules::updateModule('weather', array('city'=>$city));
?>