93 lines
2.6 KiB
PHP
Executable File
93 lines
2.6 KiB
PHP
Executable File
<?
|
||
include("mysql_compat.php");
|
||
$db=mysql_connect('localhost', 'root', '');
|
||
|
||
$s='\'';
|
||
|
||
$s='\'';
|
||
#$cateory_selected='MYSQL';
|
||
?>
|
||
<html>
|
||
|
||
<head>
|
||
<meta http-equiv="Content-Language" content="fr">
|
||
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
|
||
<title>pour consulter la base</title>
|
||
</head>
|
||
|
||
<body background="_themes/sumipntg/sumtextb.jpg" bgcolor="#FFFFFF" text="#000066" link="#3333CC" vlink="#666699" alink="#990099"><!--mstheme--><font face="Verdana, Arial, Helvetica">
|
||
|
||
|
||
<BR><BR>
|
||
<CENTER><A HREF=mailto:andre.castelli@francetelecom.com ><IMG SRC=images/bandeau-bas955.gif border=0 ></A></CENTER>
|
||
<p><H1><BLINK>ADMIN MODE<BR></BLINK>Consultation de la Knowledge Base</H1></p>
|
||
|
||
<form name="monform"
|
||
method="get"
|
||
action="<?php echo $PHP_SELF ?>">
|
||
|
||
<p>Choisissez la rubrique : <select NAME="category_selected">
|
||
<?
|
||
printf("<option VALUE=ALL>ALL");
|
||
$sql = "SELECT * FROM categories ORDER BY name;";
|
||
$result=mysqli_query($db, $sql);
|
||
while ($item = mysqli_fetch_array($result))
|
||
{
|
||
if ($category_selected == NULL) { $category_selected = "ALL";}
|
||
if ($item["name"] != $category_selected) { printf("<option VALUE=\"%s\">%s", $item["name"], $item["name"]);}
|
||
else { printf("<option SELECTED VALUE=\"%s\">%s", $item["name"], $item["name"]);}
|
||
}
|
||
?> </select>
|
||
<input type="submit" name="submit" value="Refresh"></p>
|
||
</form>
|
||
<BR>
|
||
<?
|
||
$sql="SELECT id FROM categories WHERE name=$s$category_selected$s";
|
||
$result=mysqli_query($db, $sql);
|
||
$item = mysqli_fetch_array($result);
|
||
$catnum=$item["id"];
|
||
|
||
if ($category_selected == "ALL") { $sql="SELECT * FROM kb"; }
|
||
else { $sql="SELECT * FROM kb where category=$catnum"; }
|
||
$result=mysqli_query($db, $sql);
|
||
?>
|
||
|
||
<TABLE width="100%" border=1>
|
||
|
||
<?
|
||
$id=-1;
|
||
$doitonce=0;
|
||
$space='width="15%"';
|
||
while ($item = mysqli_fetch_array($result))
|
||
{
|
||
$id=$item["id"];
|
||
if (!($doitonce)) {printf("<TR><TD %s><B>IP Source</TD><TD %s><B>Article ID</TD><TD><B>Titre</TD>", $space, $space, $id, $id, $item["title"]);}
|
||
printf("<TR><TD %s>%s</TD><TD %s>#%s</TD><TD><A HREF=\"article.php?id=%s\">%s</A></TD></TR>", $space, $item["ip"], $space, $id, $id, $item["title"]);
|
||
$doitonce=1;
|
||
}
|
||
if ($id == -1)
|
||
{
|
||
# reponse vide: pas d'article pour cette categorie
|
||
print "Il n'existe pas d'article concernant cette rubrique.";
|
||
print "<BR>Essayez une autre cat<61>gorie.<BR>";
|
||
}
|
||
|
||
?>
|
||
<SCRIPT>
|
||
function doBlink() {
|
||
var blink = document.all.tags("BLINK")
|
||
for (var i=0; i < blink.length; i++)
|
||
blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" :
|
||
""
|
||
}
|
||
|
||
function startBlink() {
|
||
// Make sure it is IE4
|
||
if (document.all)
|
||
setInterval("doBlink()",1000)
|
||
}
|
||
window.onload = startBlink;
|
||
</SCRIPT>
|
||
|
||
|