<tbody>    
                                <?php 
                                    foreach( $results as $k => $row ) :
                                        $style = ($row['status'] == 2) ? 'style="color: red;"' : '';
                                        $disabled = ($row['status'] == 2) ? 'style="cursor: no-drop"' : '';
                                        $tooltip = ($row['status'] == 2) ? $row['del_reason'] : '';
                                ?>
                                    <tr <?php echo $style;?> data-toggle="tooltip" data-placement="auto" title="<?php echo $tooltip;?>">
                                        <td><?php echo ++$k;?></td>
                                        <td><?php echo (($general->prefix == 1) ? $row['prefix'] : '') . $row['bp_rec_no'];?></td>
                                        <td><?php echo text($row['bp_dev_name_1']);?></td>
                                        <!--<td><?php // echo (!empty($row['bp_tamil_name_1'])) ? '<span class="lang-tamil">' . $row['bp_tamil_name_1'] . '</span>' : 'N/A';?></td> -->
										<td><?php if($row['bp_period']=="1"){ echo "Morning"; }else if($row['bp_period']=="2") { echo "Evening";} else if($row['bp_period']=="3") { echo "Afternoon";} //echo text($row['bp_period']);?></td>
                                        <td><?php echo text($row['bp_contact_no']);?></td>
                                        <td><?php echo text($row['service_name']);?></td>
                                        <td align="right"><?php echo inr_format( $row['bp_amount'] );?></td>
                                        <td><?php echo date("d M Y", strtotime( $row['bp_fn_date'] ) );?></td>
                                        <td class="td_action">
                                            <a class="label btn btn-info" href="<?php echo $print . $row['id'] . '/' . $menu_id; ?>" style="background-color: #00a65a; border-color: #00a65a;">
                                                <span>Print</span>
                                            </a>
                                            <input type="hidden" name="auto_id" class="auto_id" value="<?php echo $row['id'];?>" />
                                            <?php if( in_array(1, $permission) ):?>
                                                <a class="label btn btn-warning view" href="<?php echo $view_link . $row['id'] . '/' . $menu_id; ?>">
                                                    <span>View</span>
                                                </a>
                                            <?php endif; if( in_array(3, $permission) ) :?>
                                                <?php if($row['status'] == 1) { ?>
                                                    <a class="label btn btn-primary edit edit_otp" href="<?php echo $edit_link . $row['id'] . '/' . $menu_id; ?>" data-otp-ids="<?php echo form_prep(serialize($service_menu_id));?>">
                                                        <span>Edit</span>
                                                    </a>
                                                <?php } else {?>
                                                    <a class="label btn btn-primary edit" <?php echo $disabled;?>>
                                                        <span>Edit</span>
                                                    </a>
                                                <?php } ?>
                                            <?php endif; if (in_array(4, $permission)) :?>
                                                <?php if($row['status'] == 1) { ?>
                                                    <a class="label btn btn-danger pop_up_confirm delete delete_otp" data-confirm="Do you want to delete the Billing Prasadam of <b><?php echo $row['bp_dev_name_1'];?></b>?" data-href="<?php echo $delete_link . $row['id'] . '/' . $menu_id; ?>" data-otp-ids="<?php echo form_prep(serialize($service_menu_id));?>">
                                                        <span>Delete</span>
                                                    </a>
                                                <?php } else {?>
                                                    <a class="label btn btn-danger delete" <?php echo $disabled;?>>
                                                        <span>Delete</span>
                                                    </a>
                                                <?php } ?>
                                            <?php endif; ?>
                                        </td>
                                    </tr>
                                <?php endforeach; ?>
                            </tbody> 