<?php $__env->startSection('title'); ?>
   User search
<?php $__env->stopSection(); ?>

<?php $__env->startSection('styles'); ?>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>

<?php echo $__env->make('partials.dashboard-menu', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<h1>Manage Users</h1>
<!--<a class="myButton" style="width:12% ;text-align: center;" href="/add-new-user">Add New User</a> -->
<a href="/add-new-user"><button class="myButton">Add New User</button></a>

<div class="row">
<p style="text-align:center;">To search for user, type user name or email or company then click enter</p>
    <form action="/user-search" method="GET" style="margin-bottom: -1rem !important;">
        <input style="width:50%;font-family: 'Lato', sans-serif;margin-left: auto;margin-right: auto;display: block;border-radius: 13px;" placeholder="Company Search..." type="text" value="" name="search" id="search">
    </form>
</div>

        <div class="comapanyTable">
            <table>
                <thead>
                    <tr>
                        <th width="10%">User Name</th>
                        <th width="10%">Companies</th>
                        <th width="10%">Email</th>
                        <th width="10%">Edit</th>
                        <th width="10%">Delete</th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach($users as $user): ?>
                        <tr>
                            <td><?php echo $user->name; ?></td>
                            <td><?php echo $user->companyName; ?></td>
                            <td><?php echo $user->email; ?></td>
                            <td><a href="/edit-user/<?php echo $user->id; ?>"> <i class="lightGrey fa fa-pencil-square-o" aria-hidden="true"></i> </a></td>
                            <td><a onclick="return Conform_Delete()" href="/deleteUser/<?php echo $user->id; ?>"> <i class="fa fa-times" aria-hidden="true"></i></a></td>
                        </tr>
                    <?php endforeach; ?>
                </tbody>
            </table>
        </div>
<hr>
<?php echo $__env->make('partials.footer', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
    <script src="<?php echo asset('js/scripts.js'); ?>"></script>
    <script>
        function Conform_Delete()
        {
           return confirm("Are You Sure Want to Delete this user?");
        }
    </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>