<?php $__env->startSection('title'); ?>
    Manage Companies
<?php $__env->stopSection(); ?>

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

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

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

<?php echo $__env->make('partials.dashboard-menu', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php if(Session::has('view-search-error')): ?>
    <div data-alert class="alert-box alert">
        <?php echo Session::get('view-search-error'); ?>

        <a href="#" class="close">&times;</a>
    </div>
<?php endif; ?>
<!-- success message -->
<?php if(Session::has('view-success')): ?>
    <div data-alert class="alert-box">
        <?php echo Session::get('view-success'); ?>

        <a href="#" class="close">&times;</a>
    </div>
<?php endif; ?>

<h1>Companies Search Results</h1>
<!--<a class="myButton" style="width:12% ;text-align: center;" href="/new-company">Add New Company</a>-->
<a href="/new-company"><button class="myButton">Add New Company</button></a>

<div class="row">
<p style="text-align:center;">Enter company name then click enter</p>
    <form action="/company-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>
<?php if(isset($companies)): ?>
<table class="comapanyTable">
    <thead>
        <tr>
            <th width="10%">Companies</th>
            <th width="10%">Usage Log</th>
            <th width="10%">Edit Profile</th>
            <th width="10%">View Users</th>
            <th width="10%">Export Usage Log to exel</th>
        </tr>
    </thead>
    <tbody>
        <?php foreach($companies as $company): ?>
            <tr>
                <td><a href="view-company/<?php echo $company->companyName; ?>"><?php echo $company->companyName; ?></a></td>
                <td><a href="view-company-usage-log/<?php echo $company->companyName; ?>"><i class="fa fa-line-chart"></i></a></td>
                <td><a href="edit-company/<?php echo $company->id; ?>"> <i class="lightGrey fa fa-pencil-square-o" aria-hidden="true"></i> </a></td>
                <td><a href="view-users/<?php echo $company->companyName; ?>"> <i class="fa fa-search" aria-hidden="true"></i></a></td>
                <td><a href="export-to-xml/<?php echo $company->companyName; ?>"> <i class="fa fa-file-excel-o"></i></a></td>
                </tr>
        <?php endforeach; ?>
    </tbody>
</table>
<?php else: ?>
    <h2>No result found.</h2>
<?php endif; ?>

<?php echo $__env->make('partials.footer', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php $__env->stopSection(); ?>

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

</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>