summaryrefslogtreecommitdiffstats
path: root/application/views/scripts/pool/index.phtml
blob: 2df3e529d8c80431f228183c7ce3105135360b4d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<h1>Pools</h1>
<?php echo $this->formButton('createconfig', 'Create Pool', array(
							'onclick' => 'self.location="/pool/createpool"',
							'class' => 'addbutton'))?>

<?php if ($this->pools): ?>
    <table >
        <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>
			<tr>
				<th>clientID</th>
				<th>mac</th>
				<th>hardwarehash</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>
			<?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>
<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 ?> 
</tr>
<?php
foreach ($this->freeclients as $client): ?>
	<tr>
		<td><?php echo $client['clientID']; ?></td>
		<td><?php echo $client['macadress']; ?></td>
		<td><?php echo $client['hardwarehash']; ?></td>
		<?php foreach ($this->pools as $pool): ?>
			<td><a href='<?php echo $this->url(
					array(
						'controller' => 'pool',
						'action'     => 'linkclient',
						'clientID'	=> $client['clientID'],
						'poolID'	=> $pool->getID(),
					),
					'default',
					true) ?>'>link</a></td>
		<?php endforeach ?> 
	</tr>
<?php endforeach ?> 
</table>
<?php else: ?>

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