Хранилища Subversion ant

Редакция

Редакция 2 | Содержимое файла | Сравнить с предыдущей | Последнее изменение | Открыть журнал | RSS

Редакция Автор № строки Строка
2 alex-w 1
<?php
2
 
3
include "lib/init.php";
4
$status = abs(intval($_GET["step"]));
5
$dist   = abs(intval($_GET["d"]));
6
$vers   = abs(intval($_GET["v"]));
7
 
8
$query =& $db->query("SELECT * FROM distribution");
9
while ($query->fetchInto($data, DB_FETCHMODE_ASSOC)) {
10
        $linux .= "<input type='radio' name='d' value='".$data["dist_id"]."'>".stripslashes($data["distname"])."<br>\n";
11
}
12
 
13
if (!isset($status)) { $status = 0; };
14
 
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'");
17
        $distvers = "<input type='hidden' name='d' value='".$dist."'>\n";
18
        while ($query->fetchInto($version, DB_FETCHMODE_ASSOC)) {
19
                if ($version["vname"]!="") {
20
                        $distname = "&#8220;".stripslashes($version["vname"])."&#8221;";
21
                } else {
22
                        $distname = "";
23
                }
24
                $distvers .= "<input type='radio' name='v' value='".$version["version_id"]."'>".stripslashes($version["distname"])." ".stripslashes($version["version"])." ".$distname."<br>\n";
25
        }
26
}
27
 
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'");
30
        $query->fetchInto($infodist, DB_FETCHMODE_ASSOC);
31
        $distname = "";
32
        if ($infodist["vname"]!="") {
33
                $distname = "&#8220;".stripslashes($infodist["vname"])."&#8221;";
34
        }
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");
37
        $result = "<pre>";
38
        while ($query->fetchInto($resinfo, DB_FETCHMODE_ASSOC)) {
39
            switch ($resinfo["reptype"]) {
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':
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 ";
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;
60
                case '5':
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)) {
66
                    $result .= stripslashes($section["sectname"])." ";
67
            }
68
        $result .= "\n";
69
        }
70
        $result .= "</pre>";
71
        $result = $info.$result;
72
}
73
 
74
$smarty->assign('status',$status);
75
$smarty->assign('linux',$linux);
76
$smarty->assign('version',$distvers);
77
$smarty->assign('result',$result);
78
 
79
$smarty->display('index.tpl');
80
 
81
?>