

<?php $__env->startSection('title'); ?>
    Company Settings
<?php $__env->stopSection(); ?>

<?php $__env->startSection('style'); ?>
    <link rel="stylesheet" type="text/css" href="<?php echo e(asset('/css/loader.css')); ?>">

    <style>
        tr.group,
        tr.group:hover {
            background-color: #ddd !important;
        }
        .form-sec{width:400px; background:#ccc; padding:15px;width: 400px;
        background: #f8f9fa;padding: 15px;box-shadow: 0 0 4px #ccc;}
        /*Disabled href*/
        /*
        .btn-disabled,
        .btn-disabled[disabled] {
          opacity: .4;
          cursor: default !important;
          pointer-events: none;
        */
        .modal {
           /*position: relative;*/
           z-index: 9999;
           vertical-align: middle;
        }
        .modal-content textarea.form-control {
            max-width: 100%;
        }
        textarea {
          resize: vertical;
        }
        table.dataTable th.selectall-checkbox,
        table.dataTable td.selectall-checkbox {
          cursor: pointer;
          outline: none;
          text-align: center;
        }
        /*filter on top*/
        tfoot {
            display: table-header-group;
        }
        thead {
            display: table-row-group;
        }
        /*hide show entries*/
        .dataTables_length {
            display: none;
        }
        .dataTables_filter {
            display: none;
        }
        .highlight {
          background-color: #79D3CE;
        }
        .highlight-teacher {
          background-color: #CCB5D3;
        }
        .highlight2 {
          background-color: #93ABB0;
        }
        .font-sizee {
          font-size: 16px;
          font-weight: bold;
          text-align: center;
        }
        .font-center {
          text-align: center;
        }
    </style>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                <span class="fa fa-gear"></span> Company Settings
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-gear"></i> Admin Panel</a></li>
                <li class="active">Company Settings</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content" style=" padding-bottom: 10%;">
            <div class="page-header">
                <a href="<?php echo e(route('dashboard')); ?>" class="btn btn-primary"><i class="fa fa-backward"></i> Back</a> 
            </div>

            <div id="overlay">
                <div class="cv-spinner">
                    <span class="spinner"></span>
                </div>
            </div>

            <div role="tabpanel">

              <!-- Nav tabs -->
              <ul class="nav nav-tabs" role="tablist">
                <li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">Company Info</a></li>
                <li role="presentation"><a href="#scheme" aria-controls="scheme" role="tab" data-toggle="tab">Theme Color</a></li>
                
              </ul>

              <!-- Tab panes -->
              <div class="tab-content">
                <div role="tabpanel" class="tab-pane active" id="home">
                    <div style="margin-top: 10px;"></div>
                        <div class="row">
                        <?php $__currentLoopData = $com; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $cm): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <div style="margin-bottom: 20px;"></div>
                            <form method="post" action="<?php echo e(route('settings.update')); ?>" enctype="multipart/form-data">
                                <div class="col-xs-3 col-sm-3">
                                    <span>
                                        <img class="profile-picture" src="<?php echo e(url('images/logo/'.$cm->logo)); ?>" width="200px" id="avatar">
                                        <input type="hidden" name="reservephoto" value="<?php echo e($cm->logo); ?>">
                                        <span class="input-group-btn">
                                            <input type="file" class="btn" id="photo" name="photo" onchange="imagepreview.call(this)"/>
                                        </span>
                                    </span>

                                    <div class="space space-4"></div>

                                </div><!-- /.col -->

                            <div class="col-xs-12 col-sm-9">
                                <div class="profile-user-info">
                                        <input type="hidden" name="_id" id="_id" class="form-control" value="<?php echo e($cm->id); ?>" readonly>
                                        <div class="col-md-6">
                                            <div class="form-group has-feedback <?php if($errors->has('company_name')): ?> has-error <?php endif; ?>">
                                                <label for="name" class="control-label">Company Name</label>
                                                <input type="text" name="company_name" id="company_name" class="form-control" value="<?php echo e($cm->company_name); ?>">
                                                <span class="fa fa-building form-control-feedback"></span>
                                                <?php if($errors->has('company_name')): ?> <span class="help-block"><?php echo e($errors->first('company_name')); ?></span> <?php endif; ?>
                                            </div>

                                            <div class="form-group has-feedback <?php if($errors->has('address')): ?> has-error <?php endif; ?>">
                                                <label for="address" class="control-label">Address</label>
                                                <textarea name="address" id="address" class="form-control" rows="5"><?php echo e($cm->address); ?></textarea>
                                                <span class="glyphicon glyphicon-skype form-control-feedback"></span>
                                                <?php if($errors->has('address')): ?> <span class="help-block"><?php echo e($errors->first('address')); ?></span> <?php endif; ?>
                                            </div>

                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group has-feedback <?php if($errors->has('contact_no')): ?> has-error <?php endif; ?>">
                                                <label for="contact_no" class="control-label">Contact No</label>
                                                <input type="text" name="contact_no" id="contact_no" class="form-control" value="<?php echo e($cm->contact_no); ?>">
                                                <span class="glyphicon glyphicon-mobile form-control-feedback"></span>
                                                <?php if($errors->has('contact_no')): ?> <span class="help-block"><?php echo e($errors->first('contact_no')); ?></span> <?php endif; ?>
                                            </div>

                                            <div class="form-group has-feedback <?php if($errors->has('postcode')): ?> has-error <?php endif; ?>">
                                                <label for="postcode" class="control-label">Post Code</label>
                                                <input type="text" name="postcode" id="postcode" class="form-control" value="<?php echo e($cm->postcode); ?>">
                                                <span class="glyphicon glyphicon-mail form-control-feedback"></span>
                                                <?php if($errors->has('postcode')): ?> <span class="help-block"><?php echo e($errors->first('postcode')); ?></span> <?php endif; ?>
                                            </div>

                                            <div class="form-group has-feedback <?php if($errors->has('email')): ?> has-error <?php endif; ?>">
                                                <label for="email" class="control-label">Email</label>
                                                <input type="email" name="email" id="email" class="form-control" value="<?php echo e($cm->email); ?>">
                                                <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
                                                <?php if($errors->has('email')): ?> <span class="help-block"><?php echo e($errors->first('email')); ?></span> <?php endif; ?>
                                            </div>

                                          <div class="form-group has-feedback <?php if($errors->has('website')): ?> has-error <?php endif; ?>">
                                              <label for="website" class="control-label">Website</label>
                                              <input type="text" name="website" id="website" class="form-control" value="<?php echo e($cm->website); ?>">
                                               <span class="fa fa-whatsapp form-control-feedback"></span>
                                              <?php if($errors->has('website')): ?> <span class="help-block"><?php echo e($errors->first('website')); ?></span> <?php endif; ?>
                                          </div>
                                        </div>

                                        <div class="form-group" style="padding: 10px;padding-top:20px;">
                                            <button type="submit" class="btn btn-success btn-s"><i class="fa fa-check"></i> Update</button>
                                            <a href="<?php echo e(route('dashboard')); ?>" class="btn btn-primary"><i class="fa fa-arrow-left"></i> Cancel</a>
                                        </div>
                                        <?php echo e(csrf_field()); ?>


                                </div>

                                <div class="hr hr-8 dotted"></div>
                                
                            </div><!-- /.col -->

                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                        </form>

                        </div>

                </div>

                <div style="height: 20px;"></div>
                    <div role="tabpanel" class="tab-pane" id="scheme">
                        <div class="profile-user-info">
                        <div class="col-md-6">
                            <div class="form-group has-feedback <?php if($errors->has('themes')): ?> has-error <?php endif; ?>">
                                <label for="themes" class="control-label">Theme</label>
                                <select id="themes" name="themes" class="form-control status">
                                    <option value="" >Select Theme</option>
                                    <?php $__currentLoopData = $themes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $thm): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($thm->id); ?>" selected="selected"><?php echo e($thm->scheme); ?> </option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                                <?php if($errors->has('themes')): ?> <span class="help-block"><?php echo e($errors->first('themes')); ?></span> <?php endif; ?>
                            </div>
                            <button id="btnOk" name="btnOk" class="btn btn-success"><i class="fa fa-check-o"></i> Apply Theme</button>
                            
                    </div>
                </div>

                

                


            </div>


            <input type="hidden" id="domainn" name="domainn" value="<?php echo e($site[0]['host'] ?? ''); ?>" readonly>

            <div style="height: 10px;"></div>

            <?php if(Session('info')): ?>
                <div class="row" style="margin-bottom: 50px;">
                    <div class="col-md-6 col-md-offset-3 text-center">
                        <div class="tem alert alert-success navbar-fixed-bottom"><span class="glyphicon glyphicon-ok-circle"></span> <?php echo e(Session('info')); ?></div>
                    </div>
                </div>
            <?php endif; ?>

              

        </section>

       <div class="modal fade bs-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" style=" padding-right: 0px;background-color: rgba(4, 4, 4, 0.8);">
          <div class="modal-dialog modal-lg" style="top: 20%;width: 70%;text-align: center;">
            <div class="modal-content" style="border-radius: 0px;border: none;top: 40%;">
              <div class="modal-body" id="modBody" style="background-color: #E3E1A1;color: white;"> 
                <h3 id="h22"></h3>
                <h5 id="h44"></h5>
              </div>
            </div>
          </div>
        </div>

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

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







