Welcome Guest, Not a member yet? Register   Sign In
Display table row following condition
#1

I have a table in our admin panel. The table display the coupon and the deal, but for a better reading we would like to have a split table. 1 for coupons and 1 for deals.
I can't figure out how to display only the data according to the status if deal or coupons.
Here below is my loop to get all the data, and create the table.

PHP Code:
<tbody>
    <?php 
    $this
->load->helper('text');
    $count 0;
    foreach ($result as $key => $value) {
        $count++;?>  
        <tr>
        <td><?php echo $count;?></td>
        <td><?php echo  wordwrap($value->deal_title,25,"<br>\n");?></td>
        
        <td> <?php 
                
if($value->deal_type == 0){
                    echo 'Deal';
                }else{
                    echo 'Coupon';
                }
            ?>  </td>
        
        <td> <?php 
                $ext 
explode(' '$value->created_at);
                echo $ext[0];
            ?>
            </td>
        <td>
            <?php 
                $user_details 
get_likes($value->id);
                echo @$user_details[0]->likes
            ?>
        </td>
            <td>
            <?php 
                
if($value->deal_status == 1){
                    echo 'Not published';
                }else{
                    echo 'Published';
                }
            ?>
        </td>                                
        
        </tr>
    <?php }?>
</tbody> 
Reply


Messages In This Thread
Display table row following condition - by plopli - 02-16-2022, 01:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB