Version avec modules séparés !

This commit is contained in:
Chouchen
2010-09-27 10:48:53 +00:00
parent 2861556131
commit 734e6f4829
81 changed files with 324 additions and 264 deletions

58
includes/addLink.php Normal file
View File

@@ -0,0 +1,58 @@
<?php
$url = $_POST['urlField'];
$popup = $_POST['popupField'];
$img = $_FILES['imgField'];
$title = $_POST['titreField'];
// Préparation de l'image2
$content_dir = 'images/links/'; // dossier où sera déplacé le fichier
$tmp_file = $img['tmp_name']; // Fichier temporaire
// Vérification de l'upload
if( !is_uploaded_file($tmp_file) )
{
exit("Le fichier est introuvable");
}
// on vérifie maintenant l'extension
$type_file = $img['type'];
if( !strstr($type_file, 'jpg') && !strstr($type_file, 'jpeg') && !strstr($type_file, 'png') && !strstr($type_file, 'gif') )
{
exit("Le fichier n'est pas une image");
}
// on copie le fichier dans le dossier de destination
$name_file = $img['name'];
if( preg_match('#[\x00-\x1F\x7F-\x9F/\\\\]#', $name_file) )
{
exit("Nom de fichier non valide");
}
else if( !move_uploaded_file($tmp_file, $content_dir . $name_file) )
{
exit("Impossible de copier le fichier dans $content_dir");
}
$doc = new DOMDocument;
$doc->load('db/links.xml');
$xpath = new DOMXpath($doc);
// Creating new node
$newNode = $doc->createElement('link');
$newURL = $doc->createElement('url', $url);
if($popup == '1')
$newClick = $doc->createElement('onclick', 'popup');
else
$newClick = $doc->createElement('onclick', '');
$newImg = $doc->createElement('img', $name_file);
$newTitle = $doc->createElement('title', $title);
$newNode->appendChild($newURL);
$newNode->appendChild($newClick);
$newNode->appendChild($newImg);
$newNode->appendChild($newTitle);
$searchLabel = $xpath->query('reserve');
$searchLabel->item(0)->appendChild($newNode);
$doc->save('db/links.xml');

62
includes/calculator.html Normal file
View File

@@ -0,0 +1,62 @@
<html>
<head>
<title>Calculator</title>
<link rel="stylesheet" type="text/css" href="css/calculator.css"/>
</head>
<body>
<div id="calculator">
<div id="display">
<div id="display_cell">
<div id="display_scroll">
<table id="display_grid">
<col id="display_gutter"/>
<col id="display_main"/>
<col id="display_other"/>
<!-- the display lines go into this empty tbody -->
<tbody id="display_grid_body"/>
</table>
</div>
</div>
</div>
<div id="divide">
<div><button>+</button></div>
</div>
<div id="button_pad">
<table>
<tbody>
<tr>
<td><button id="kp_7" class="pad_button">7</button></td>
<td><button id="kp_8" class="pad_button">8</button></td>
<td><button id="kp_9" class="pad_button">9</button></td>
<td><button id="kp_div" class="pad_button round_pad_button">&divide;</button></td>
</tr>
<tr>
<td><button id="kp_4" class="pad_button">4</button></td>
<td><button id="kp_5" class="pad_button">5</button></td>
<td><button id="kp_6" class="pad_button">6</button></td>
<td><button id="kp_mul" class="pad_button round_pad_button">&times;</button></td>
</tr>
<tr>
<td><button id="kp_1" class="pad_button">1</button></td>
<td><button id="kp_2" class="pad_button">2</button></td>
<td><button id="kp_3" class="pad_button">3</button></td>
<td><button id="kp_sub" class="pad_button round_pad_button">&minus;</button></td>
</tr>
<tr>
<td><button id="kp_0" class="pad_button">0</button></td>
<td><button id="kp_dot" class="pad_button round_pad_button">.</button></td>
<td><button id="kp_eq" class="pad_button round_pad_button">=</button></td>
<td><button id="kp_add" class="pad_button round_pad_button">+</button></td>
</tr>
</tbody>
</table>
</div>
</div>
<script type="text/javascript" src="js/calculator.js"></script>
<script type="text/javascript">
var calculator = new Calculator();
window.addEventListener('load', calculator.init.bind(calculator), false);
</script>
</body>
</html>

28
includes/notepad.html Normal file
View File

@@ -0,0 +1,28 @@
<html>
<head>
<title> Notepad </title>
<style type="text/css">
<!--
#container{
width:318px;
height:358px;
border:0px solid #000;
overflow:hidden;
margin:auto;
}
#container iframe {
width:318px;
height:535px;
margin-left:0px;
margin-top:-130px;
border:0 solid;
}
-->
</style>
</head>
<body style="margin: 0; padding: 0;">
<div id="container">
<iframe src="https://docs.google.com/Doc?id=dgr5f47c_3hkf9qxfh" scrolling="auto"/>
</div>
</body>
</html>