summaryrefslogblamecommitdiffstats
path: root/application/views/scripts/pool/index.phtml
blob: 25f1528f7a7ad7a75f18e05afefe07d2e70927e4 (plain) (tree)
1
2
3
4
5
6
7
8
9
10

              







                                                                                    


















                                                                                     
















                                                                                         


                                                                                         
                                                                              
                     



























                                                                                                         








                                         
<h1>Pools</h1>

<a href="<?php echo $this->url(
						array(
							'controller' => 'pool',
							'action'     => 'createpool'
						),
						'default',
						true) ?>">create pool</a>

<?php if ($this->pools): ?>
 
    <!-- A table of filters. -->
    <table border=1>
        <tr>
            <th>poolID</th>
			<th>Title</th>
			<th>Description</th>
			<th>Location</th>
        </tr>
	<?php foreach ($this->pools as $pool): ?>
	 	<tr class='pool'>
			<td><?php echo $this->escape($pool->getID()) ?></td>
			<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(
						array(
							'controller' => 'pool',
							'action'     => 'editpool',
							'poolID'	=> $pool->getID()
						),
						'default',
						true) ?>">edit pool</a></td>
			<td><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(
						array(
							'controller' => 'pool',
							'action'     => 'linkclient',
							'poolID'	=> $pool->getID()
						),
						'default',
						true) ?>">link client</a></td>
		</tr>
		<tr>
		<td>
		</td>
		<td colspan=6><table border=1><tr><th>clientID</th><th>mac</th><th>hardwarehash</th></th>
		<?php
		$poolentriesMapper = new Application_Model_PoolEntriesMapper();
		$clients = $poolentriesMapper->findBy('poolID',$pool->getID());
		foreach ($clients as $client): ?>		
		<tr>
			<td><?php echo $client['clientID'];?></td>
			<?php
				$cli = new Application_Model_Client();
				$clientMapper = new Application_Model_ClientMapper();
				$clientMapper->find($client['clientID'],$cli);			
			?>
			<td><?php echo ($cli->macAdress); ?></td>
			<td><?php echo ($cli->hardwarehash); ?></td>
			<td><a href="<?php echo $this->url(
					array(
						'controller' => 'pool',
						'action'     => 'unlinkclient',
						'poolentriesID'	=> $client['poolentriesID']
					),
					'default',
					true) ?>">unlink client</a></td>
		</tr>
		<?php endforeach ?> 
		</table>
    <?php endforeach ?> 
    </table>
 
<?php else: ?>

 
    <p>There are no pools to display.</p>
 
<?php endif;?>