Take two:
[www-register-wizard.git] / application / views / stage1_pcu_choose.php
1 <div class="plroundedconfirm">
2 <?= form_open('register/stage2_confirmpcu') ?>
3                 <table border=0 cellpadding=3>
4                         <tbody>
5                 <?php if ( !empty($pcu_list) ): ?>
6                                 <tr><td colspan='2'><h3>Choose an Existing PCU</h3></td></tr>
7                                 <tr><th>PCU Name: </th><td>
8                                                         <select name='pcu_id'>
9                                                         <?php foreach ( $pcu_list as $pcu ): ?>
10                                                                         <option value='<?= $pcu->data['pcu_id'] ?>' <?= ( $this->pcu_id == $pcu->data['pcu_id'] ? "selected" : "") ?>>
11                                                                                 <?= $pcu->pcu_name() ?>
12                                                                         </option>
13                                                         <?php endforeach; ?>
14                                                         </select>
15                                                 </td>
16                                 </tr>
17                                 <tr><td></td>
18                                         <td>
19                                                 <input type=submit name='pcu_choose' value='Continue'>
20                                         </td>
21                                 </tr>
22                 <?php endif; ?>
23                 </tbody>
24         </table>
25 </form>
26 </div>
27 <br>
28 <div class="plroundedupdate">
29 <?php if ( !isset($pcu_id) || $pcu_id == 0 ): ?>
30         <?= form_open('register/stage1_addpcu') ?>
31                         <table border=0 cellpadding=3>
32                                 <tbody>
33                                         <tr><td colspan='2'><h3>Or, Register a New PCU</h3></td></tr>
34                         <?php if ( !empty($site_list) ): ?>
35                                         <tr><th>Site: </th><td>
36                                                                 <select name='site_id'>
37                                                                 <?php 
38                                                                          foreach ( $site_list as $site ) 
39                                                                          { 
40                                                                                 if ( $site['site_id'] == $default_site_list[0] )
41                                                                                         $selected = " selected";
42                                                                                 else
43                                                                                         $selected = "";
44                                                                                 ?>
45                                                                                 <option value='<?= $site['site_id'] ?>' <?= $selected ?>>
46                                                                                         <?= $site['name'] ?>
47                                                                                 </option>
48                                                                 <?php } ?>
49                                                                 </select>
50                                                         </td>
51                                                         <td>
52                                                         </td>
53                                                 </tr>
54                         <?php endif; ?>
55                                         <tr><th>Model: </th>
56                                                 <td>
57                         <select name='model'>
58                                 <option value='none-selected' 
59                                                 <?= $this->validation->set_select('model', 'none-selected') ?>>---</option>
60                                 <?php foreach( $pcu_types as $pcu_type ): ?>
61                                                 <option value='<?= $pcu_type['model'] ?>' 
62                                                         <?= $this->validation->set_select('model', $pcu_type['model']) ?>>
63                                                         <?= $pcu_type['name'] ?>
64                                                 </option>
65                                 <?php endforeach; ?>
66                         </select>
67                                                 </td>
68                                         </tr>
69                                         <tr>
70                                                 <th>Hostname: </th>
71                                                 <td nowrap>
72                                                         <input  type=text name='hostname' size=40 
73                                                                         value='<?= $this->validation->hostname ?>'>
74                                                         <?= $this->validation->hostname_error ?>
75                                                 </td>
76                                         </tr>
77                                         <tr><th>IP Address: </th>
78                                                 <td nowrap>
79                                                         <input type=text name='ip' 
80                                                                         value='<?= $this->validation->ip ?>'>
81                                                         <?= $this->validation->ip_error ?>
82                                                 </td>
83                                         </tr>
84                                         <tr><th>Username: </th>
85                                                 <td nowrap>
86                                                         <input type=text name='username' 
87                                                                         value='<?= $this->validation->username ?>'>
88                                                         <?= $this->validation->username_error ?>
89                                                 </td>
90                                         </tr>
91                                         <tr><th>Password: </th>
92                                                 <td nowrap>
93                                                         <input type=text name='password' 
94                                                                         value='<?= $this->validation->password ?>'>
95                                                         <?= $this->validation->password_error ?>
96                                                 </td>
97                                         </tr>
98                                         <tr><th>Notes: </th>
99                                                 <td><textarea name="notes" rows=5 cols=40></textarea></td>
100                                         </tr>
101                                         <tr><td></td>
102                                                 <td>
103                                                         <input type=submit name='pcu_register' value='Add New PCU'>
104                                                 </td>
105                                         </tr>
106                                 </tbody>
107                                 </table>
108         </form>
109 </div>
110 <?php else: ?>
111         <table border=0 cellpadding=3>
112                 <tbody>
113                         <tr><td></td><td><h3>PCU Added Successfully!!!!</h3></td></tr>
114                         <?php if ( ! empty($error) ): ?>
115                         <tr><td></td><td><?= $error ?></td></tr>
116                         <?php endif; ?>
117                 </tbody>
118         </table>
119 <?php endif; ?>
120         <br /><p>
121                 <a href='/db/sites/index.php?id=<?= $default_site_list[0] ?>'>Back to Home Site</a>