Редакция 2 | Редакция 11 | К новейшей редакции | Только различия | Не учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 2 | Редакция 8 | ||
---|---|---|---|
1 | <?php
|
1 | <?php
|
2 | 2 | ||
3 | include "lib/init.php"; |
3 | include "lib/init.php"; |
4 | $status = abs(intval($_GET["step"])); |
4 | $status = abs(intval($_GET["step"])); |
5 | $dist = abs(intval($_GET["d"])); |
5 | $dist = abs(intval($_GET["d"])); |
6 | $vers = abs(intval($_GET["v"])); |
6 | $vers = abs(intval($_GET["v"])); |
7 | 7 | ||
8 | $query =& $db->query("SELECT * FROM distribution"); |
8 | $query =& $db->query("SELECT * FROM distribution"); |
9 | while ($query->fetchInto($data, DB_FETCHMODE_ASSOC)) { |
9 | while ($query->fetchInto($data, DB_FETCHMODE_ASSOC)) { |
10 | $linux .= "<input type='radio' name='d' value='".$data["dist_id"]."'>".stripslashes($data["distname"])."<br>\n"; |
10 | $linux .= "<input type='radio' name='d' value='".$data["dist_id"]."'>".stripslashes($data["distname"])."<br>\n"; |
11 | }
|
11 | }
|
12 | 12 | ||
13 | if (!isset($status)) { $status = 0; }; |
13 | if (!isset($status)) { $status = 0; }; |
14 | 14 | ||
15 | if (isset($dist)) { |
15 | if (isset($dist)) { |
16 | $query =& $db->query("SELECT * FROM version v JOIN distribution d ON d.dist_id=v.dist_id WHERE v.dist_id='$dist'"); |
16 | $query =& $db->query("SELECT * FROM version v JOIN distribution d ON d.dist_id=v.dist_id WHERE v.dist_id='$dist'"); |
17 | $distvers = "<input type='hidden' name='d' value='".$dist."'>\n"; |
17 | $distvers = "<input type='hidden' name='d' value='".$dist."'>\n"; |
18 | while ($query->fetchInto($version, DB_FETCHMODE_ASSOC)) { |
18 | while ($query->fetchInto($version, DB_FETCHMODE_ASSOC)) { |
19 | if ($version["vname"]!="") { |
19 | if ($version["vname"]!="") { |
20 | $distname = "“".stripslashes($version["vname"])."”"; |
20 | $distname = "“".stripslashes($version["vname"])."”"; |
21 | } else { |
21 | } else { |
22 | $distname = ""; |
22 | $distname = ""; |
23 | }
|
23 | }
|
24 | $distvers .= "<input type='radio' name='v' value='".$version["version_id"]."'>".stripslashes($version["distname"])." ".stripslashes($version["version"])." ".$distname."<br>\n"; |
24 | $distvers .= "<input type='radio' name='v' value='".$version["version_id"]."'>".stripslashes($version["distname"])." ".stripslashes($version["version"])." ".$distname."<br>\n"; |
25 | }
|
25 | }
|
26 | }
|
26 | }
|
27 | 27 | ||
28 | if (isset($vers)) { |
28 | if (isset($vers)) { |
- | 29 | $query =& $db->query("SELECT * FROM settings"); |
|
- | 30 | $settings = array(); |
|
- | 31 | while ($query->fetchInto($setting, DB_FETCHMODE_ASSOC)) { |
|
- | 32 | $settings[stripslashes($setting["opt"])] = stripslashes($setting["optvalue"]); |
|
- | 33 | }; |
|
29 | $query =& $db->query("SELECT * FROM version v JOIN distribution d ON d.dist_id=v.dist_id JOIN dtype p ON d.disttype=p.type_id WHERE v.dist_id='$dist' AND v.version_id='$vers'"); |
34 | $query =& $db->query("SELECT * FROM version v JOIN distribution d ON d.dist_id=v.dist_id JOIN dtype p ON d.disttype=p.type_id WHERE v.dist_id='$dist' AND v.version_id='$vers'"); |
30 | $query->fetchInto($infodist, DB_FETCHMODE_ASSOC); |
35 | $query->fetchInto($infodist, DB_FETCHMODE_ASSOC); |
31 | $distname = ""; |
36 | $distname = ""; |
32 | if ($infodist["vname"]!="") { |
37 | if ($infodist["vname"]!="") { |
33 | $distname = "“".stripslashes($infodist["vname"])."”"; |
38 | $distname = "“".stripslashes($infodist["vname"])."”"; |
34 | }
|
39 | }
|
35 | $info = "Доступные репозитории для <em>".stripslashes($infodist["distname"])." ".stripslashes($infodist["version"])." ".$distname."</em>"; |
40 | $info = "Доступные репозитории для <em>".stripslashes($infodist["distname"])." ".stripslashes($infodist["version"])." ".$distname."</em>"; |
36 | $query =& $db->query("SELECT * FROM repository r JOIN ver2rep v ON r.rep_id=v.rep_id JOIN version v2 ON v.ver_id=v2.version_id WHERE v.ver_id='$vers' ORDER BY r.reptype ASC"); |
41 | $query =& $db->query("SELECT * FROM repository r JOIN ver2rep v ON r.rep_id=v.rep_id JOIN version v2 ON v.ver_id=v2.version_id JOIN scheme s ON s.scheme_id=r.scheme_id WHERE v.ver_id='$vers' ORDER BY r.scheme_id ASC"); |
37 | $result = "<pre>"; |
42 | $result = "<pre>"; |
38 | while ($query->fetchInto($resinfo, DB_FETCHMODE_ASSOC)) { |
43 | while ($query->fetchInto($resinfo, DB_FETCHMODE_ASSOC)) { |
39 | switch ($resinfo["reptype"]) { |
44 | $repscheme = stripslashes($resinfo["scheme"]); |
40 | case '1': |
- | |
41 | $result .= stripslashes($infodist["type"])." http://apt.nix-files.org.ru/".stripslashes($resinfo["repname"])." ".stripslashes($resinfo["vcodename"])." "; |
- | |
42 | break; |
- | |
43 | case '2': |
- | |
44 | if ($infodist["dist_id"]==1) { |
- | |
45 | $result .= stripslashes($infodist["type"])." http://apt.nix-files.org.ru/".stripslashes($resinfo["repname"])." ".stripslashes($resinfo["vcodename"])."/updates "; |
- | |
46 | } else { |
- | |
47 | $result .= stripslashes($infodist["type"])." http://apt.nix-files.org.ru/".stripslashes($resinfo["repname"])." ".stripslashes($resinfo["vcodename"])."-security "; |
- | |
48 | }
|
- | |
49 | break; |
- | |
50 | case '3': |
- | |
- | 45 | ||
51 | if ($infodist["dist_id"]==1) { |
46 | $querysect =& $db->query("SELECT * FROM section s JOIN sect2rep r ON s.sect_id=r.sect_id WHERE |
52 | $result .= stripslashes($infodist["type"])." http://apt.nix-files.org.ru/".stripslashes($resinfo["repname"])." ".stripslashes($resinfo["vcodename"])."-proposed-updates "; |
- | |
53 | } else { |
- | |
54 | $result .= stripslashes($infodist["type"])." http://apt.nix-files.org.ru/".stripslashes($resinfo["repname"])." ".stripslashes($resinfo["vcodename"])."-updates "; |
- | |
55 | }
|
- | |
56 | break; |
- | |
57 | case '4': |
- | |
58 | $result .= stripslashes($infodist["type"])." http://apt.nix-files.org.ru/".stripslashes($resinfo["repname"])." ".stripslashes($resinfo["vcodename"])."-backports "; |
- | |
59 | break; |
47 | r.rep_id='$resinfo[rep_id]'"); |
60 | case '5': |
48 | $sections = ""; |
61 | $result .= stripslashes($infodist["type"])." http://apt.nix-files.org.ru/".stripslashes($resinfo["repname"])." ".stripslashes($resinfo["vcodename"])." "; |
- | |
62 | break; |
- | |
63 | }
|
- | |
64 | $querysect =& $db->query("SELECT * FROM section s JOIN sect2rep r ON s.sect_id=r.sect_id WHERE r.rep_id='$resinfo[rep_id]'"); |
- | |
65 | while ($querysect->fetchInto($section,DB_FETCHMODE_ASSOC)) { |
49 | while ($querysect->fetchInto($section,DB_FETCHMODE_ASSOC)) { |
66 | $result .= stripslashes($section["sectname"])." "; |
50 | $sections .= stripslashes($section["sectname"])." "; |
67 | }
|
51 | }
|
- | 52 | ||
- | 53 | $repscheme = str_replace("{TYPE}",stripslashes($infodist["type"]),$repscheme); |
|
- | 54 | $repscheme = str_replace("{PROTO}",$settings["proto"],$repscheme); |
|
- | 55 | $repscheme = str_replace("{URL}",$settings["url"],$repscheme); |
|
- | 56 | $repscheme = str_replace("{REP}",stripslashes($resinfo["repname"]),$repscheme); |
|
- | 57 | $repscheme = str_replace("{DIST}",stripslashes($infodist["vcodename"]),$repscheme); |
|
- | 58 | $repscheme = str_replace("{SECT}",$sections,$repscheme); |
|
- | 59 | ||
68 | $result .= "\n"; |
60 | $result .= $repscheme."\n"; |
69 | }
|
61 | }
|
70 | $result .= "</pre>"; |
62 | $result .= "</pre>"; |
71 | $result = $info.$result; |
63 | $result = $info.$result; |
72 | }
|
64 | }
|
73 | 65 | ||
74 | $smarty->assign('status',$status); |
66 | $smarty->assign('status',$status); |
75 | $smarty->assign('linux',$linux); |
67 | $smarty->assign('linux',$linux); |
76 | $smarty->assign('version',$distvers); |
68 | $smarty->assign('version',$distvers); |
77 | $smarty->assign('result',$result); |
69 | $smarty->assign('result',$result); |
78 | 70 | ||
79 | $smarty->display('index.tpl'); |
71 | $smarty->display('index.tpl'); |
80 | 72 | ||
81 | ?>
|
73 | ?>
|
82 | 74 |