<script src="<?= asset_url('assets/js/backend_companygrouping.js') ?>"></script>
<script src="<?= asset_url('assets/js/backend_companygrouping_helper.js') ?>"></script>
<script src="<?= asset_url('assets/ext/jquery-ui/jquery-ui-timepicker-addon.js') ?>"></script>
<script src="<?= asset_url('assets/ext/jquery-jeditable/jquery.jeditable.min.js') ?>"></script>
<script>
    var GlobalVariables = {
        csrfToken      : <?= json_encode($this->security->get_csrf_hash()) ?>,
        baseUrl        : <?= json_encode($base_url) ?>,
        dateFormat     : <?= json_encode($date_format) ?>,
        timeFormat     : <?= json_encode($time_format) ?>,
        admins         : <?= json_encode($admins) ?>,
        providers      : <?= json_encode($providers) ?>,
        secretaries    : <?= json_encode($secretaries) ?>,
        services       : <?= json_encode($services) ?>,
        user           : {
            id         : <?= $user_id ?>,
            email      : <?= json_encode($user_email) ?>,
            role_slug  : <?= json_encode($role_slug) ?>,
            privileges : <?= json_encode($privileges) ?>
        }
    };

    $(document).ready(function() {
        BackendCompany.initialize(true);
    });
</script>

<div id="company-page" class="container-fluid backend-page">

    <!-- PAGE NAVIGATION -->
    <ul class="nav nav-tabs" role="tablist">
        <li role="presentation" class="active"><a href="#company" aria-controls="company" role="tab" data-toggle="tab"><?= lang('providers') ?></a></li>

    </ul>

    <div class="tab-content">
<div class="tab-content">

    <!-- PROVIDERS TAB -->

    <div role="tabpanel" class="tab-pane active" id="company">
        <div class="row">
            <div id="filter-company" class="filter-records column col-xs-12 col-sm-5">
                <form>
                    <div class="input-group">
                        <input type="text" class="key form-control">

                        <span class="input-group-addon">
                        <div>
                            <button class="filter btn btn-default" type="submit" title="<?= lang('filter') ?>">
                                <span class="glyphicon glyphicon-search"></span>
                            </button>
                            <button class="clear btn btn-default" type="button" title="<?= lang('clear') ?>">
                                <span class="glyphicon glyphicon-repeat"></span>
                            </button>
                        </div>
                    </span>
                    </div>
                </form>

                <h3>Companies</h3>
                <div class="results"></div>
            </div>

            <div class="record-details column col-xs-12 col-sm-7">
                <div class="pull-left">

                    <div class="add-edit-delete-group btn-group">
                        <button id="add-company" class="btn btn-primary">
                            <span class="glyphicon glyphicon-plus"></span>
                            <?= lang('add') ?>
                        </button>
                        <button id="edit-company" class="btn btn-default" disabled="disabled">
                            <span class="glyphicon glyphicon-pencil"></span>
                            <?= lang('edit') ?>
                        </button>
                        <button id="delete-company" class="btn btn-default" disabled="disabled">
                            <span class="glyphicon glyphicon-remove"></span>
                            <?= lang('delete') ?>
                        </button>
                        <button id="viewlocations-company" class="btn btn-default" disabled="disabled">
                            <span class="glyphicon glyphicon-pencil"></span>
                            View Locations
                        </button>
                        <button id="gotolink-company" class="btn btn-default" disabled="disabled">
                            <span class="glyphicon glyphicon-search"></span>
                            Go to Link
                        </button>
                    </div>

                    <div class="save-cancel-group btn-group" style="display:none;">
                        <button id="save-company" class="btn btn-primary">
                            <span class="glyphicon glyphicon-ok"></span>
                            <?= lang('save') ?>
                        </button>
                        <button id="cancel-company" class="btn btn-default">
                            <span class="glyphicon glyphicon-ban-circle"></span>
                            <?= lang('cancel') ?>
                        </button>

                    </div>

                </div>


                <?php // This form message is outside the details view, so that it can be
                // visible when the user has working plan view active. ?>
                <div class="form-message alert" style="display:none;"></div>

                <div class="details-view company-view">
                    <br><h3><?= lang('details') ?></h3>

                    <input type="hidden" id="company-id" class="record-id">

                    <div class="row">
                        <div class="company-details col-xs-12 col-sm-6">
                            <div class="form-group">
                                <label for="company-name">Company Name *</label>
                                <input id="company-name" class="form-control required" maxlength="256">
                            </div>

                            <div class="form-group">
                                <label for="company-backgroundcolor">Background Color of Company Frontend</label>
                                <input type="color" id="company-backgroundcolor" name="company-backgroundcolor"
                                       value="#DBDBDB">

                            </div>

                            <div class="form-group">
                                <label for="company-topheader">Top Header Color of Company Frontend</label>
                                <input type="color" id="company-topheader" name="company-topheader"
                                       value="#DBDBDB">
                            </div>

                            <div class="form-group">
                                <label for="company-logolink">Logo Link - Uploaded <a href="<?php echo Config::BASE_URL.'/uploadlogos.php';?>" target="_blank"> HERE</a></label>
                                <textarea id="company-logolink" rows="2" class="form-control"></textarea>
                            </div>



                            <div class="form-group">
                                <label for="company-width">Width of image **to keep default sizing leave blank</label>
                                <input type="number" id="company-width" name="company-width">
                            </div>

                            <div class="form-group">
                                <label for="company-leng">Length of image **to keep default sizing leave blank</label>
                                <input type="number" id="company-leng" name="company-leng">
                            </div>


                            <br><br>

                        </div>
                    </div>
                </div>


            </div>
        </div>
    </div>
</div>
</div>
