I have the following table:
foreach ($forwards as $data):
    ?>
    <tr style="cursor: pointer" class="main_row">
        <td><?php echo $data['Offer']['id']; ?> </td>
        <td><?php echo $data['Offer']['name'];?> </td>
        <td><?php echo round($data['Stat']['ltr'],2)."%"; ?></td>
        <td><?php echo round($data['Stat']['cpc'],2)."%"; ?></td>
        <td><?php echo $data['Category']['name']?></td>
        <td><?php echo $data['Country']['name'] ?></td>
    </tr>
    <?php
     endforeach; ?>
now the idea is that when ever you click one of the main_row it should redirect to a new url. the problem is that the url contains an id for instance the url could look like www.example.com/details/2 where 2 is the id. 
This id is like all of the other data stored in a php variable: $data['Offer']['id'];
Now my question how can i redirect using both php and javascript? is there a work around? .
Please do note that i am fully aware that php i server side and javascript is not. it is because of this i am asking this question.