Хранилища Subversion ant

Редакция

Редакция 466 | Весь файл | Не учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS

Редакция 466 Редакция 468
Строка 1... Строка 1...
1
<?php
1
<?php
2
2
3
require_once 'DB.php';
3
require_once 'DB.php';
4
4
5
$dsn = 'sqlite://custom/apt.db?mode=0777';
5
$dsn = 'sqlite:///apt.db?mode=0777';
6
6
7
$db =& DB::connect($dsn);
7
$db_apt =& DB::connect($dsn);
8
if (PEAR::isError($db)) {
8
if (PEAR::isError($db_apt)) {
9
    die($db->getMessage());
9
    die($db_apt->getMessage());
10
}
10
}
11
11
-
 
12
$dsn = 'sqlite:///set.db?mode=0777';
-
 
13
-
 
14
$db_set =& DB::connect($dsn);
-
 
15
if (PEAR::isError($db_set)) {
-
 
16
    die($db_set->getMessage());
-
 
17
}
-
 
18
-
 
19
$distr = abs(intval($_GET["d"]));
-
 
20
-
 
21
if($distr==0) {
12
        $reps =& $db->query("SELECT * FROM reps");
22
        $reps =& $db_apt->query("SELECT * FROM reps");
13
        while ($reps->fetchInto($info_reps,DB_FETCHMODE_ASSOC)) {
23
        while ($reps->fetchInto($info_reps,DB_FETCHMODE_ASSOC)) {
-
 
24
            $dists =& $db_apt->query("SELECT * FROM reps2dists JOIN dists ON reps2dists.dist_id=dists.id WHERE rep_id=".$info_reps['id']);
14
            echo $info_reps['rep']."<br>";
25
            echo $info_reps['rep']."<br>";
15
            $dists =& $db->query("SELECT * FROM reps2dists JOIN dists ON reps2dists.dist_id=dists.id WHERE rep_id=".$info_reps['id']);
-
 
16
            while ($dists->fetchInto($info_dists,DB_FETCHMODE_ASSOC)) {
26
            while ($dists->fetchInto($info_dists,DB_FETCHMODE_ASSOC)) {
17
                echo " http://apt.nix-files.org.ru/".$info_reps['rep']." ".$info_dists['dists.dist'];
27
                echo " http://apt.nix-files.org.ru/".$info_reps['rep']." ".$info_dists['dists.dist'];
18
                $sects =& $db->query("SELECT * FROM reps2dists2sects JOIN sects ON reps2dists2sects.sect_id=sects.id WHERE reps2dists_id==".$info_dists['reps2dists.id']);
28
                $sects =& $db_apt->query("SELECT * FROM reps2dists2sects JOIN sects ON reps2dists2sects.sect_id=sects.id WHERE reps2dists_id==".$info_dists['reps2dists.id']);
19
                while ($sects->fetchInto($info_sects,DB_FETCHMODE_ASSOC)) {
29
                while ($sects->fetchInto($info_sects,DB_FETCHMODE_ASSOC)) {
20
                    echo " ".$info_sects['sects.sect'];
30
                    echo " ".$info_sects['sects.sect'];
21
                }
31
                }
22
                echo "<br>";
32
                echo "<br>";
23
            }
33
            }
24
        }
34
        }
-
 
35
}
-
 
36
else {
-
 
37
        $codename =& $db_set->getOne("SELECT codename FROM vers WHERE id=".$distr);
-
 
38
       
-
 
39
        $reps =& $db_apt->query("SELECT * FROM reps");
-
 
40
        while ($reps->fetchInto($info_reps,DB_FETCHMODE_ASSOC)) {
-
 
41
            $dists =& $db_apt->query('SELECT * FROM reps2dists JOIN dists ON reps2dists.dist_id=dists.id WHERE rep_id='.$info_reps['id'].' AND dists.dist LIKE "'.$codename.'%"');
-
 
42
            if ($dists->numRows()!=0) echo $info_reps['rep']."<br>";
-
 
43
            while ($dists->fetchInto($info_dists,DB_FETCHMODE_ASSOC)) {
-
 
44
                echo " http://apt.nix-files.org.ru/".$info_reps['rep']." ".$info_dists['dists.dist'];
-
 
45
                $sects =& $db_apt->query("SELECT * FROM reps2dists2sects JOIN sects ON reps2dists2sects.sect_id=sects.id WHERE reps2dists_id==".$info_dists['reps2dists.id']);
-
 
46
                while ($sects->fetchInto($info_sects,DB_FETCHMODE_ASSOC)) {
-
 
47
                    echo " ".$info_sects['sects.sect'];
-
 
48
                }
-
 
49
                echo "<br>";
-
 
50
            }
-
 
51
        }
-
 
52
}
25
53
26
//$query =& $dba->query("SET NAMES utf8");
54
//$query =& $dba->query("SET NAMES utf8");
27
55
28
?>
56
?>