Version 1.2

This commit is contained in:
nemunaire 2008-11-22 12:00:00 +01:00
commit 083eb365c5
73 changed files with 1165 additions and 361 deletions

View file

@ -4,20 +4,25 @@ $page = 'bugs';
$titre = 'Rapports de bugs';
if (!empty($_POST['page']) && !empty($_POST['description'])) {
$pages = mysql_real_escape_string($_POST['page']);
$description = mysql_real_escape_string($_POST['description']);
$chapeau->query("INSERT INTO `bug` VALUES(NULL, '".$queryUser['pseudo']."', '".time()."', '$pages', '$description');");
$pages = $_POST['page'];
$chapeau->escape($pages);
$description = $_POST['description'];
$chapeau->escape($description);
$chapeau->query("INSERT INTO `$table_bug` VALUES(NULL, '".$queryUser['pseudo']."', '".time()."', '$pages', '$description');");
header('Location: ?p=bugs');
}
elseif (isset($_GET['a']) && $_GET['a'] == 'del' && isset($_GET['i']) && $sess->values['auth_level'] > 2) {
$chapeau->query("DELETE FROM `bug` WHERE `id` = '".$_GET['i']."' LIMIT 1");
$i = $_GET['i'];
$chapeau->escape($i);
$chapeau->query("DELETE FROM `$table_bug` WHERE `id` = '$i' LIMIT 1");
header('Location: ?p=bugs');
}
$result = mysql_query("SELECT * FROM `bug` ORDER BY `id` DESC");
$bugs = $chapeau->query("SELECT * FROM `$table_bug` ORDER BY `id` DESC");
$TEMP_bugs = array();
while ($data = mysql_fetch_array($result)) {
$TEMP_bugs[] = array('<a href="?p=envoyer&d='.$data['pseudo'].'">'.$data['pseudo'].'</a>', date("d/m/y", $data['temps']), $data['page'], nl2br($data['description']),$data['id'] );
for ($i = 0; $i < $chapeau->num_rows; $i++) {
$TEMP_bugs[] = array('<a href="?p=envoyer&d='.$bugs[$i]['pseudo'].'">'.$bugs[$i]['pseudo'].'</a>', date("d/m/y h:m:s", $bugs[$i]['temps']), $bugs[$i]['page'], nl2br(htmlspecialchars(str_replace('\\\'', '\'', $bugs[$i]['description']))), $bugs[$i]['id']);
}
$template->assign('bugs', $TEMP_bugs);
?>