- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 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
if(isset($input['submitted']))
{
mysql_query("UPDATE modules SET loading = 0");
$query = mysql_query("SELECT class from modules");
while(list($cl) = mysql_fetch_row($query))
{
if(strtolower($input[$cl]) == "on")
{
mysql_query("UPDATE modules SET loading = 1 WHERE class = '".$cl."'");
}
}
mysql_query("UPDATE modules SET loading =1 WHERE class='conf'");
print "<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=?class=conf&action=control\">";
}
$query = mysql_query("SELECT class,loading FROM modules");
while($data = mysql_fetch_row($query)) $load[$data[0]] = $data[1];
print "<table border=\"1\" style=\"border-style:solid\" cellpadding=\"5\" cellspacing =\"2\">\n";
print "<form method=\"post\">\n<input type=\"hidden\" name=\"class\" value=\"conf\"><input type=\"hidden\" name=\"action\" value=\"control\">\n<tr><td class=\"text\" align=\"center\"><b>Название</b></td><td class=\"text\" align=\"center\"><b>Описание</b></td><td class=\"text\" align=\"center\"><b>Файлы</b>\n
</td><td class=\"text\"><b>Загружается</b></td></tr>";
$query = mysql_query("SELECT * FROM modules") or die(mysql_error());
while($data = mysql_fetch_array($query))
{
print "<tr><td class=\"text\">".$data['title']."</td><td class=\"text\">".$data['descr']."</td><td class=\"text\">";
$_f = explode("\n",trim($data['files']));
$c = count($_f);
for($i=0;$i<$c;$i++)print $_f[$i]."<br>\n";
print "</td><td class=\"text\"><input type=\"checkbox\" name=\"".$data['class']."\" ";
if($load[$data['class']] == 1) print "CHECKED";
print " ></td></tr>";
}
print "</table>\n";
print "<input type=\"hidden\" name=\"submitted\" value=\"1\">\n";
print "<br><input type=\"submit\" value=\"Применить\"></form>";
nolka4 18.12.2009 13:45 # 0
paranoid 18.12.2009 14:32 # 0
плакать хочиццо