<script>
    $(document).ready(function() {
        //$('#overlay').show();

        $('#btnOk').on('click', function() {
            var tid   = $('#themes').find('option:selected').val();
            $("#overlay").fadeIn(300);
            $.ajax({
                url:"<?php echo e(route('settings.apply-theme')); ?>",
                method: 'post',
                headers:  {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},
                data:{
                  tid: tid
                },
                dataType:'json',
                success:function(data) {
                    console.log(data);
                    location.reload();
                },
                complete: function() {
                   //$('#wait').hide();
                   setTimeout(function(){
                   $("#overlay").fadeOut(300);
                   },500);
                },
                error: function (jqXHR, exception) {
                    console.log(jqXHR);
                }
            });
        });

    });
</script>

<script type="text/javascript">
    function imagepreview(){
        if(this.files&& this.files[0]){
            var filerd = new FileReader();
            filerd.onload=function(data){
              var image = document.getElementById("avatar");
              image.src = data.target.result;
              image.style.display = "block";
            };
            filerd.readAsDataURL(this.files[0]);
          }
    }

    function notifPopup(title,body) {
        $('#h22').text(title);
        $('#h44').text(body);
        $('.bs-modal-lg').modal('toggle');
        setTimeout(function() {$('.bs-modal-lg').modal('hide');}, 10000);
    }
</script>

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