Changeset 50 for branches/old/index.php
- Timestamp:
- Feb 20, 2015, 8:54:42 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/old/index.php
r49 r50 11 11 12 12 $TimeParts = getdate($_SESSION[$Time]); 13 //print_r($TimeParts);14 13 15 14 // Day selection … … 17 16 for($I = 1; $I < 32; $I++) 18 17 { 19 if($I == $TimeParts['mday']) $Selected = ' selected="1"'; else $Selected = ''; 18 if($I == $TimeParts['mday']) $Selected = ' selected="1"'; else $Selected = ''; 20 19 $Output .= '<option value="'.$I.'"'.$Selected.'>'.$I.'</option>'; 21 20 } … … 25 24 $Output .= '<select name="Month">'; 26 25 foreach($Months as $Index => $Month) 27 { 28 if($Index == $TimeParts['mon']) $Selected = ' selected="1"'; else $Selected = ''; 26 { 27 if($Index == $TimeParts['mon']) $Selected = ' selected="1"'; else $Selected = ''; 29 28 if($Index > 0) $Output .= '<option value="'.$Index.'"'.$Selected.'>'.$Month.'</option>'; 30 29 } 31 30 $Output .= '</select>. '; 32 31 33 32 // Day selection 34 33 $Output .= '<select name="Year">'; 35 34 for($I = 2000; $I < 2010; $I++) 36 { 37 if($I == $TimeParts['year']) $Selected = ' selected="1"'; else $Selected = ''; 35 { 36 if($I == $TimeParts['year']) $Selected = ' selected="1"'; else $Selected = ''; 38 37 $Output .= '<option value="'.$I.'"'.$Selected.'>'.$I.'</option>'; 39 38 } 40 39 $Output .= '</select> '; 41 42 40 43 41 // Hour selection 44 42 $Output .= '<select name="Hour">'; 45 43 for($I = 0; $I < 24; $I++) 46 { 47 if($I == $TimeParts['hours']) $Selected = ' selected="1"'; else $Selected = ''; 44 { 45 if($I == $TimeParts['hours']) $Selected = ' selected="1"'; else $Selected = ''; 48 46 $Output .= '<option value="'.$I.'"'.$Selected.'>'.$I.'</option>'; 49 47 } … … 54 52 for($I = 0; $I < 60; $I++) 55 53 { 56 if($I == $TimeParts['minutes']) $Selected = ' selected="1"'; else $Selected = ''; 54 if($I == $TimeParts['minutes']) $Selected = ' selected="1"'; else $Selected = ''; 57 55 $Output .= '<option value="'.$I.'"'.$Selected.'>'.$I.'</option>'; 58 56 } 59 57 $Output .= '</select> '; 60 $Output .= '<input type="submit" value="Nastavit">'; 58 $Output .= '<input type="submit" value="Nastavit">'; 61 59 $Output .= '</form>'; 62 60 63 61 $Output .= ' <form style="display: inline;" action="?Operation=SetTimeNow&Time='.$Time.'" method="post">'; 64 $Output .= '<input type="submit" value="Aktuální čas">'; 62 $Output .= '<input type="submit" value="Aktuální čas">'; 65 63 $Output .= '</form>'; 66 64 67 65 return($Output); 68 66 } … … 73 71 $GrafTimeRanges = array( 74 72 'hour' => array( 75 'caption' => 'Hodina', 73 'caption' => 'Hodina', 76 74 'period' => 3600, 77 75 ), 78 76 'day' => array( 79 77 'caption' => 'Den', 80 'period' => 3600 *24,78 'period' => 3600 * 24, 81 79 ), 82 80 'week' => array( 83 81 'caption' => 'Týden', 84 'period' => 3600 *24*7,82 'period' => 3600 * 24 * 7, 85 83 ), 86 84 'month' => array( 87 85 'caption' => 'Měsíc', 88 'period' => 3600 *24*30,86 'period' => 3600 * 24 * 30, 89 87 ), 90 88 'year' => array( 91 89 'caption' => 'Rok', 92 'period' => 3600 *24*365,90 'period' => 3600 * 24 * 365, 93 91 ), 94 92 'years' => array( 95 93 'caption' => 'Desetiletí', 96 'period' => 3600 *24*365*10,97 ), 98 ); 94 'period' => 3600 * 24 * 365 * 10, 95 ), 96 ); 99 97 100 98 foreach($Config['DefaultVariables'] as $Index => $Variable) … … 104 102 if(array_key_exists($Index, $_POST)) $_SESSION[$Index] = $_POST[$Index]; 105 103 //$$Index = $_SESSION[$Index]; 106 } 104 } 107 105 108 106 if($_SESSION['TimeSpecify'] == 0) … … 112 110 } 113 111 114 $Output = '<div class="Title">Statistiky</div>';112 $Output = '<div style="text-align: center"><div class="Title">Statistiky</div>'; 115 113 116 114 if(!array_key_exists('Operation', $_GET)) $_GET['Operation'] = ''; … … 128 126 } 129 127 } 130 break; 128 break; 131 129 case 'SetTimeNow': 132 130 if(array_key_exists('Time', $_GET)) … … 138 136 } 139 137 } 140 break; 141 138 break; 139 142 140 } 143 141 $Output .= '<strong>Časový úsek:</strong><br>'; 144 // Show gra ftime range menu142 // Show graph time range menu 145 143 if($_SESSION['TimeSpecify'] == 0) 146 144 { … … 151 149 $Output .= '<a href="?TimeSpecify=1">Přesnější nastavení...</a><br>'; 152 150 } else { 153 $Output .= '<table cellspacing="0" cellpadding="2" border="0" >';151 $Output .= '<table cellspacing="0" cellpadding="2" border="0" style="margin: 0px auto;">'; 154 152 $Output .= '<tr><td>Počátek:</td><td>'.EditTime('TimeStart').'</td></tr>'; 155 153 $Output .= '<tr><td>Konec:</td><td>'.EditTime('TimeEnd').'</td></tr>'; … … 162 160 $Output .= '<img alt="Graf" src="graph.php?Measure='.$_SESSION['Measure'].'&From='.$_SESSION['TimeStart'].'&To='.$_SESSION['TimeEnd'].'&Width=750&Height=200&Differential='.$_SESSION['Differential'].'" width="750" height="200"><br>'; 163 161 $Output .= '<a href="?Measure='.$_SESSION['Measure'].'&TimeStart='.$_SESSION['TimeStart'].'&TimeEnd='.$_SESSION['TimeEnd'].'&TimeSpecify=1&Differential='.$_SESSION['Differential'].'">Odkaz na vybraný graf</a><br>'; 164 //print_r(GetValues($Measure, $TimeStart, $TimeEnd)); 165 162 166 163 $Output .= '<br>'; 167 164 168 $Output .= '<table border="1" cellspacing="0" cellpadding="2" style="font-size: small;">'; 165 // Table with available measures 166 $Output .= '<table border="1" cellspacing="0" cellpadding="2" style="font-size: small; margin: 0px auto;">'; 169 167 $Output .= '<tr><th>Měřená veličina</th><th>Poslední hodnota</th><th>Čas posledního měření</th><th>Interpolace</th><th>Poznámky</th>'; 170 168 if(array_key_exists('Debug', $_GET)) $Output .= '<th>Počet položek</th><th>Čas vykonání</th>'; 171 169 $Output .= '</tr>'; 172 170 $Database->select_db('measure'); 173 $Result = $Database->select('measure', '*', 'Enabled=1 AND PermissionView="all" OR PermissionView="'.gethostbyaddr($_SERVER['REMOTE_ADDR']).'" ORDER BY Description'); 174 //echo($Database->error); 175 171 $Result = $Database->select('measure', '*', '(Enabled=1) AND ((PermissionView="all") OR (PermissionView="'.gethostbyaddr($_SERVER['REMOTE_ADDR']).'")) ORDER BY Description'); 176 172 while($Measure = $Result->fetch_array()) 177 173 { … … 202 198 $Output .= '</table>'; 203 199 $Output .= '<br><a href="http://svn.zdechov.net/trac/statistic/">Sekce vývoje systému</a>'; 204 //echo(time()); 205 //print_r(gd_info()); 206 $Output .= '</body></html>'; 207 //print_r($_SESSION); 200 $Output .= '</div></body></html>'; 208 201 209 202 ShowPage($Output); 210 211 //echo(AddPrefixMultipliers('-0.000000071112345', 'B'));
Note:
See TracChangeset
for help on using the changeset viewer.