/adei/ui

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/ui

« back to all changes in this revision

Viewing changes to download.php

  • Committer: Suren A. Chilingaryan
  • Date: 2008-10-29 03:02:24 UTC
  • mto: This revision was merged to the branch mainline in revision 116.
  • Revision ID: csa@dside.dyndns.org-20081029030224-yc3wy2dti4htlfxf
New version of dhtmlxmenu and dhtmlxtree is added

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
<body>
30
30
<?
31
31
 
 
32
 
 
33
function GetQueryString(REQUEST $sreq) {
 
34
    global $ADEI_SETUP;
 
35
    
 
36
    $req = $sreq->GetQueryString();
 
37
    
 
38
    if ($req) $req .= "&";
 
39
    else $req = "";
 
40
        
 
41
    $req .= "setup=" . $ADEI_SETUP;
 
42
 
 
43
    return $req;
 
44
}
 
45
 
32
46
function data_link(&$req, $grname, $format, $from, $to) {
33
47
    global $FORMATS;
34
48
    
45
59
    
46
60
//    $props["filename"] =  preg_replace("/[^\w\d]/", "_", $grname) . "__" . round($from) . "_" . round($to) . "." . $ext;
47
61
    
 
62
#    if (isset($_GET['setup'])) $props["setup"] = $_GET['setup'];
48
63
    $query = $req->GetQueryString($props);
49
64
    
50
65
    echo "<a href=\"services/getdata.php?$query\">" . $title . "</a>";
51
66
}
52
67
 
 
68
if (isset($_GET['period'])) {
 
69
    $period = $_GET['period'] * 3600;
 
70
} else {
 
71
    $period = 86400;
 
72
}
 
73
 
 
74
 
53
75
try {
54
76
    $req = new SOURCERequest();
55
77
} catch (ADEIException $e) {
61
83
$list = $req->GetSources(REQUEST::LIST_ALL);
62
84
?><div class="header"><?
63
85
foreach ($list as $sreq) {
64
 
    ?><a href="download.php?<?echo $sreq->GetQueryString();?>"><?echo $sreq->props['db_server'];?>.<?echo $sreq->props['db_name'];?></a> <?
 
86
    ?><a href="download.php?<?echo GetQueryString($sreq);?>"><?echo $sreq->props['db_server'];?>.<?echo $sreq->props['db_name'];?></a> <?
65
87
}
66
88
?><a href="csvmerge.php">Merge Groups</a></div><?
67
89
if ($nodata) exit;
88
110
        $first = floor($first);
89
111
        $last = ceil($last);
90
112
 
91
 
        $first_day = $first - ($first % 86400);
92
 
        if ($last%86400) $last_day = $last + 86400 - ($last % 86400);
93
 
        else $last_day = $last - ($last % 86400);
94
 
 
95
 
 
96
 
        for ($i=$first_day; $i<$last_day; $i += 86400) {
 
113
        $first_day = $first - ($first % $period);
 
114
        if ($last%$period) $last_day = $last + $period - ($last % $period);
 
115
        else $last_day = $last - ($last % $period);
 
116
 
 
117
 
 
118
        for ($i=$first_day; $i<$last_day; $i += $period) {
97
119
            echo date("d.m.Y", $i) . "(";
98
120
 
99
121
            $first_flag = 1;
102
124
                if ($first_flag) $first_flag = 0;
103
125
                else  echo ", ";
104
126
                
105
 
                data_link($greq, $group["name"], $format, ($i>$first)?$i:$first, (($i + 86400)>$last)?$last:($i + 86400));
 
127
                data_link($greq, $group["name"], $format, ($i>$first)?$i:$first, (($i + $period)>$last)?$last:($i + $period));
106
128
            }
107
129
            echo ") ";
108
130
        }