Help: Need to only show tasks for just a particular client in the client view page

Greeting everyone;

I need to add list of tasks on the /index.php/clients/view page but I need to only to show task that only belongs to that client and not all the tasks. Please see the code I have used to display all the tasks. I have added some custom columns in the database and its working fine. I don’t know what will be the best way to be able to just view the list of task by using the project or by filtering them using client id but don’t were to modify so that it works.

If im not making sense please ask and will clarify further. Thanks in advance

            <div class="row">
            <div class="col-xs-12 col-md-12">
                    <div class="panel panel-default no-margin">

                        <div class="panel-heading"><?php _trans('previous_jobs'); ?></div>
                        <div class="panel-body table-content">
                        <div class="table-responsive">
                        <table class="table table-hover table-striped table-condensed no-margin">

                            <thead>
                            <tr>
                                <th><?php _trans('status'); ?></th>
                                <th><?php _trans('task_name'); ?></th>
                                <th><?php _trans('task_finish_date'); ?></th>
                                <th><?php _trans('mechanic_name'); ?></th>
                                <th><?php _trans('next_service'); ?></th>
                                <th><?php _trans('work_report'); ?></th>
                            </tr>
                            </thead>

                            <tbody>
                            <?php foreach ($tasks as $task) { ?>
                                <tr>
                                    <td>
                                    <span class="label <?php echo $task_statuses["$task->task_status"]['class']; ?>">
                                        <?php echo $task_statuses["$task->task_status"]['label']; ?>
                                    </span>
                                    </td>
                                    <td>
                                        <?php echo anchor('tasks/form/' . $task->task_id, htmlsc($task->task_name)) ?>
                                    </td>
                                    <td>
                                    <span class="<?php if ($task->is_overdue) { ?>font-overdue<?php } ?>">
                                        <?php echo date_from_mysql($task->task_finish_date); ?>
                                    </span>
                                    </td>
                                    <td>
                                    <?php echo htmlsc($task->mechanic_name); ?>
                                    </td>
                                    <td>
                                    <span class="<?php if ($task->is_overdue) { ?>font-overdue<?php } ?>">
                                        <?php                                       
                                        $date = new DateTime(date_from_mysql($task->task_finish_date));
                                        $date->modify("+5 day");
                                        echo $date->format("d/m/Y")                                        
                                        ?>
                                        
                                        <!-- <?php echo date_from_mysql($task->task_finish_date); ?> -->
                                    </span>
                                    </td>
                                    <td>
                                    <?php echo htmlsc($task->work_report); ?>
                                    </td>
                                </tr>
                            <?php } ?>
                        		<tr>
                            </tbody>

                        </table>

                    </div>
                        </div>

                    </div>
                </div>

            </div>