-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
161 lines (141 loc) · 5.62 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script language="Javascript">
function ouvreFenetre(page, largeur, hauteur) {
window.open(page, "", "scrollbars=yes,menubar=no,toolbar=no,resizable=no,width=800,height=600,width=800,height=600,top=250,left=430");
}
</script>
<?
require './config.php';
require './connect.php';
connect();
if ($_GET['mode'] == 'add')
{
if( $_GET['titre']!="" ) {
mysql_query('INSERT INTO '.$table.' SET date=CONCAT(CURDATE(),\' \',CURTIME()), titre="'.htmlentities( $_GET['titre'], ENT_QUOTES ).'", level="'.htmlentities( $_GET['level'], ENT_QUOTES ).'", fait=0' ) or die(mysql_error());
echo '<meta http-equiv="refresh" content="0;url=./" />';
}
}
if ($_GET['mode'] == 'valid')
{
mysql_query('UPDATE '.$table.' SET fait=1 WHERE id='.$_GET['id'] ) or die(mysql_error());
echo '<meta http-equiv="refresh" content="0;url=./" />';
}
if ($_GET['mode'] == 'unvalid')
{
mysql_query('UPDATE '.$table.' SET fait=0 WHERE id='.$_GET['id'] ) or die(mysql_error());
echo '<meta http-equiv="refresh" content="0;url=./" />';
}
if ($_GET['mode'] == 'del')
{
mysql_query("DELETE FROM ".$table." WHERE id=".$_GET['id']." LIMIT 1;") or die(mysql_error());
echo '<meta http-equiv="refresh" content="0;url=?mode=histo" />';
die();
}
?>
<html>
<head>
<title><? echo $title; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!--
<meta http-equiv="refresh" content="30;">
-->
<style type="text/css">
<!--
.text1 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;color: White;text-align : left;}
.text2 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;color: Silver;text-align : left;}
.titre1 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;font-weight: bold;color: #FFFFFF;}
.titre2 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;font-weight: bold;color: #cccccc;}
input
{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
border: 1px solid #0F277B;
}
body {
#background-image: url(img/fond2.jpg);
background-color: #525A73;
background-attachment:fixed
}
-->
</style>
<base target="_self"/>
</head>
<table width="" height="100%" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td align="center" valign="top">
<table width="100%" border="0" cellspacing="2" cellpadding="0" align="center">
<table width="100%" border="0" cellspacing="4" cellpadding="0" align="center">
<tr>
<td><img src="img/cube_rouge_small.gif" width="18" height="20"></td>
<td width="100%" nowrap class="titre1"><? if ($_GET['mode'] != 'histo' ) { echo ' A faire :';} else { echo ' Deja fait :'; } ?></td>
</tr>
</table>
<table width="600px" border="0" cellspacing="2" cellpadding="0" align="center">
<?
if ($_GET['mode'] != 'histo' ) {
$req = mysql_query('SELECT titre,id,level FROM '.$table.' WHERE fait != 1 ORDER BY level DESC, titre ASC');
while ($res = mysql_fetch_object($req))
{
if ( $res->level == "3" ) { $image="img/level_3.gif"; }
else if ( $res->level == "2" ) { $image="img/level_2.gif"; }
else { $image="img/level_1.gif"; }
echo '<tr><td nowrap class="text1">  </td>';
echo '<td bgcolor="#44495a" class="text1">';
echo '<img src="'.$image.'" border=0></a> <b>></b> ';
echo $res->titre;
echo '</td><td align="right" width="60px"> <a href="javascript:ouvreFenetre(\'popup.php?mode=voir&id='.$res->id.'\', 300, 100)"><img src="img/index.gif" align="absbottom" border=0></a>';
echo ' <a href="index.php?mode=valid&id='.$res->id.'"><img src="img/valid.gif" align="absbottom" border=0></a></td></tr>';
}
} //
else {
$req = mysql_query('SELECT titre,id,level FROM '.$table.' WHERE fait = 1 ORDER BY level DESC, titre ASC LIMIT 20');
while ($res = mysql_fetch_object($req))
{
if ( $res->level == "3" ) { $image="img/level_3.gif"; }
else if ( $res->level == "2" ) { $image="img/level_2.gif"; }
else { $image="img/level_1.gif"; }
?>
<tr>
<td nowrap class="text1"> </td>
<td class="text1">
<img src="<?=$image; ?>" border=0></a> <b>></b>
<?=$res->titre; ?>
</td>
<td align="right" width="90px">
<a href="javascript:ouvreFenetre('popup.php?mode=voir&id=<?=$res->id; ?>', 300, 100)"><img src="img/index.gif" align="absbottom" border=0></a>
<a href="index.php?mode=del&id=<?=$res->id; ?>"><img src="img/del.png" align="absbottom" border=0></a>
<a href="index.php?mode=unvalid&id=<?=$res->id; ?>"><img src="img/refresh.png" align="absbottom" border=0></a>
</td>
</tr>
<?
}
}
?>
</table>
</td>
</tr>
<tr>
<td valign="bottom">
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<form action="index.php" method="GET">
<tr class = "titre2" >
<span class="titre1">historique :</span> <? if( $_GET['mode'] == histo) { echo '<a class = "titre2" href="index.php?mode=liste">off</a>';} else { echo '<a class = "titre2" href="index.php?mode=histo">on</a>'; } ?>
<td class="text1">
<select size="1" name="level">
<option selected value="1">Low</option>
<option value="2">Med</option>
<option value="3">High</option>
</select>
<input type="hidden" name="mode" value="add">
<input name="titre" type="text" value="" size="24"> <input type="submit" value="Ajouter">
</td>
</tr>
</form>
</table>
</td>
</tr>
</body>
</html>