2 if( isset($errors) && count($errors) > 0 )
6 <script language="javascript">
7 function initNodeTypeFields() {
8 var regular=document.getElementById("regular_checked");
9 var reservable=document.getElementById("reservable_checked");
10 if ( regular.checked || reservable.checked) return;
13 function updateMethodFields() {
14 var dhcp=document.getElementById("dhcp_checked");
15 var static=document.getElementById("static_checked");
16 // set dhcp as default
17 if ( ! dhcp.checked && ! static.checked) dhcp.checked=true;
18 var is_dhcp=dhcp.checked;
20 document.fm.netmask.disabled= is_dhcp;
21 document.fm.network.disabled= is_dhcp;
22 document.fm.gateway.disabled= is_dhcp;
23 document.fm.broadcast.disabled= is_dhcp;
24 document.fm.dns1.disabled= is_dhcp;
25 document.fm.dns2.disabled= is_dhcp;
28 <div class="plroundedconfirm">
29 <?= form_open("register/stage4_confirmnode/$pcu_id/$site_id") ?>
30 <table border=0 cellpadding=3>
33 <?php if ( isset($error) ): ?>
34 <p><strong>The following errors occured:</strong>
35 <font color='red' size='-1'><ul>
36 <li><?php echo $error ?></li>
39 <tr><td colspan='2'><h3>Choose a Node to Associate with PCU</h3></td></tr>
41 <tr><th>Node Name: </th><td>
42 <select name='node_id'>
43 <option value='0'>--</option>
44 <?php foreach ( $node_list as $node): ?>
45 <option value='<?= $node->data['node_id'] ?>' <?= ( $this->node_id == $node->data['node_id'] ? "selected" : "" ) ?>>
46 <?= $node->hostname ?>
55 <input type=submit name='node_choose' value='Continue'>
65 <div class="plroundedupdate">
66 <table border=0 cellpadding=3>
68 <?php if ( !isset($node_id) || $node_id == 0 || !isset($interface_id) || $interface_id == 0): ?>
69 <?= form_open("register/stage3_addnode/$pcu_id/$site_id", array('name'=>'fm', 'method'=>'post')) ?>
70 <tr><td colspan='2'><h3>Or, Add a Node</h3></td></tr>
71 <tr><th>Site: </th><td><?= $site['name'] ?></td>
74 <th width=200>Hostname</td>
75 <td><input type="text" name="hostname" value="<?= $this->validation->hostname ?>"
76 size="40" maxlength="256">
77 <?= ( $this->disp_errors ? $this->validation->hostname_error : "") ?>
81 <th valign='top' width="200">Node Type</th>
83 <input type="radio" name="node_type" value="regular" id="regular_checked"
84 <?= ( $this->validation->node_type == 'regular' ? "checked" : "" ) ?>>regular
85 <input type="radio" name="node_type" value="reservable" id="reservable_checked"
86 <?= ( $this->validation->node_type == 'reservable' ? "checked" : "" ) ?>>reservable
92 <input type="text" name="model" value="<?= $this->validation->model ?>"
93 size="40" maxlength="256">
94 <?= ( $this->disp_errors ? $this->validation->model_error : "") ?>
101 <td colspan=2> <h3>Network Settings</h3> </td>
105 <th valign='top' width="200">Addressing Method</th>
107 <input type="radio" name="method" value="dhcp" id="dhcp_checked" onChange='updateMethodFields()'
108 <?= ( $this->validation->method == 'dhcp' ? "checked" : "" ) ?>>DHCP
109 <input type="radio" name="method" value="static" id='static_checked' onChange='updateMethodFields()'
110 <?= ( $this->validation->method == 'static' ? "checked" : "" ) ?>>Static
114 <tr><th valign='top'>IP Address</td>
115 <td><input type="text" name="ip" value="<?= $this->validation->ip ?>">
116 <?= ( $this->disp_errors ? $this->validation->ip_error : "") ?>
121 <th valign='top'>Netmask</font></td>
122 <td><input type="text" name="netmask" value="<?= $this->validation->netmask ?>">
123 <?= ( $this->disp_errors ? $this->validation->netmask_error : "") ?>
128 <th valign='top'>Network address</td>
129 <td><input type="text" name="network" value="<?= $this->validation->network ?>">
130 <?= ( $this->disp_errors ? $this->validation->network_error : "") ?>
135 <th valign='top'>Gateway Address</td>
136 <td><input type="text" name="gateway" value="<?= $this->validation->gateway ?>">
137 <?= ( $this->disp_errors ? $this->validation->gateway_error : "") ?>
142 <th valign='top'>Broadcast address</td>
143 <td><input type="text" name="broadcast" value="<?= $this->validation->broadcast ?>">
144 <?= ( $this->disp_errors ? $this->validation->broadcast_error : "") ?>
149 <th valign='top'>Primary DNS</td>
150 <td><input type="text" name="dns1" value="<?= $this->validation->dns1 ?>">
151 <?= ( $this->disp_errors ? $this->validation->dns1_error : "") ?>
156 <th valign='top'>Secondary DNS</td>
157 <td><input type="text" name="dns2" value="<?= $this->validation->dns2 ?>">
158 <?= ( $this->disp_errors ? $this->validation->dns2_error : "") ?>
165 <input type=hidden name='pcu_id' value='<?= $pcu_id ?>'>
166 <input type=hidden name='site_id' value='<?= $site_id ?>'>
167 <input type=submit name='register_node' value='Add New Node'>
173 <table border=0 cellpadding=3>
175 <tr><td></td><td><h3>Node Added Successfully!!!!</h3></td></tr>
176 <?php if ( isset($errors) and ! empty ($errors) ): ?>
177 <?php foreach ( $errors as $error ): ?>
178 <tr><td></td><td><?= $error ?></td></tr>
186 <a href='/db/sites/index.php?id=<?= $default_site_list[0] ?>'>Back to Home Site</a>
189 <script language="javascript">
190 initNodeTypeFields();
191 updateMethodFields();