<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>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($project->order_status ==0){
                echo "<span class=' btn btn-danger' title='Pending'>P</span>";
            }
            else{
                echo "<span class='btn btn-success' title='Assigned'>A</span>";
                }
                ?></td>
            <td><?=  date('d M,Y',strtotime($project->deadline_date)) ?></td>
            <td><?= date('d M,Y',strtotime($project->created)) ?></td>


            <td class="actions">
                <?= $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)) ?>
                <?= $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)) ?>
                <?= $this->Form->postLink($this->Html->tag('i', '', array('class' => "feather icon-trash-2 btn btn-danger")),
                    array('controller'=>'projects',  'action' => 'delete', $project->id),
                    array('escape'=>false),
                ['confirm' => __('Are you sure you want to delete # {0}?', $project->id)]) ?>
            </td>  
        </tr>
        <?php endforeach; } ?>
    </tbody>
</table>