Magellan Linux

Diff of /alx-src/branches/alx-web-070/index.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1610 by niro, Thu Dec 2 23:02:19 2010 UTC revision 1725 by niro, Wed Mar 16 11:04:35 2011 UTC
# Line 61  Line 61 
61   function checkif($b)   function checkif($b)
62   { if($b) return ' checked'; else return ''; }   { if($b) return ' checked'; else return ''; }
63    
64   $comps = sqlarr("SELECT s.serial, s.location, s.mac, n.hostname, t.mtime FROM cfg_network n,client_serials s,state_connected t WHERE n.serial=s.serial OR t.serial=s.serial", "serial");   $comps = sqlarr("select client_serials.serial, client_serials.location, client_serials.mac, cfg_network.hostname, state_connected.mtime from client_serials left join cfg_network on client_serials.serial=cfg_network.serial left join state_connected on client_serials.serial=state_connected.serial", "serial");
65    
66   sqlforeach('SELECT serial, ip, hostname, mac FROM state_connected', 'check_online', null);   sqlforeach('SELECT serial, ip, hostname, mac FROM state_connected', 'check_online', null);
67   usort($comps, 'sortcomp');   usort($comps, 'sortcomp');
68   echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"   echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
# Line 108  Line 109 
109   echo '<table border="1" id="mytab">';   echo '<table border="1" id="mytab">';
110   echo '<thead><tr style="font-weight:bold;background-color:#d5e5ff"><th>edit</th><th colspan=3>serial</th><th width=170>hostname</th><th width=100>ip</th><th width=100>last connected</th>';   echo '<thead><tr style="font-weight:bold;background-color:#d5e5ff"><th>edit</th><th colspan=3>serial</th><th width=170>hostname</th><th width=100>ip</th><th width=100>last connected</th>';
111   if($showversion=='on') echo '<th colspan=2>version</th>';   if($showversion=='on') echo '<th colspan=2>version</th>';
112   echo '<th>up/down</th></tr></thead><tbody>';   echo '<th width=150>up/down</th></tr></thead><tbody>';
113    
114   foreach($comps as $c)   foreach($comps as $c)
115   {   {
# Line 131  Line 132 
132   //if($c['mtime']) { echo '<td><nobr>'.$c['mtime'].'</nobr></td>'; }   //if($c['mtime']) { echo '<td><nobr>'.$c['mtime'].'</nobr></td>'; }
133   else  echo '<td></td>';   else  echo '<td></td>';
134    
135   if($c['online'])   if($c['online'])
136   {   {
137   if($showversion=='on')   if($showversion=='on')
138   {   {
# Line 157  Line 158 
158   echo '<td>';   echo '<td>';
159   if($c['online'])   if($c['online'])
160   {   {
161   echo '<input type=button style="width:33%" value="RB" onclick="if(confirm(\'REBOOT CLIENT #'.$c['serial'].' ?\')) window.open(\'reboot.php?client='.$c['serial'].'&ip='.$c['ip'].'&op=reboot\', \'ShutdownWin\', \'width=200,height=100\')">';   echo '<input type=button style="width:24%" value="RB" onclick="if(confirm(\'REBOOT CLIENT #'.$c['serial'].' ?\')) window.open(\'reboot.php?client='.$c['serial'].'&ip='.$c['ip'].'&op=reboot\', \'ShutdownWin\', \'width=200,height=100\')">';
162   echo '<input type=button style="width:33%" value="SD" onclick="if(confirm(\'SHUTDOWN CLIENT #'.$c['serial'].' ?\')) window.open(\'reboot.php?client='.$c['serial'].'&ip='.$c['ip'].'&op=halt\', \'ShutdownWin\', \'width=200,height=100\')">';   echo '<input type=button style="width:24%" value="SD" onclick="if(confirm(\'SHUTDOWN CLIENT #'.$c['serial'].' ?\')) window.open(\'reboot.php?client='.$c['serial'].'&ip='.$c['ip'].'&op=halt\', \'ShutdownWin\', \'width=200,height=100\')">';
163   echo '<input type=button style="width:33%" value="VNC" onclick="window.open(\'vncviewer.php?ip='.$c['ip'].'\', \'VncViewer\', \'width=200,height=100\')">';   echo '<input type=button style="width:24%" value="VNC" onclick="window.open(\'vncviewer.php?ip='.$c['ip'].'\', \'VncViewer\', \'width=200,height=100\')">';
164     echo '<input type=button style="width:24%" value="SSH" onclick="window.open(\'mindterm.php?ip='.$c['ip'].'\', \'MindTerm\', \'width=200,height=100\')">';
165   }   }
166   else echo '<input type=button style="width:100%" value="WOL" onclick="if(confirm(\'WAKE CLIENT #'.$c['serial'].' ?\')) window.open(\'wake_on_lan.php?mac='.$c['mac'].'\', \'WakeWin\', \'width=200,height=100\')">';   else echo '<input type=button style="width:100%" value="WOL" onclick="if(confirm(\'WAKE CLIENT #'.$c['serial'].' ?\')) window.open(\'wake_on_lan.php?mac='.$c['mac'].'\', \'WakeWin\', \'width=200,height=100\')">';
167   echo '</td>';   echo '</td>';

Legend:
Removed from v.1610  
changed lines
  Added in v.1725