mercredi 21 février 2018

PHP generated table with user input

I am working on a little project for a clan of mine, we just want a little dashboard to track stuff from the game.

Now what I am looking for is to be able to put notes into my generated table where we can put stuff when members are on leave and such.

Can anyone help me with this, I am genrating the table with all the data its just the note that is not working out for me.

<div id="content">
<div class="limiter">
    <div class="container-table100">
        <div class="wrap-table100">
            <div class="table100 ver1 m-b-110">
                <table data-vertable="ver1" id="myTable">
                    <tr class="row100 head">
                        <th class="column100 column1" ><b>Lid</b></th>
                        <th class="column100 column2"><b>Donaties Gedaan</b></th>
                        <th class="column100 column3"><b>Donaties Ontvangen</b></th>
                        <th class="column100 column4"><b>Donaties: Gedaan - Ontvangen</b></th>
                        <th class="column100 column5"><b>Kroonkist</b></th>
                        <th class="column100 column6"><b>Notities</b></th>
                    </tr>
                    <?php
                    foreach ($data['members'] as $key => $value): ?>
                        <tr class="row100">
                            <td class="column100 column1"><? echo $value['name']; ?></td>
                            <?php if(intval($value['donations'])<150) {
                                echo '<td  class="column100 column2" style="background:red; color: white">'.$value['donations'].'</td>';
                            }
                            else {
                                echo '<td  class="column100 column2">'.$value['donations'].'</td>';
                            }?>

                            <td class="column100 column3"><? echo $value['donationsReceived']; ?></td>
                            <td class="column100 column4"><? echo $value['donationsDelta']; ?></td>
                            <?php if(intval($value['clanChestCrowns'])<20) {
                                echo '<td  class="column100 column2" style="background:red; color: white">'.$value['clanChestCrowns'].'</td>';
                            }
                            else {
                                echo '<td  class="column100 column2">'.$value['clanChestCrowns'].'</td>';
                            }?>
                            <td>
                                <textarea class="column100 column5"  id="verwittiging" placeholder="verwittiging-Test"></textarea>
                                <button type="button"  id="saveNote" onclick="setNote()">Voeg notitie toe</button>
                            </td>
                        </tr>
                    <?
                    endforeach;
                    ?>
                </table>
            </div>
        </div>
    </div>
</div>

This is the code how I get the data

<?php
$token = "apitoken";
$opts = [
"http" => [
    "header" => "auth:" . $token
]
   ];

$context = stream_context_create($opts);

    $test = file_get_contents("http://api.cr-api.com/clan/9QLUCV22",true, 
     $context);
   $data =  json_decode($test, true);
    ?>




Aucun commentaire:

Enregistrer un commentaire