@include('admin.header')

    <body class="skin-blue layout-top-nav">
        <div class="wrapper">

            @include('admin.sidebar')

            <!-- Content Wrapper. Contains page content -->
            <div class="content-wrapper">
                <div class="container inner_container">

                    <!-- Main content -->
                    <section class="content" style="padding: 20px 0;">

                         <div class="box">

                                    <div class="box-header with-border">
                                        <h3 class="box-title">Contact List</h3>
                                    </div>

                                    <!-- /.box-header -->
                                    <div class="box-body">

                                        <div class="table_wrapper">
                                            <table class="table table-bordered med_table">
                                                <thead>
                                                <tr>
                                                    <th style="width: 200px;">Name</th>
                                                    <th style="width: 100px;text-align: center;">Email</th>
                                                    <th style="width: 100px;text-align: center;">Subject</th>
                                                    <th style="width: 100px;text-align: center;">Message</th>
                                                    <th style="width: 100px;text-align: center;">Actions</th>
                                                </tr>
                                                </thead>
                                                <tbody>

                                                <?php

                                                if(isset($contacts['data'])){

                                                    foreach($contacts['data'] as $contact){

                                                        ?>
                                                        <tr class="contact-section">

                                                            <td><?php echo $contact['name']; ?></td>
                                                            <td style="text-align: center;"><?php echo $contact['email']; ?></td>
                                                            <td style="text-align: center;"><?php echo $contact['subject']; ?></td>
                                                            <td style="text-align: center;">
                                                                <?php echo $contact['message']; ?>
                                                            </td>

                                                            <td style="text-align: center;">
                                                                <a  href="" data-id="<?php echo $contact['id']?>" class="delete_contact">delete</a>
                                                            </td>
                                                        </tr>

                                                        <?php

                                                    }


                                                    if(sizeof($contacts['data']) == 0){

                                                        ?>
                                                        <tr>
                                                            <td colspan="5" class="text-center">

                                                                <p>No Contact found.</p>

                                                            </td>
                                                        </tr>
                                                        <?php
                                                    }


                                                }

                                                ?>

                                                </tbody>

                                            </table>
                                        </div>




                                    </div>

                                    <div class="col-md-6">

                                         <?php
                                            if(isset($contacts['prev_page_url']) && $contacts['prev_page_url']){
                                                ?>
                                                    <a href="{{$contacts['prev_page_url']}}" class="btn btn-primary">Previous</a>
                                                <?php
                                            }

                                         ?>

                                         <?php
                                            if(isset($contacts['next_page_url']) && $contacts['next_page_url']){
                                                ?>
                                                    <a href="{{$contacts['next_page_url']}}" class="btn btn-primary">Next</a>
                                                <?php
                                            }

                                         ?>

                                    </div>

                                        </ul>
                                    </div>

                                </div>

                    </section>
                    <!-- /.content -->
                </div>

            </div>


        </div>

@include('admin.footer')
