
<div class="row">
    <div class="col-md-12">
        <div class="box box-primary">
            <div class="box-body">
                <div class="row">
                    <div class="col-md-6">
                        <h3 class="box-title no-margin"><span class="glyphicon glyphicon-wrench"></span>Site Settings</h3>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="box box-primary">
    <!-- /.box-header -->
    <div class="box-body">
        <div class="row">
            <div class="col-md-6">
                <?= $this->Form->create($setting, array('enctype' => 'multipart/form-data', 'id' => 'settings-form')) ?>
                <div class="form-group">
                    <?php
                    echo $this->Form->input('title', array('class' => 'form-control required', 'placeholder' => __('Title')));
                    ?>
                </div>
                <!-- /.form-group -->
                <div class="form-group">
                    <?php echo $this->Form->input('meta_tag', array('class' => 'form-control required', 'placeholder' => __('Meta'))); ?>
                </div>
                <!-- /.form-group -->
                <div class="form-group">
                    <?php
                    echo $this->Form->input('previous_logo_path', array('type' => 'hidden', 'value' => $setting['logo_path']));
                    echo $this->Form->input('logo_path', array('type' => 'file', 'label' => __('LOGO')));
                    ?><br/>
                    <?php
                    if (!empty($setting['logo_path'])) {
                        ?>
                        <img src="<?php echo $this->request->webroot . $setting['logo_path']; ?>" style="width:70px;height:50px;">
                        <?php
                    } else {
                        ?>
                        <img src="<?php echo $this->request->webroot . 'images/logo/favicon.ico' ?>" style="width:70px;height:40px;">
                        <?php
                    }
                    ?>
                </div>
                <!-- /.form-group -->
                <div class="form-group">
                    <?php
                    echo $this->Form->input('previous_favicon_path', array('type' => 'hidden', 'value' => $setting['favicon_path']));
                    echo $this->Form->input('favicon_path', array('type' => 'file', 'label' => __('Favicon Icon')));
                    ?><br/>
                    <?php
                    if (!empty($setting['favicon_path'])) {
                        ?>
                        <img src="<?php echo $this->request->webroot . $setting['favicon_path']; ?>" style="width:70px;height:50px;">
                        <?php
                    } else {
                        ?>
                        <img src="<?php echo $this->request->webroot . 'images/favicon/favicon.ico' ?>" style="width:70px;height:50px;">
                        <?php
                    }
                    ?>
                </div>
                <!-- /.form-group -->

                <div class="form-group">
                    <?php
                    echo $this->Form->input('facebook_url', array('class' => 'form-control required', 'placeholder' => __('Facebook Url')));
                    ?>
                </div>
                <!-- /.form-group -->

                <div class="form-group">
                    <?php
                    echo $this->Form->input('left_menu_static_title', array('class' => 'form-control required'));
                    ?>
                </div>
                
                <div class="form-group">
                    <?php
                    echo $this->Form->input('time_zone', array('options'=>$time_zone_list,'default'=>$setting->time_zone,'class' => 'form-control required'));
                    ?>
                </div>
                <!-- /.form-group -->
            </div>
            <div class="col-md-6">
                
                <div class="form-group">
                    <?php
                    echo $this->Form->input('previous_enhance_img_path', array('type' => 'hidden', 'value' => $setting['enhance_img']));
                    echo $this->Form->input('enhance_img', array('type' => 'file', 'label' => __('Enhance Personal Identifiers ')));
                    ?><br/>
                    <?php
                    if (!empty($setting['enhance_img'])) {
                        ?>
                        <img src="<?php echo $this->request->webroot . $setting['enhance_img']; ?>" style="width:70px;height:50px;">
                        <?php
                    }
                    ?>
                </div>
                <div class="form-group">
                    <?php
                    echo $this->Form->input('previous_inquiry_img_path', array('type' => 'hidden', 'value' => $setting['inquiry_img']));
                    ?>
                </div>
                <div class="form-group">
                    <?php
                    echo $this->Form->input('default_password', array('class' => 'form-control required', 'placeholder' => __('Default Password')));
                    ?>
                </div>

                </div>
        </div>
        <!-- /.row -->
    </div>
    <!-- /.box-body -->
    <div class="box-footer">
        <?= $this->Form->button(__('Submit'), ['class' => 'btn btn-primary']) ?>
    </div>
    <?= $this->Form->end() ?>
</div>

<script>
    function makeEditable(element){
        $(element).attr('readonly', function(_, attr){ return !attr});
        $(element).parent().find('i').toggleClass('fa-eye fa-eye-slash');
    }

    function copyLink(el,input){
        event.preventDefault();
        var text = $(input).val();
        var element = $(el);
        copyToClipboard(text,element);
    }
</script>
<?php echo $this->Html->script('client_form'); ?>

