Редакция 2 | К новейшей редакции | Только различия | Не учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 2 | Редакция 3 | ||
---|---|---|---|
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 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'"); |
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'"); |
30 | $query->fetchInto($infodist, DB_FETCHMODE_ASSOC); |
30 | $query->fetchInto($infodist, DB_FETCHMODE_ASSOC); |
31 | $distname = ""; |
31 | $distname = ""; |
32 | if ($infodist["vname"]!="") { |
32 | if ($infodist["vname"]!="") { |
33 | $distname = "“".stripslashes($infodist["vname"])."”"; |
33 | $distname = "“".stripslashes($infodist["vname"])."”"; |
34 | }
|
34 | }
|
35 | $info = "Доступные репозитории для <em>".stripslashes($infodist["distname"])." ".stripslashes($infodist["version"])." ".$distname."</em>"; |
35 | $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"); |
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"); |
37 | $result = "<pre>"; |
37 | $result = "<pre>"; |
38 | while ($query->fetchInto($resinfo, DB_FETCHMODE_ASSOC)) { |
38 | while ($query->fetchInto($resinfo, DB_FETCHMODE_ASSOC)) { |
39 | switch ($resinfo["reptype"]) { |
39 | switch ($resinfo["reptype"]) { |
40 | case '1': |
40 | case '1': |
41 | $result .= stripslashes($infodist["type"])." http://apt.nix-files.org.ru/".stripslashes($resinfo["repname"])." ".stripslashes($resinfo["vcodename"])." "; |
41 | $result .= stripslashes($infodist["type"])." http://apt.nix-files.org.ru/".stripslashes($resinfo["repname"])." ".stripslashes($resinfo["vcodename"])." "; |
42 | break; |
42 | break; |
43 | case '2': |
43 | case '2': |
44 | if ($infodist["dist_id"]==1) { |
44 | if ($infodist["dist_id"]==1) { |
45 | $result .= stripslashes($infodist["type"])." http://apt.nix-files.org.ru/".stripslashes($resinfo["repname"])." ".stripslashes($resinfo["vcodename"])."/updates "; |
45 | $result .= stripslashes($infodist["type"])." http://apt.nix-files.org.ru/".stripslashes($resinfo["repname"])." ".stripslashes($resinfo["vcodename"])."/updates "; |
46 | } else { |
46 | } else { |
47 | $result .= stripslashes($infodist["type"])." http://apt.nix-files.org.ru/".stripslashes($resinfo["repname"])." ".stripslashes($resinfo["vcodename"])."-security "; |
47 | $result .= stripslashes($infodist["type"])." http://apt.nix-files.org.ru/".stripslashes($resinfo["repname"])." ".stripslashes($resinfo["vcodename"])."-security "; |
48 | }
|
48 | }
|
49 | break; |
49 | break; |
50 | case '3': |
50 | case '3': |
51 | if ($infodist["dist_id"]==1) { |
51 | if ($infodist["dist_id"]==1) { |
52 | $result .= stripslashes($infodist["type"])." http://apt.nix-files.org.ru/".stripslashes($resinfo["repname"])." ".stripslashes($resinfo["vcodename"])."-proposed-updates "; |
52 | $result .= stripslashes($infodist["type"])." http://apt.nix-files.org.ru/".stripslashes($resinfo["repname"])." ".stripslashes($resinfo["vcodename"])."-proposed-updates "; |
53 | } else { |
53 | } else { |
54 | $result .= stripslashes($infodist["type"])." http://apt.nix-files.org.ru/".stripslashes($resinfo["repname"])." ".stripslashes($resinfo["vcodename"])."-updates "; |
54 | $result .= stripslashes($infodist["type"])." http://apt.nix-files.org.ru/".stripslashes($resinfo["repname"])." ".stripslashes($resinfo["vcodename"])."-updates "; |
55 | }
|
55 | }
|
56 | break; |
56 | break; |
57 | case '4': |
57 | case '4': |
58 | $result .= stripslashes($infodist["type"])." http://apt.nix-files.org.ru/".stripslashes($resinfo["repname"])." ".stripslashes($resinfo["vcodename"])."-backports "; |
58 | $result .= stripslashes($infodist["type"])." http://apt.nix-files.org.ru/".stripslashes($resinfo["repname"])." ".stripslashes($resinfo["vcodename"])."-backports "; |
59 | break; |
59 | break; |
60 | case '5': |
60 | case '5': |
61 | $result .= stripslashes($infodist["type"])." http://apt.nix-files.org.ru/".stripslashes($resinfo["repname"])." ".stripslashes($resinfo["vcodename"])." "; |
61 | $result .= stripslashes($infodist["type"])." http://apt.nix-files.org.ru/".stripslashes($resinfo["repname"])." ".stripslashes($resinfo["vcodename"])." "; |
62 | break; |
62 | break; |
63 | }
|
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]'"); |
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)) { |
65 | while ($querysect->fetchInto($section,DB_FETCHMODE_ASSOC)) { |
66 | $result .= stripslashes($section["sectname"])." "; |
66 | $result .= stripslashes($section["sectname"])." "; |
67 | }
|
67 | }
|
68 | $result .= "\n"; |
68 | $result .= "\n"; |
69 | }
|
69 | }
|
70 | $result .= "</pre>"; |
70 | $result .= "</pre>"; |
71 | $result = $info.$result; |
71 | $result = $info.$result; |
72 | }
|
72 | }
|
73 | 73 | ||
74 | $smarty->assign('status',$status); |
74 | $smarty->assign('status',$status); |
75 | $smarty->assign('linux',$linux); |
75 | $smarty->assign('linux',$linux); |
76 | $smarty->assign('version',$distvers); |
76 | $smarty->assign('version',$distvers); |
77 | $smarty->assign('result',$result); |
77 | $smarty->assign('result',$result); |
78 | 78 | ||
79 | $smarty->display('index.tpl'); |
79 | $smarty->display('index.tpl'); |
80 | 80 | ||
81 | ?>
|
81 | ?>
|
82 | 82 |