b7fd6a466291969651274f1de5bd0bcc7b3ed7cc
[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 updateStaticFields()
15 {
16   var is_dhcp= document.fm.method[0].checked;
17
18   document.fm.netmask.disabled= is_dhcp;
19   document.fm.network.disabled= is_dhcp;
20   document.fm.gateway.disabled= is_dhcp;
21   document.fm.broadcast.disabled= is_dhcp;
22   document.fm.dns1.disabled= is_dhcp;
23   document.fm.dns2.disabled= is_dhcp;
24 }
25 </script>
26 <div class="plroundedconfirm">
27 <h3>Confirm Node Information</h3>
28 <?= form_open("register/stage45_mappcu/$pcu_id/$site_id/$node_id", array('method'=>'post')) ?>
29                 <table border=0 cellpadding=3>
30                         <tbody>
31                                 <tr><td colspan='2'>
32 Please review the information below, and if it is correct, then Proceed to the
33 next stage.  Otherwise, please Update the information as appropriate.
34                                 </td></tr>
35                                 <tr><td></td>
36                                         <td>
37                                         <center>
38                                                 <input type=hidden name='pcu_id' value='<?= $pcu_id ?>'>
39                                                 <input type=hidden name='node_id' value='<?= $node_id ?>'>
40                                                 <input type=hidden name='site_id' value='<?= $site_id ?>'>
41                                                 <input type=submit name='node_confirm' value='Confirm & Proceed'>
42                                         </center>
43                                         </td>
44                                 </tr>
45                                         </tr>
46                         </tbody>
47                         </table>
48         </form>
49 </div>
50 <br>
51 <div class="plroundedupdate">
52 <?= form_open("register/stage4_confirmnode/$pcu_id/$site_id/$node_id", array('name'=>'fm', 'method'=>'post')) ?>
53                 <table border=0 cellpadding=3>
54                         <tbody>
55                 <tr><td colspan='2'>
56                 </td></tr>
57                 <?php if ( !empty($site) ) 
58                         { ?>
59                                         <tr><th>Site: </th><td> <?= $site['name'] ?> </td>
60                                         </tr>
61                 <?php } ?>
62                                 <tr>
63                                 </tr>
64                                         <th width=200>Hostname:</td>
65                                         <td><input type="text" name="hostname" value="<?= $node->hostname ?>" 
66                                                                 size="40" maxlength="256">
67                                                 <?= ( $this->disp_errors ? $this->validation->hostname_error : "")  ?>
68                                         </td>
69                                 <tr>
70                                         <th>Model:</th>
71                                         <td>
72                                                 <input type="text" name="model" value="<?= $node->model ?>" 
73                                                                 size="40" maxlength="256">
74                                                 <?= ( $this->disp_errors ? $this->validation->model_error : "")  ?>
75                                         </td>
76                                 </tr>
77                                 <tr>
78                                         <th valign='top' width="200">Addressing Method</th>
79                                         <td>
80                                                 <input type="radio" name="method" value="dhcp" onChange='updateStaticFields()'
81                                                 <?= ( $node->method == 'dhcp' ? "checked" : "" ) ?>>DHCP 
82                                                 <input type="radio" name="method" value="static" onChange='updateStaticFields()'
83                                                 <?= ( $node->method == 'static' ? "checked" : "" ) ?>>Static 
84                                         </td>
85                                 </tr>
86
87                                 <tr><th valign='top'>IP Address</th>
88                                         <td><input type="text" name="ip" value="<?= $node->ip ?>">
89                                                 <?= ( $this->disp_errors ? $this->validation->ip_error : "")  ?>
90                                         </td>
91                                 </tr>
92
93                                 <tr> 
94                                         <th valign='top'>Netmask</font></th>
95                                         <td><input type="text" name="netmask" value="<?= $node->netmask ?>">
96                                                 <?= ( $this->disp_errors ? $this->validation->netmask_error : "")  ?>
97                                         </td>
98                                 </tr>
99
100                                 <tr> 
101                                         <th valign='top'>Network address</th>
102                                         <td><input type="text" name="network" value="<?= $node->network ?>">
103                                                 <?= ( $this->disp_errors ? $this->validation->network_error : "")  ?>
104                                         </td>
105                                 </tr>
106
107                                 <tr> 
108                                         <th valign='top'>Gateway Address</th>
109                                         <td><input type="text" name="gateway" value="<?= $node->gateway ?>">
110                                                 <?= ( $this->disp_errors ? $this->validation->gateway_error : "")  ?>
111                                         </td>
112                                 </tr>
113
114                                 <tr> 
115                                         <th valign='top'>Broadcast address</th>
116                                         <td><input type="text" name="broadcast" value="<?= $node->broadcast ?>">
117                                                 <?= ( $this->disp_errors ? $this->validation->broadcast_error : "")  ?>
118                                         </td>
119                                 </tr>
120
121                                 <tr> 
122                                         <th valign='top'>Primary DNS</th>
123                                         <td><input type="text" name="dns1" value="<?= $node->dns1 ?>">
124                                                 <?= ( $this->disp_errors ? $this->validation->dns1_error : "")  ?>
125                                         </td>
126                                 </tr>
127
128                                 <tr>
129                                         <th valign='top'>Secondary DNS</th>
130                                         <td><input type="text" name="dns2" value="<?= $node->dns2 ?>">
131                                                 <?= ( $this->disp_errors ? $this->validation->dns2_error : "")  ?>
132                                                 (optional)
133                                         </td>
134                                 </tr>
135
136                                 <tr><td></td>
137                                         <td>
138                                                 <input type=hidden name='pcu_id' value='<?= $pcu_id ?>'>
139                                                 <input type=hidden name='node_id' value='<?= $node_id ?>'>
140                                                 <input type=hidden name='site_id' value='<?= $site_id ?>'>
141                                                 <input type=submit name='node_update' value='Update & Return'> 
142                                         </td>
143                                 </tr>
144                         </tbody>
145                         </table>
146 </div>
147         <br /><p>
148                         <a href='/db/sites/index.php?id=<?= $site_id ?>'>Back to Home Site</a>
149         
150         </form>
151 <script language="javascript">
152 updateStaticFields();
153 </script>