Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
The exact value date will show under performance column, which is contain of 2 dates. Each date also have new 4 column. The problem is the next date (array) are shown for the next row.

What I have tried:

HTML
<table>
<thead>
<tr>
<th>No<th>
<th>Name<th>
<th>Performance<th>
  <?php
   foreach ($ListPerformance as $key2 => $value2) {
 ?> 
 <tr>
  <?php 
    foreach ($value2 as $key => $value){
       if (!empty($value['date'])){
          echo '<th>'.$value['date'].'</th>';
       } 
    }
  ?>
  
   ///Next 4 column under date///

   <tr>
     <th>Submit</th>
     <th>Status</th>
     <?php
        if ($_SESSION[AppName]['usergroup'] == 1) {
          echo '<th>Admin</th>';
       }
     ?>
     <th>Reset By</th>
   </tr>
  
  <?php } ?>
</tr>
</thead>
</table>
Posted
Updated 16-Jun-22 20:31pm
v2
Comments
Richard MacCutchan 17-Jun-22 3:13am    
You need to add a detailed question. It is not obvious what the problem is.

1 solution

PHP
  foreach ($ListPerformance as $key2 => $value) {
?>
<tr>
 <?php
   foreach ($value2 as $key => $value){

You have not declared value2 anywhere. You should also avoid using the same variable names ($key and $value) in both loops.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900