0

This is my problem, one array is display in one column of my table :

enter image description here

I want to display,for exemple, each evt_id in the same columne of my table, and so on. Thanks in advance if you have an idea about my problem :)

QUERY :

public function getSuiviFluTech($idDepot){
     $this->executeQueries("
     Select evt_id, evt_dt, evt_nomfic, evt_statut, evt_texte from depot_evt 
     where id_depot = ".$idDepot."
     order by evt_dt desc"
             );
     return $this->getAllRows();

CONTROLLER :

if ($depotExist) {
        $this->view->idDepot = $idDepot;
        $oDepotAdmin = new Services_DepotAdmin();
        $listDepotAdmin = $oDepotAdmin->getSuiviFluTech($idDepot);
        if (count($listDepotAdmin) >= 1) {
            $this->view->listdepotdrpadmin = $listDepotAdmin;

HTML :

<table id="supervisionResDepotDrp">
                <thead>
                    <tr>
                        <th class="center">EVT_ID</th>
                        <th class="center">EVT_DT</th>
                        <th class="center">EVT_NOMFIC</th>
                        <th class="center">EVT_STATUT</th>
                        <th class="center">EVT_TEXTE</th>
                        <th class="center">DOWNLOAD</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                      <?php 
    // Le 7ème champ statut_depot n'est pas affiché, car il sert uniquement pour les RG
    // Il est redondantt avec le 6ème qui est sa traduction en langage humain
                        $i=0; 

                        foreach ($this->listdepotdrpadmin as $elem) { ?>
                        <td class="center"><?php if ($i++ < count($this->listdepotdrpadmin)) print_r ($elem); ?></td>

                      <?php } 
4
  • <?=$elem['evt_id']?> and go on. Commented Dec 18, 2018 at 15:35
  • 1
    Add your <tr>... </tr> tags into the foreach loop... Commented Dec 18, 2018 at 15:36
  • thanks for your answer @u_mulder, but it's not working, when i put this on my loop, i have one evt_id for each column. I want one evt_id for each line. Commented Dec 18, 2018 at 15:42
  • Thanks for your answer you too @UsagiMiyamoto but its not working too. :/ Commented Dec 18, 2018 at 15:43

1 Answer 1

1
<tbody>
    <?php 
    foreach ($this->listdepotdrpadmin as $elem) {?>
    <tr>
        <td class="center"><?=$elem['evt_id']?></td>
        <td class="center"><?=$elem['evt_dt']?></td>
        <td class="center"><?=$elem['evt_nomfic']?></td>
        <td class="center"><?=$elem['evt_status']?></td>
        <td class="center"><?=$elem['evt_text']?></td>
        <td class="center">-</td>
    </tr>
    <?php 
    }?>
</tbody>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.