source: Download.php

Last change on this file was 1, checked in by george, 15 years ago
  • Import souborů projektu.
File size: 2.7 KB
Line 
1<?php
2 //hlavièka
3 include 'includes/Global.php';
4
5 if (array_key_exists('ID', $_GET)) {
6 $ID = $_GET['ID'];
7 $set = $_GET['set'];
8 $_SESSION['ID='.$ID] = $set;
9 // echo $ID.$_SESSION[$ID];
10 // echo $_SESSION['ID='.'1'];
11 }
12
13 function IsOpenDir($Name)
14 { // BEGIN function
15 if (isset($_SESSION[$Name])) {
16 if ($_SESSION[$Name] == '1')
17 return True;
18 else
19 return False;
20 } else
21 return False;
22 } // END function
23
24 //const
25 $AltImg['1'] = '+';
26 $AltImg['0'] = '-';
27
28?>
29<br /><span class="LinksTitle">Soubory ke stažení: </span>
30
31<?php
32
33/* function IsEmptyDir($Dir)
34 { // BEGIN function IsEmptyDir
35 global $db;
36
37 return False;
38
39 $sql = "SELECT * FROM downloaddir WHERE PreviousDir = '$Dir'";
40 $IDdb = $db->SQLCommand($sql);
41 while($Line = mysql_fetch_array($IDdb))
42 if (!$Line)
43 echo '';
44 else
45 return True;
46
47 $sql = "SELECT * FROM downloadfile WHERE Dir = '$Dir'";
48 $IDdb = $db->SQLCommand($sql);
49 while($Line = mysql_fetch_array($IDdb))
50 if (!$Line)
51 echo '';
52 else
53 return True;
54 } // END function IsEmptyDir
55
56*/
57
58 $sql = "SELECT * FROM downloaddir WHERE PreviousDir = '0' order by 2";
59 $ID = $db->SQLCommand($sql);
60 echo '<DL>';
61 while($Line = mysql_fetch_array($ID)) {
62 $PreviousDir = $Line['ID'];
63 if (IsOpenDir('ID='.$PreviousDir)) {
64 echo '<DD><a href="Download.php?ID='.$Line['ID'].'&amp;set=0" title="'.$Line['Description'].'">'.$Icons['-'].' '.$Line['Name'].'</a>';
65 WriteFiles($Line['ID']);
66 } else
67 echo '<DD><a href="Download.php?ID='.$Line['ID'].'&amp;set=1" title="'.$Line['Description'].'">'.$Icons['+'].' '.$Line['Name'].'</a>';
68
69 // if (array_key_exists('ID='.$Line['ID'], $_SESSION)) {} else {$_SESSION['ID='.$Line['ID']] = '0'}
70 if (IsOpenDir('ID='.$PreviousDir)) {
71 $sql = "SELECT * FROM downloaddir WHERE PreviousDir = '$PreviousDir' order by 2";
72 $ID2 = $db->SQLCommand($sql);
73 echo '<DL>';
74 while($Line = mysql_fetch_array($ID2)) {
75 if (IsOpenDir('ID='.$Line['ID'])) {
76 echo '<DD><a href="Download.php?ID='.$Line['ID'].'&amp;set=0" title="'.$Line['Description'].'">'.$Icons['-'].' '.$Line['Name'].'</a>';
77 WriteFiles($Line['ID']);
78 } else
79 echo '<DD><a href="Download.php?ID='.$Line['ID'].'&amp;set=1" title="'.$Line['Description'].'">'.$Icons['+'].' '.$Line['Name'].'</a>';
80
81 //TODO: neomezený poèet vnoøených složek
82 // WriteFiles($PreviousDir);
83
84 }
85 echo '</DL>';
86 }
87 }
88 echo '</DL>';
89?>
90
91<?php
92 //botièka (konec)
93 ShowFooter();
94?>
Note: See TracBrowser for help on using the repository browser.