source: www/is/restart.php@ 1

Last change on this file since 1 was 1, checked in by george, 17 years ago

Prvotní import všeho

  • Property svn:executable set to *
File size: 1.2 KB
Line 
1<?
2include('global.php');
3include_once('db.php');
4DB_Init('localhost', 'root', '', 'is');
5
6$State = array('Neplánováno', 'V plánu');
7
8if(array_key_exists('set', $_POST))
9{
10 foreach($_POST as $Index => $Item)
11 {
12 if(is_numeric($Index))
13 {
14 $Id = addslashes($Index);
15 DB_Update('services_restart', 'id='.$Id, array('changed' => 1));
16 }
17 }
18}
19
20$Period = 60;
21
22echo('Vyberte slu¾by, které chcete restartovat:<br><form method="post">');
23echo('<table border="1" cellspacing="0"><tr><th>Slu¾ba</th><th>Restart</th><th>Zbývající èas</th></tr>');
24DB_Select('services_restart', '*, UNIX_TIMESTAMP(last_time)');
25while($Service = DB_Row())
26{
27 if($Service['changed'] == 1)
28 {
29 $RemainingTime = $Period - (time()-$Service['UNIX_TIMESTAMP(last_time)']);
30 if($RemainingTime < 0) $RemainingTime = 0;
31 $Schedule = date('i:s', $RemainingTime);
32 } else $Schedule = '&nbsp;';
33 echo('<tr><td><input type="checkbox" name="'.$Service['id'].'">'.$Service['caption'].'</td><td>'.$State[$Service['changed']].'</td><td>'.$Schedule.'</td></tr>');
34
35}
36echo('</table><input type="submit" name="set" value="Naplánovat restart vybraných"></form>');
37
38
39
40?>
Note: See TracBrowser for help on using the repository browser.