I have a table populated with a foreach loop. I’m trying to make it so when you click on the search20.png image it opens the popup view, and passes the corresponding $subtime for that row into the popup view to use.
It works ok except that for each search20.png image you click on it gives the same $subtime. I’m not sure how to go about making it so that the $subtime corresponds to the $r->Submitted variable for each row in the table. Here’s my code…
Thanks!
<table width="100%">
<tr >
<td></td>
<td bold;" min-width="120px">Submitted:</td>
<td bold;" min-width="120px">First Name:</td>
<td bold;" min-width="120px">Last Name:</td>
<td bold;" min-width="150px">Email:</td>
<td bold;" min-width="100px">Phone Number:</td>
<td bold;">Sent:</td>
</tr>
<?php foreach($rows as $r){ ?>
<?php $data['subtime'] = $r->Submitted; ?>
<tr>
<td vertical-align: middle;">
<div class="button"><a href="#">assets/images/search20.png</a></div>
<?php $this->load->view('popup', $data); ?>
</td>
<td><?php echo date("F j, Y, g:i a", $r->Submitted); ?></td>
<td><?php echo $r->firstName; ?></td>
<td><?php echo $r->lastName; ?></td>
<td><?php echo $r->email; ?></td>
<td><?php echo $r->phone; ?></td>
<td "><input type="checkbox" name="check" value="check"></td>
</tr>
<?php } ?>
</table>