<table class="table">
    <thead>
        <tr>
            
        <th><span>#</span></th>
        <th><span>Code <a class="help" data-toggle="popover" title="Project code" data-content="And here's some amazing content. It's very engaging. Right?"><i class="feather icon-help-circle f-16"></i></a></span></th>
        <th><span>Topic <a class="help" data-toggle="popover" title="Project topic" data-content="And here's some amazing content. It's very engaging. Right?"><i class="feather icon-help-circle f-16"></i></a></span></th>
        <th><span>Price <a class="help" data-toggle="popover" title="Project price" data-content="And here's some amazing content. It's very engaging. Right?"><i class="feather icon-help-circle f-16"></i></a></span></th>
        <th><span>Status <a class="help" data-toggle="popover" title="Project status" data-content="And here's some amazing content. It's very engaging. Right?"><i class="feather icon-help-circle f-16"></i></a></span></th>
        <th><span>Bid Expire <a class="help" data-toggle="popover" title="Last date of Bid on Project" data-content="And here's some amazing content. It's very engaging. Right?"><i class="feather icon-help-circle f-16"></i></a></span></th>
        <th><span>Deadline <a class="help" data-toggle="popover" title="Last date of Project submission" data-content="And here's some amazing content. It's very engaging. Right?"><i class="feather icon-help-circle f-16"></i></a></span></th>
        <th><span>Created <a class="help" data-toggle="popover" title="Project Added date " data-content="And here's some amazing content. It's very engaging. Right?"><i class="feather icon-help-circle f-16"></i></a></span></th>
        <th><span>Actions</span></th>
                
        </tr>
    </thead>
    <tbody>
        <?php if(count($projects) < 1){
            echo '<tr><td class="text-center text-danger" colspan="7">No Data Found!</td></tr>';
        }else{
            $i =1; 
        foreach ($projects as $project): ?>
        <tr>
            <td><?= $i++ ?></td>
            <td><?= $project->order_id ?></td>
            <td><?= $project->topic ?></td>
            <td><?= $this->Number->format($project->price) ?></td>
            <td class="actions"><?php
            if($this->Custom->ProjectStage($project->status) > 4){
                echo "<span title='$project->status' class='badge badge-success'>$project->status</span title='$project->status'>";
            }else if($this->Custom->ProjectStage($project->status) > 2){
                echo "<span title='$project->status' class='badge badge-info'>$project->status</span title='$project->status'>";
            }else if($this->Custom->ProjectStage($project->status) > 1){
                echo "<span title='$project->status' class='badge badge-secondary'>$project->status</span title='$project->status'>";
            }else if($this->Custom->ProjectStage($project->status) == 0){
                echo "<span title='$project->status' class='badge badge-danger'>$project->status</span title='$project->status'>";
            }else{
                echo "<span title='$project->status' class='badge badge-warning'>$project->status</span>";
                }
                ?></td>
            <td><?=  date('d M,Y',strtotime($project->bid_expiry_date)) ?></td>
            <td><?=  date('d M,Y',strtotime($project->deadline_date)) ?></td>
            <td><?= date('d M,Y',strtotime($project->created)) ?></td>


            <td class="actions">
            <?php if(@$userright_arr[0]['details_r']):?>
                <?= $this->Html->link($this->Html->tag('i', '', array('class'=>"fas fa-eye btn btn-success")), array('controller'=>'projects','action' => 'view', $project->id),array('escape'=>false)) ?>
                <?php endif; 
                if(@$userright_arr[0]['edit']):?>
                <?= $this->Html->link($this->Html->tag('i', '', array('class'=>"feather icon-edit btn btn-primary")), array('controller'=>'projects','action' => 'edit', $project->id),array('escape'=>false)) ?>
                <?php endif; if(@$userright_arr[0]['delete_r']):?>
               
                <?php endif; ?>
            </td>  
        </tr>
        <?php endforeach; } ?>
    </tbody>
</table>