HB/game/bugs.php

28 lines
1.1 KiB
PHP
Raw Normal View History

2008-11-17 11:00:00 +00:00
<?php
if(!defined('INDEX')) { header('Location: ../'); exit; }
$page = 'bugs';
$titre = 'Rapports de bugs';
if (!empty($_POST['page']) && !empty($_POST['description'])) {
2008-11-22 11:00:00 +00:00
$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');");
2008-11-17 11:00:00 +00:00
header('Location: ?p=bugs');
}
elseif (isset($_GET['a']) && $_GET['a'] == 'del' && isset($_GET['i']) && $sess->values['auth_level'] > 2) {
2008-11-22 11:00:00 +00:00
$i = $_GET['i'];
$chapeau->escape($i);
$chapeau->query("DELETE FROM `$table_bug` WHERE `id` = '$i' LIMIT 1");
2008-11-17 11:00:00 +00:00
header('Location: ?p=bugs');
}
2008-11-22 11:00:00 +00:00
$bugs = $chapeau->query("SELECT * FROM `$table_bug` ORDER BY `id` DESC");
2008-11-17 11:00:00 +00:00
$TEMP_bugs = array();
2008-11-22 11:00:00 +00:00
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']);
2008-11-17 11:00:00 +00:00
}
$template->assign('bugs', $TEMP_bugs);
?>