ona  18.1.1
About: OpenNetAdmin provides a database managed inventory of your IP network (with Web and CLI interface).
  Fossies Dox: ona-18.1.1.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

ipcalcgui.inc.php
Go to the documentation of this file.
1 <?php
2 
4 // Function: ws_submit($input)
5 //
6 // Description:
7 // Inserts dynamic content into a tool-tip popup.
8 // $form is a string array that should look something like this:
9 // "tooltip=>something,id=>element_id,something_id=>143324"
11 function ws_ipcalcgui_submit($window_name, $form='') {
12  global $conf, $self, $onadb, $tip_style;
14  $html = $js = '';
15 
16  // If an array in a string was provided, build the array and store it in $form
17  $form = parse_options_string($form);
18 
19 
20  $text = '';
21  $ipinfo = ipcalc_info($form['ip'],$form['mask']);
22 
23 // MP: I removed the following as they are tooooo large
24 //bin128: {$ipinfo['ip_bin128']}
25 //bin128: {$ipinfo['mask_bin128']}
26 
27 
28 // NOTE: yes it is annoying but I had to do the <br> thing due to windows
29 // not being able to handle the new lines via a standard <pre> statement.
30 // I went with this as it keeps things consistant between platforms. The pre is now a span
31  $text .= <<<EOL
32 <br />
33 <br />
34 Input: IP={$ipinfo['in_ip']} MASK={$ipinfo['in_mask']}<br />
35 <br />
36 IP={$ipinfo['in_ip']}<br />
37  Dotted: {$ipinfo['ip_dotted']}<br />
38  Numeric: {$ipinfo['ip_numeric']}<br />
39  binary: {$ipinfo['ip_binary']}<br />
40  ipv6: {$ipinfo['ip_ipv6']}<br />
41  ipv6gz: {$ipinfo['ip_ipv6gz']}<br />
42  flip: {$ipinfo['ip_flip']}<br />
43 <br />
44 MASK={$ipinfo['mask_dotted']}<br />
45  Dotted: {$ipinfo['mask_dotted']}<br />
46  Numeric: {$ipinfo['mask_numeric']}<br />
47  Cidr: /{$ipinfo['mask_cidr']}<br />
48  binary: {$ipinfo['mask_binary']}<br />
49  bin invert: {$ipinfo['mask_bin_invert']}<br />
50  ipv6: {$ipinfo['mask_ipv6']}<br />
51  ipv6gz: {$ipinfo['mask_ipv6gz']}<br />
52  flip: {$ipinfo['mask_flip']}<br />
53  IP invert: {$ipinfo['mask_dotted_invert']}<br />
54 <br />
55 The subnet your IP falls in is: {$ipinfo['truenet']}/{$ipinfo['mask_cidr']} ({$ipinfo['mask_dotted']})<br />
56 <br />
57 Total addresses using this mask: {$ipinfo['ip_total']}<br />
58 Usable addresses using this mask: {$ipinfo['ip_usable']}<br />
59 Last address using this mask: {$ipinfo['ip_last']}<br />
60 <br />
61 
62 EOL;
63 
64 
65 
66  $response = new xajaxResponse();
67  $response->addAssign('ipcalc_data', "innerHTML", $text);
68  return($response->getXML());
69 }
70 
71 
72 
73 
74 
75 
76 
77 
78 ?>
$onadb
global $onadb
Definition: 2-to-3.php:15
ipcalc_info
ipcalc_info($ip='', $mask='')
Definition: functions_general.inc.php:748
$images
$images
Definition: config.inc.php:26
EOL
< a style="text-decoration: none;" href="/">< input class='edit' type="button" value="I don't like free stuff?" onclick=""/></a ></center ></div > EOL
Definition: install.php:40
$conf
global $conf
Definition: 2-to-3.php:15
xajaxResponse
Definition: xajaxResponse.inc.php:68
$style
$style['font-family']
Definition: config.inc.php:158
$font_family
global $font_family
Definition: app_admin_tools.inc.php:4
$text
$text
Definition: install.php:11
$self
global $self
Definition: 2-to-3.php:15
ws_ipcalcgui_submit
ws_ipcalcgui_submit($window_name, $form='')
Definition: ipcalcgui.inc.php:11
$color
if($_SERVER['SERVER_PORT']==443) $color['bg']
Definition: config.inc.php:119
parse_options_string
parse_options_string($input)
Definition: xajax_setup.inc.php:88