diff options
Diffstat (limited to 'application/views/scripts/pool')
| -rw-r--r-- | application/views/scripts/pool/index.phtml | 50 |
1 files changed, 31 insertions, 19 deletions
diff --git a/application/views/scripts/pool/index.phtml b/application/views/scripts/pool/index.phtml index 68fcbc4..2c6ba16 100644 --- a/application/views/scripts/pool/index.phtml +++ b/application/views/scripts/pool/index.phtml @@ -18,33 +18,38 @@ <td><?php echo $this->escape($pool->getTitle()) ?></td> <td><?php echo $this->escape($pool->getDescription()) ?></td> <td><?php echo $this->escape($pool->getLocation()) ?></td> - <td><a href="<?php echo $this->url( + <td class='action'><a href="<?php echo $this->url( array( 'controller' => 'pool', 'action' => 'editpool', 'poolID' => $pool->getID() ), 'default', - true) ?>">edit pool</a></td> - <td><a href="<?php echo $this->url( + true) ?>"><img src='/media/img/edit.png' alt='Edit Pool'/></a></td> + <td class='action'><a href="<?php echo $this->url( array( 'controller' => 'pool', 'action' => 'deletepool', 'poolID' => $pool->getID() ), 'default', - true) ?>">delete pool</a></td> - <td><a href="<?php echo $this->url( + true) ?>"><img src='/media/img/delete.png' alt='Delete Pool'/></a></td> + <td class='action'><a href="<?php echo $this->url( array( 'controller' => 'pool', 'action' => 'linkclient', 'poolID' => $pool->getID() ), 'default', - true) ?>">link client</a></td> + true) ?>"><img src='/media/img/add.png' alt='Link Client'/></a></td> </tr> + <?php + $poolentriesMapper = new Application_Model_PoolEntriesMapper(); + $clients = $poolentriesMapper->findBy('poolID',$pool->getID()); + ?> + <?php if (count($clients)>0): ?> <tr class=detail> - <td></td> + <td class=arrowtop>↳</td> <td colspan=6> <table> <tr> @@ -54,8 +59,6 @@ <th>Actions</th> </tr> <?php - $poolentriesMapper = new Application_Model_PoolEntriesMapper(); - $clients = $poolentriesMapper->findBy('poolID',$pool->getID()); foreach ($clients as $client): ?> <tr> <td><?php echo $client['clientID'];?></td> @@ -66,25 +69,29 @@ ?> <td><?php echo ($cli->macAdress); ?></td> <td><?php echo ($cli->hardwarehash); ?></td> - <td><a href="<?php echo $this->url( + <td class='action'><a href="<?php echo $this->url( array( 'controller' => 'pool', 'action' => 'unlinkclient', 'poolentriesID' => $client['poolentriesID'] ), 'default', - true) ?>">unlink client</a></td> + true) ?>"><img src='/media/img/delete.png' alt='Unlink Client'/></a></td> </tr> <?php endforeach ?> </table> + </td> + </tr> + <?php endif;?> <?php endforeach ?> </table> <h2>Free clients</h2> -<table border=1 > -<tr><th>ClientID</th><th>MacAdress</th><th>Hardwarehash</th> -<?php foreach ($this->pools as $pool): ?> - <th><?php echo $this->escape($pool->getTitle()) ?></th> - <?php endforeach ?> +<table > +<tr> +<th>ClientID</th> +<th>MacAdress</th> +<th>Hardwarehash</th> +<th>Actions</th> </tr> <?php foreach ($this->freeclients as $client): ?> @@ -92,8 +99,10 @@ foreach ($this->freeclients as $client): ?> <td><?php echo $client['clientID']; ?></td> <td><?php echo $client['macadress']; ?></td> <td><?php echo $client['hardwarehash']; ?></td> + <td><select onChange="location.href=this.options[this.selectedIndex].value"> + <option></option> <?php foreach ($this->pools as $pool): ?> - <td><a href='<?php echo $this->url( + <option value="<?php echo $this->url( array( 'controller' => 'pool', 'action' => 'linkclient', @@ -101,8 +110,11 @@ foreach ($this->freeclients as $client): ?> 'poolID' => $pool->getID(), ), 'default', - true) ?>'>link</a></td> - <?php endforeach ?> + true) ?>"><?php echo $pool->getTitle(); ?></option> + <?php //<img src='/media/img/add.png' alt='Link to Pool'/></a></td> ?> + <?php endforeach ?> + </select> + </td> </tr> <?php endforeach ?> </table> |
