
<div class="row">
    <div class="col-xl-2 col-md-6 col-sm-12">

        <div class="card">
            <input type="hidden" id='member_id' name='page_id' value="<?= $page_id ?>" />

            <div class="card-content">
                <div class="card-body">
                    <h4 class="card-title">Add Contents to <?= $title ?> </h4>
                    <p class="card-text">Some quick example text to build on the card title and make up the bulk of
                        the card's content.</p>
                </div>
                <ul class="list-group list-group-flush" style="font-size:18px;">

                    <?php
                    foreach ($page_items as $mitm) {
                        ?>
                        <li class="list-group-item">
                            <span class="badge badge-pill <?= $mitm[2] ?> float-right">0</span>
                            <a href="#"  onclick="viewCardAddAction('<?= $mitm[0] ?>',<?= $_SESSION['member_id'] ?>,<?= $page_id ?>,'<?=$page_key?>');"><?= $mitm[1] ?></a>
                        </li>

                        <?php
                    }
                    ?>
                </ul>

            </div>
        </div>



    </div>


    <div class="col-xl-6 col-md-12 col-sm-12">
        <div id="addcard_detail">



        </div>




    </div>

    <div class="col-xl-4 col-md-12 col-sm-12">




        <!-- Scroll - horizontal and vertical table -->
        <section id="horizontal-vertical">
            <div class="row">
                <div class="col-12">
                    <div class="card">
                        <div class="card-header">
                            <h4 class="card-title">Page Contents</h4>
                        </div>
                        <div class="card-content">
                            <div class="card-body card-dashboard">
                               
                                <div class="table-responsive">
                                    <table class="table nowrap scroll-horizontal-vertical" style="background-color: aliceblue;">
                                        <thead>
                                            <tr>
                                                <th style="width: 35px;">TYP</th>
                                                <th>Title</th>
                                                <th  style="width: 30px;">EDT</th>
                                                <th  style="width: 30px;">DEL</th>

                                            </tr>
                                        </thead>
                                        <tbody>


                                            <?php
                                            foreach ($page_card_items AS $drow) {
                                            
                                                ?> 
                                                <tr>
                                                    <td><i class="feather icon-file"></i></td>
                                                    <td><?= $drow->title ?></td>
                                                    <td><i class="feather icon-edit"></i></td>
                                                    <td><i class="feather icon-delete"></i></td>
                                                </tr>



                                                <?php
                                            }
                                            ?>





                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!--/ Scroll - horizontal and vertical table -->



























    </div>

</div>


<script type="text/javascript">
<!--



    function viewCardAddAction(action_name, member_id, page_id,page_key) {
        //alert(action_name);
        return viewCardAddActionOffset(action_name, member_id, page_id, page_key, 0);
    }

    function viewCardAddActionOffset(action_name, member_id, page_id, page_key, offset) {

        $('#addcard_detail').html('Processing...');
        $('#acc' + member_id).prop('disabled', true);
        $.ajax({
            url: "/member/viewCardAddAction?proc=PROCESS&action_name=" + action_name + "&member_id=" + member_id + "&page_id=" + page_id + "&page_key=" + page_key
        }).done(function (data) {
            $('#addcard_detail').html(data);
            $('#acc' + member_id).prop('disabled', false);
        });
        return false;
    }





//initMap();
// -->
</script>



