35c7dd36f950f4bb80af9d619164c883727a5769
[www-register-wizard.git] / application / views / stage4_node_confirm.php
1 <?php
2 if( isset($errors) && count($errors) > 0 )
3 {
4   print( "<p><strong>The following errors occured:</strong>" );
5   print( "<font color='red' size='-1'><ul>\n" );
6   foreach( $errors as $err )
7     {
8       print( "<li>$err\n" );
9     }
10   print( "</ul></font>\n" );
11 }
12 ?>
13 <script language="javascript">
14 function initNodeTypeFields() {
15   var regular=document.getElementById("regular_checked");
16   var reservable=document.getElementById("reservable_checked");
17   if ( regular.checked || reservable.checked) return;
18   regular.checked=true;
19 }
20 function updateMethodFields() {
21   var dhcp=document.getElementById("dhcp_checked");
22   var static=document.getElementById("static_checked");
23   // set dhcp as default
24   if ( ! dhcp.checked && ! static.checked) dhcp.checked=true;
25   var is_dhcp=dhcp.checked;
26
27   document.fm.netmask.disabled= is_dhcp;
28   document.fm.network.disabled= is_dhcp;
29   document.fm.gateway.disabled= is_dhcp;
30   document.fm.broadcast.disabled= is_dhcp;
31   document.fm.dns1.disabled= is_dhcp;
32   document.fm.dns2.disabled= is_dhcp;
33 }
34 </script>
35 <div class="plroundedconfirm">
36 <h3>Confirm Node Information</h3>
37 <?= form_open("register/stage45_mappcu/$pcu_id/$site_id/$node_id", array('method'=>'post')) ?>
38                 <table border=0 cellpadding=3>
39                         <tbody>
40                                 <tr><td colspan='2'>
41 Please review the information below, and if it is correct, then Proceed to the
42 next stage.  Otherwise, please Update the information as appropriate.
43                                 </td></tr>
44                                 <tr><td></td>
45                                         <td>
46                                         <center>
47                                                 <input type=hidden name='pcu_id' value='<?= $pcu_id ?>'>
48                                                 <input type=hidden name='node_id' value='<?= $node_id ?>'>
49                                                 <input type=hidden name='site_id' value='<?= $site_id ?>'>
50                                                 <input type=submit name='node_confirm' value='Confirm & Proceed'>
51                                         </center>
52                                         </td>
53                                 </tr>
54                                         </tr>
55                         </tbody>
56                         </table>
57         </form>
58 </div>
59 <br>
60 <div class="plroundedupdate">
61 <?= form_open("register/stage4_confirmnode/$pcu_id/$site_id/$node_id", array('name'=>'fm', 'method'=>'post')) ?>
62                 <table border=0 cellpadding=3>
63                         <tbody>
64                 <tr><td colspan='2'>
65                 </td></tr>
66                 <?php if ( !empty($site) ) 
67                         { ?>
68                                         <tr><th>Site: </th><td> <?= $site['name'] ?> </td>
69                                         </tr>
70                 <?php } ?>
71                                 <tr>
72                                         <th width=200>Hostname:</td>
73                                         <td><input type="text" name="hostname" value="<?= $node->hostname ?>" 
74                                                                 size="40" maxlength="256">
75                                                 <?= ( $this->disp_errors ? $this->validation->hostname_error : "")  ?>
76                                         </td>
77                                 </tr>
78                                 <tr>
79                                         <th valign='top' width="200">Node Type</th>
80                                         <td>
81                                                 <input type="radio" name="node_type" value="regular" id="regular_checked"
82                                                 <?= ( $this->validation->node_type == 'regular' ? "checked" : "" ) ?>>regular 
83                                                 <input type="radio" name="node_type" value="reservable" id="reservable_checked"
84                                                 <?= ( $this->validation->node_type == 'reservable' ? "checked" : "" ) ?>>reservable 
85                                         </td>
86                                 </tr>
87                                 <tr>
88                                         <th>Model:</th>
89                                         <td>
90                                                 <input type="text" name="model" value="<?= $node->model ?>" 
91                                                                 size="40" maxlength="256">
92                                                 <?= ( $this->disp_errors ? $this->validation->model_error : "")  ?>
93                                         </td>
94                                 </tr>
95
96                                 <tr>
97                                         <th valign='top' width="200">Addressing Method</th>
98                                         <td>
99                                                 <input type="radio" name="method" value="dhcp" id="dhcp_checked" onChange='updateMethodFields()'
100                                                 <?= ( $this->validation->method == 'dhcp' ? "checked" : "" ) ?>>DHCP 
101                                                 <input type="radio" name="method" value="static" id='static_checked' onChange='updateMethodFields()'
102                                                 <?= ( $this->validation->method == 'static' ? "checked" : "" ) ?>>Static 
103                                         </td>
104                                 </tr>
105                                 <tr>
106                                         <th valign='top'>IP Address</th>
107                                         <td><input type="text" name="ip" value="<?= $node->ip ?>">
108                                                 <?= ( $this->disp_errors ? $this->validation->ip_error : "")  ?>
109                                         </td>
110                                 </tr>
111
112                                 <tr> 
113                                         <th valign='top'>Netmask</font></th>
114                                         <td><input type="text" name="netmask" value="<?= $node->netmask ?>">
115                                                 <?= ( $this->disp_errors ? $this->validation->netmask_error : "")  ?>
116                                         </td>
117                                 </tr>
118
119                                 <tr> 
120                                         <th valign='top'>Network address</th>
121                                         <td><input type="text" name="network" value="<?= $node->network ?>">
122                                                 <?= ( $this->disp_errors ? $this->validation->network_error : "")  ?>
123                                         </td>
124                                 </tr>
125
126                                 <tr> 
127                                         <th valign='top'>Gateway Address</th>
128                                         <td><input type="text" name="gateway" value="<?= $node->gateway ?>">
129                                                 <?= ( $this->disp_errors ? $this->validation->gateway_error : "")  ?>
130                                         </td>
131                                 </tr>
132
133                                 <tr> 
134                                         <th valign='top'>Broadcast address</th>
135                                         <td><input type="text" name="broadcast" value="<?= $node->broadcast ?>">
136                                                 <?= ( $this->disp_errors ? $this->validation->broadcast_error : "")  ?>
137                                         </td>
138                                 </tr>
139
140                                 <tr> 
141                                         <th valign='top'>Primary DNS</th>
142                                         <td><input type="text" name="dns1" value="<?= $node->dns1 ?>">
143                                                 <?= ( $this->disp_errors ? $this->validation->dns1_error : "")  ?>
144                                         </td>
145                                 </tr>
146
147                                 <tr>
148                                         <th valign='top'>Secondary DNS</th>
149                                         <td><input type="text" name="dns2" value="<?= $node->dns2 ?>">
150                                                 <?= ( $this->disp_errors ? $this->validation->dns2_error : "")  ?>
151                                                 (optional)
152                                         </td>
153                                 </tr>
154
155                                 <tr><td></td>
156                                         <td>
157                                                 <input type=hidden name='pcu_id' value='<?= $pcu_id ?>'>
158                                                 <input type=hidden name='node_id' value='<?= $node_id ?>'>
159                                                 <input type=hidden name='site_id' value='<?= $site_id ?>'>
160                                                 <input type=submit name='node_update' value='Update & Return'> 
161                                         </td>
162                                 </tr>
163                         </tbody>
164                         </table>
165 </div>
166         <br /><p>
167                         <a href='/db/sites/index.php?id=<?= $site_id ?>'>Back to Home Site</a>
168         
169         </form>
170 <script language="javascript">
171 initNodeTypeFields();
172 updateMethodFields();
173 </script>