Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 811 | Rev 5751 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |

<?php

use LeadersLinked\Model\UserExperience;

$acl = $this->viewModel()
    ->getRoot()
    ->getVariable('acl');
$currentUserHelper = $this->currentUserHelper();
$currentUser = $currentUserHelper->getUser();
$currentCompany = $currentUserHelper->getCompany();

$roleName = $currentUserHelper->getUserTypeId();

$routeWebsite = $this->url('profile/website', [ 'id' => $currentCompany->uuid]);
$routeCompanySize = $this->url('profile/company-size', [ 'id' => $currentCompany->uuid]);
$routeIndustry = $this->url('profile/industry', [ 'id' => $currentCompany->uuid]);
$routeExtended = $this->url('profile/extended', [ 'id' => $currentCompany->uuid]);
$routeSocialNetworks = $this->url('profile/social-network', [ 'id' => $currentCompany->uuid]);
$routeLocationAdd = $this->url('profile/location', [ 'id' => $currentCompany->uuid, 'operation' => 'add']);
$routeFoundationYear = $this->url('profile/foundation_year', [ 'id' => $currentCompany->uuid, 'operation' => 'add']);
$routeImageUpload = $this->url('profile/image', [ 'id' => $currentCompany->uuid, 'operation' => 'upload']);
$routeCoverUpload = $this->url('profile/cover', [ 'id' => $currentCompany->uuid, 'operation' => 'upload']);
$routeFooterUpload = $this->url('profile/footer', [ 'id' => $currentCompany->uuid, 'operation' => 'upload']);
$routeHeaderUpload = $this->url('profile/header', [ 'id' => $currentCompany->uuid, 'operation' => 'upload']);


$this->inlineScript()->appendFile('https://maps.googleapis.com/maps/api/js?key=' . $google_map_key . '&libraries=places');

$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));

$this->inlineScript()->appendFile($this->basePath('plugins/ckeditor/ckeditor.js'));


$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-fileinput/css/fileinput.min.css'));
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-fileinput/themes/explorer-fas/theme.css'));

$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/plugins/piexif.js'));
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/plugins/sortable.js'));
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/fileinput.js'));
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/locales/es.js'));
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/themes/fas/theme.js'));
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/themes/explorer-fas/theme.js'));


$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));



$this->headLink()->appendStylesheet($this->basePath('plugins/select2/css/select2.min.css'));
$this->headLink()->appendStylesheet($this->basePath('plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css'));
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/select2.min.js'));


$this->inlineScript()->appendFile($this->basePath('plugins/jquery-input-number/input-number-format.jquery.min.js'));
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));


$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));





$this->inlineScript()->appendFile($this->basePath('plugins/moment/moment-with-locales.min.js'));
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css'));
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js'));

$this->inlineScript()->captureStart();
echo <<<JS
jQuery( document ).ready(function( $ ) {



    $.validator.addMethod('greaterThan', function (value, element, param) {
        var otherElement = $(param);
        return parseInt(value, 10) > parseInt(otherElement.val(), 10);
    }, 'ERROR_INVALID_MINIMUM');


    $.validator.addMethod('checkLocation', function (value, element, param) {
        var otherElement = $(param);
        return $.trim(otherElement.val()).length > 0;
    }, 'ERROR_PLACED_AUTOCOMPLETE_DOES_NOT_CONTAIN_GEOMETRY');

    var autocompleteLocation = new google.maps.places.Autocomplete(
        (document.getElementById('location_search')),
        {types: ['(cities)']}
    );





    $.fn.fillInAddressLocation = function() {
        console.log('fillInAddressLocation');

        var place = autocompleteLocation.getPlace();
        if (!place.geometry) {
            $.fn.showError('ERROR_PLACED_AUTOCOMPLETE_DOES_NOT_CONTAIN_GEOMETRY')
            return;
        } else {
        address1 = '';
        address2 = '';
        city1 = '';
        city2 = '';
        state = '';
        country = '';
        postal_code = '';

        formatted_address = place.formatted_address;
        latitude = place.geometry.location.lat();
        longitude = place.geometry.location.lng();
        var arrAddress = place.address_components;
            
        $.each(arrAddress, function(i, address_component) {
            if (address_component.types[0] == "route") {
                address1 = address_component.long_name;
            }
            if (address_component.types[0] == "sublocality") {
                address2 = address_component.long_name;
            }
            if (address_component.types[0] == "locality") {
                city1 = address_component.long_name;
            }
            if (address_component.types[0] == "administrative_area_level_2") {
                city2 = address_component.long_name;
            }
            if (address_component.types[0] == "administrative_area_level_1") {
                state = address_component.long_name;
            }
            if (address_component.types[0] == "country") {
                country = address_component.long_name;
            }
            if (address_component.types[0] == "postal_code") {
                postal_code = address_component.long_name;
            }
        });

        $('#form-location #formatted_address').val(formatted_address);
        $('#form-location #address1').val(address1);
        $('#form-location #address2').val(address2);
        $('#form-location #city1').val(city1);
        $('#form-location #city2').val(city2);
        $('#form-location #state').val(state);
        $('#form-location #country').val(country);
        $('#form-location #postal_code').val(postal_code);
        $('#form-location #latitude').val(latitude);
        $('#form-location #longitude').val(longitude);

        }
    }
    $.fn.renderLocation = function(data) {
        $('#locations-records').empty();
        if(Array.isArray(data)) {
            max = data.length;
            for(i = 0; i < max; i++)
            {
                var location = data[i];
                s = '<p>' + location['formatted_address']; 
                if(location['is_main'] == 'y') {
                    s = s + ' (LABEL_MAIN_LOCATION) '; 
                }
                s = s + ' <a href="#" title="" data-link="' + location['link_edit'] + '" class="btn-location-edit"><i class="fa fa-pencil"></i></a>&nbsp; ';
                s = s + ' <a href="#" title="" data-link="' + location['link_delete'] + '" class="btn-location-delete"><i class="fa fa-trash"></i></a>';
                s = s + ' </p>';

                if(i < (max - 1)) { 
                    s = s + '<hr/>'; 
                }
                $('#locations-records').append(s);
            }      
        }
    }

       
    
            $.validator.setDefaults({
            debug: true,
            highlight: function(element) {
                $(element).addClass('is-invalid');
            },
            unhighlight: function(element) {
                $(element).removeClass('is-invalid');
            },
            errorElement: 'span',
            errorClass: 'error invalid-feedback',
            errorPlacement: function(error, element) {
                if(element.parent('.form-group').length) {
                    error.insertAfter(element);
                } else if(element.parent('.toggle').length) {
                    error.insertAfter(element.parent().parent());
                } else {
                    error.insertAfter(element.parent());
                }
            }
        });
    
    
        $.fn.showFormErrorValidator = function(fieldname, errors) {
            var field = $(fieldname);
            if(field) {
                $(field).addClass('is-invalid');
    

                var error = $('<span id="' + fieldname +'-error" class="error invalid-feedback">' + errors + '</div>');
                if(field.parent('.form-group').length) {
                    error.insertAfter(field);
                } else  if(field.parent('.toggle').length) {
                    error.insertAfter(field.parent().parent());
                } else {
                    error.insertAfter(field.parent());
                }
            }
        };

    

   
    var validatorLocation = $('#form-location').validate({
        debug: true,
        onclick: false,
        onkeyup: false,
        onfocusout: false,
        ignore: [],
        rules: {
            'location_search': {
                required: true,
                checkLocation: '#form-location #latitude'
            }
        },
        submitHandler: function(form)
        {
            NProgress.start();
            $.ajax({
                'dataType'  : 'json',
                'accept'    : 'application/json',
                'method'    : 'post',
                'url'       :  $('#form-location').attr('action'),
                'data'      :  $('#form-location').serialize(),
            }).done(function(response) {
                if(response['success']) {
                    $.fn.renderLocation(response['data']);
                                                        
                    $("#location-box").modal('hide');
                } else {
                    validatorLocation.resetForm();
                    $.fn.showError(response['data']);
                }
            }).fail(function( jqXHR, textStatus, errorThrown) {
                $.fn.showError(textStatus);
            }).always(function() {
                NProgress.done();
            });
            return false;
        },
        invalidHandler: function(form, validator) {
        
        }
    });

    $('.btn-location-add').on("click", function(e){
        e.preventDefault();

        $('#form-location').attr('action', '$routeLocationAdd');
        $('#form-location #location_search').val('');
        $('#form-location #formatted_address').val('');
        $('#form-location #address1').val('');
        $('#form-location #address2').val('');
        $('#form-location #country').val('');
        $('#form-location #state').val('');
        $('#form-location #city1').val('');
        $('#form-location #city2').val('');
        $('#form-location #postal_code').val('');
        $('#form-location #latitude').val('');
        $('#form-location #longitude').val('');
        validatorLocation.resetForm();

        $("#location-box").modal('show');
    });

    $('body').on('click', 'a.btn-location-edit', function(e) {
        e.preventDefault();

        var url = $(this).data('link');

        NProgress.start();
        $.ajax({
            'dataType'  : 'json',
            'accept'    : 'application/json',
            'method'    : 'get',
            'url'       : url,
        }).done(function(response) {
           if(response['success']) {
                $('#form-location').attr('action', url);
                $('#form-location #location_search').val(response['data']['formatted_address']);
                $('#form-location #formatted_address').val(response['data']['formatted_address']);
                $('#form-location #address1').val(response['data']['address1']);
                $('#form-location #address2').val(response['data']['address2']);
                $('#form-location #country').val(response['data']['country']);
                $('#form-location #state').val(response['data']['state']);
                $('#form-location #city1').val(response['data']['city1']);
                $('#form-location #city2').val(response['data']['city2']);
                $('#form-location #postal_code').val(response['data']['postal_code']);
                $('#form-location #latitude').val(response['data']['latitude']);
                $('#form-location #longitude').val(response['data']['longitude']);

                if(response['data']['is_main'] == 'y') {
                    $('#form-location #is_main').bootstrapToggle('on')
                } else {
                    $('#form-location #is_main').bootstrapToggle('off')
                }

                validatorLocation.resetForm();
        
                $("#location-box").modal('show');
            } else {
                $.fn.showError(response['data']);
            }
        }).fail(function( jqXHR, textStatus, errorThrown) {
            $.fn.showError(textStatus);
        }).always(function() {
            NProgress.done();
        });
        return false;


    });

    $('body').on('click', 'a.btn-location-delete', function(e) {
        e.preventDefault();

        var url = $(this).data('link');

        NProgress.start();
        $.ajax({
            'dataType'  : 'json',
            'accept'    : 'application/json',
            'method'    : 'post',
            'url'       : url,
        }).done(function(response) {
           if(response['success']) {
                $.fn.renderLocation(response['data']);
            } else {
                $.fn.showError(response['data']);
            }
        }).fail(function( jqXHR, textStatus, errorThrown) {
            $.fn.showError(textStatus);
        }).always(function() {
            NProgress.done();
        });
        return false;


    });

    
    $('.btn-location-close').on("click", function(e){
        e.preventDefault();
        
        $("#location-box").modal('hide');
        return false;
    });

    var validatorSocialNetwork = $('#form-social-network').validate({
        debug: true,
        onclick: false,
        onkeyup: false,
        ignore: [],
        rules: {
            'facebook': {
                required: false,
                maxlength: 250,
                url: true,
            },
            'twitter': {
                required: false,
                maxlength: 250,
                url: true,
            },
            'instagram': {
                required: false,
                maxlength: 250,
                url: true,
            },
        },

        submitHandler: function(form)
        {
            NProgress.start();
            $.ajax({
                'dataType'  : 'json',
                'accept'    : 'application/json',
                'method'    : 'post',
                'url'       :  $('#form-social-network').attr('action'),
                'data'      :  $('#form-social-network').serialize()
            }).done(function(response) {
                if(response['success']) {

                                        $('#social-networks').empty();
                    var s = $.trim(response['data']['facebook']);
                    if(s.length > 32) {
                        s = s.substring(0, 31) + '...'
                    }
                    $('#social-networks').append('<li><a href="' + response['data']['facebook'] + '" target="_blank" title="">' + 
                        '<i class="fa fa-facebook-square"></i> ' + s + '</a></li>');    
    
                    var s = $.trim(response['data']['twitter']);
                    if(s.length > 32) {
                        s = s.substring(0, 31) + '...'
                    }
                    $('#social-networks').append('<li><a href="' + response['data']['twitter'] + '" target="_blank" title="">' + 
                        '<i class="fa fa-twitter"></i> ' + s + '</a></li>'); 

                    var s = $.trim(response['data']['instagram']);
                    if(s.length > 32) {
                        s = s.substring(0, 31) + '...'
                    }
                    $('#social-networks').append('<li><a href="' + response['data']['instagram'] + '" target="_blank" title="">' + 
                        '<i class="fa fa-instagram"></i> ' + s + '</a></li>'); 
     
                    $("#social-networks-box").modal('hide');
                } else {
                    validatorSocialNetwork.resetForm();
                    if(jQuery.type(response['data']) == 'string') {
                        $.fn.showError(response['data']);
                    } else  {
                        $.each(response['data'], function( fieldname, errors ) {
                            $.fn.showFormErrorValidator('#form-social-network #' + fieldname, errors);
                        });
                    }
                }
            }).fail(function( jqXHR, textStatus, errorThrown) {
                $.fn.showError(textStatus);
            }).always(function() {
                NProgress.done();
            });
            return false;
        },
        invalidHandler: function(form, validator) {
        
        }
    });
    


    $('.btn-social-network-edit').on("click", function(e){
        e.preventDefault();

        NProgress.start();
        $.ajax({
            'dataType'  : 'json',
            'accept'    : 'application/json',
            'method'    : 'get',
            'url'       : '$routeSocialNetworks',
        }).done(function(response) {
           if(response['success']) {
                $('#form-social-network #facebook').val(response['data']['facebook']);
                $('#form-social-network #twitter').val(response['data']['twitter']);
                $('#form-social-network #instagram').val(response['data']['instagram']);
                validatorSocialNetwork.resetForm();

                $("#social-networks-box").modal('show');
            } else {
                $.fn.showError(response['data']);
            }
        }).fail(function( jqXHR, textStatus, errorThrown) {
            $.fn.showError(textStatus);
        }).always(function() {
            NProgress.done();
        });
        return false;

    });
    
    $('.btn-social-network-close').on("click", function(e){
        e.preventDefault();
        
        $("#social-networks-box").modal('hide');
        return false;
    });
    
    
    var validatorExtended = $('#form-extended').validate({
        debug: true,
        onclick: false,
        onkeyup: false,
        onfocusout: false,
        ignore: [],
        rules: {
            'description': {
                updateCkeditor:function() {
                        CKEDITOR.instances.description.updateElement();
                },
                required: false,
            },
        },

        submitHandler: function(form)
        {
            NProgress.start();
            $.ajax({
                'dataType'  : 'json',
                'accept'    : 'application/json',
                'method'    : 'post',
                'url'       :  $('#form-extended').attr('action'),
                'data'      :  $('#form-extended').serialize()
            }).done(function(response) {
                if(response['success']) {

                    $('#overview-description').html(response['data']['description']);
                    $("#extended-box").modal('hide');
                } else {
                    validatorExtended.resetForm();
                    if(jQuery.type(response['data']) == 'string') {
                        $.fn.showError(response['data']);
                    } else  {
                        $.each(response['data'], function( fieldname, errors ) {
                            $.fn.showFormErrorValidator('#form-extended #' + fieldname, errors);
                        });
                    }
                }
            }).fail(function( jqXHR, textStatus, errorThrown) {
                $.fn.showError(textStatus);
            }).always(function() {
                NProgress.done();
            });
            return false;
        },
        invalidHandler: function(form, validator) {
        
        }
    });


    $('.btn-extended-edit').on("click", function(e){
        e.preventDefault();

        NProgress.start();
        $.ajax({
            'dataType'  : 'json',
            'accept'    : 'application/json',
            'method'    : 'get',
            'url'       : '$routeExtended',
        }).done(function(response) {
           if(response['success']) {
                CKEDITOR.instances.description.setData(response['data']['description']);
                validatorExtended.resetForm();

                $("#extended-box").modal('show');
            } else {
                $.fn.showError(response['data']);
            }
        }).fail(function( jqXHR, textStatus, errorThrown) {
            $.fn.showError(textStatus);
        }).always(function() {
            NProgress.done();
        });
        return false;

    });
    
    $('.btn-extended-close').on("click", function(e){
        e.preventDefault();
        
        $("#extended-box").modal('hide');
        return false;
    });


        var validatorWebsite = $('#form-website').validate({
        debug: true,
        onclick: false,
        onkeyup: false,
        onfocusout: false,
        ignore: [],
        rules: {
            'website': {
                required: false,
                maxlength: 250,
                url: true,
            },
        },

        submitHandler: function(form)
        {
            NProgress.start();
            $.ajax({
                'dataType'  : 'json',
                'accept'    : 'application/json',
                'method'    : 'post',
                'url'       :  $('#form-website').attr('action'),
                'data'      :  $('#form-website').serialize()
            }).done(function(response) {
                if(response['success']) {

                    $('#overview-website').html(response['data']['website']);
                    $("#website-box").modal('hide');
                } else {
                    validatorWebsite.resetForm();
                    if(jQuery.type(response['data']) == 'string') {
                        $.fn.showError(response['data']);
                    } else  {
                        $.each(response['data'], function( fieldname, errors ) {
                            $.fn.showFormErrorValidator('#form-website #' + fieldname, errors);
                        });
                    }
                }
            }).fail(function( jqXHR, textStatus, errorThrown) {
                $.fn.showError(textStatus);
            }).always(function() {
                NProgress.done();
            });
            return false;
        },
        invalidHandler: function(form, validator) {
        
        }
    });


    $('.btn-website-edit').on("click", function(e){
        e.preventDefault();

        NProgress.start();
        $.ajax({
            'dataType'  : 'json',
            'accept'    : 'application/json',
            'method'    : 'get',
            'url'       : '$routeWebsite',
        }).done(function(response) {
           if(response['success']) {
                $('#form-website #website').val(response['data']['website']);
                validatorWebsite.resetForm();

                $("#website-box").modal('show');
            } else {
                $.fn.showError(response['data']);
            }
        }).fail(function( jqXHR, textStatus, errorThrown) {
            $.fn.showError(textStatus);
        }).always(function() {
            NProgress.done();
        });
        return false;

    });
    
    $('.btn-website-close').on("click", function(e){
        e.preventDefault();
        
        $("#website-box").modal('hide');
        return false;
    });

        var validatorFoundationYear = $('#form-foundation-year').validate({
        debug: true,
        onclick: false,
        onkeyup: false,
        onfocusout: false,
        ignore: [],
        rules: {
            'foundation_year': {
                required: true,
                maxlength: 4,
                digits: true,
            },
        },

        submitHandler: function(form)
        {
            NProgress.start();
            $.ajax({
                'dataType'  : 'json',
                'accept'    : 'application/json',
                'method'    : 'post',
                'url'       :  $('#form-foundation-year').attr('action'),
                'data'      :  $('#form-foundation-year').serialize()
            }).done(function(response) {
                if(response['success']) {

                    $('#overview-foundation-year').html(response['data']['foundation_year']);
                    $("#foundation-year-box").modal('hide');
                } else {
                    validatorFoundationYear.resetForm();
                    if(jQuery.type(response['data']) == 'string') {
                        $.fn.showError(response['data']);
                    } else  {
                        $.each(response['data'], function( fieldname, errors ) {
                            $.fn.showFormErrorValidator('#form-foundation-year #' + fieldname, errors);
                        });
                    }
                }
            }).fail(function( jqXHR, textStatus, errorThrown) {
                $.fn.showError(textStatus);
            }).always(function() {
                NProgress.done();
            });
            return false;
        },
        invalidHandler: function(form, validator) {
        
        }
    });


    $('.btn-foundation-year-edit').on("click", function(e){
        e.preventDefault();

        NProgress.start();
        $.ajax({
            'dataType'  : 'json',
            'accept'    : 'application/json',
            'method'    : 'get',
            'url'       : '$routeFoundationYear',
        }).done(function(response) {
           if(response['success']) {
                                $('#form-foundation-year #foundation_year').val(response['data']['foundation_year'])
           
                validatorFoundationYear.resetForm();

                $("#foundation-year-box").modal('show');
            } else {
                $.fn.showError(response['data']);
            }
        }).fail(function( jqXHR, textStatus, errorThrown) {
            $.fn.showError(textStatus);
        }).always(function() {
            NProgress.done();
        });
        return false;

    });
    
    $('.btn-fondation-year-close').on("click", function(e){
        e.preventDefault();
        
        $("#foundation-year-box").modal('hide');
        return false;
    });

        var validatorCompanySize = $('#form-company-size').validate({
        debug: true,
        onclick: false,
        onkeyup: false,
        onfocusout: false,
        ignore: [],
        rules: {
            'company_size_id': {
                required: true,
            },
        },

        submitHandler: function(form)
        {
            NProgress.start();
            $.ajax({
                'dataType'  : 'json',
                'accept'    : 'application/json',
                'method'    : 'post',
                'url'       :  $('#form-company-size').attr('action'),
                'data'      :  $('#form-company-size').serialize()
            }).done(function(response) {
                if(response['success']) {

                    $('#overview-company-size').html(response['data']);
                    $("#company-size-box").modal('hide');
                } else {
                    validatorCompanySize.resetForm();
                    if(jQuery.type(response['data']) == 'string') {
                        $.fn.showError(response['data']);
                    } else  {
                        $.each(response['data'], function( fieldname, errors ) {
                            $.fn.showFormErrorValidator('#form-company-size #' + fieldname, errors);
                        });
                    }
                }
            }).fail(function( jqXHR, textStatus, errorThrown) {
                $.fn.showError(textStatus);
            }).always(function() {
                NProgress.done();
            });
            return false;
        },
        invalidHandler: function(form, validator) {
        
        }
    });


    $('.btn-company-size-edit').on("click", function(e){
        e.preventDefault();

        NProgress.start();
        $.ajax({
            'dataType'  : 'json',
            'accept'    : 'application/json',
            'method'    : 'get',
            'url'       : '$routeCompanySize',
        }).done(function(response) {
           if(response['success']) {
                                $('#form-company-size #company_size_id').val(response['data']['company_size_id']).trigger('change');
           
                validatorCompanySize.resetForm();

                $("#company-size-box").modal('show');
            } else {
                $.fn.showError(response['data']);
            }
        }).fail(function( jqXHR, textStatus, errorThrown) {
            $.fn.showError(textStatus);
        }).always(function() {
            NProgress.done();
        });
        return false;

    });
    
    $('.btn-company-size-close').on("click", function(e){
        e.preventDefault();
        
        $("#company-size-box").modal('hide');
        return false;
    });

        var validatorIndustry = $('#form-industry').validate({
        debug: true,
        onclick: false,
        onkeyup: false,
        onfocusout: false,
        ignore: [],
        rules: {
            'industry_id': {
                required: true,
            },
        },

        submitHandler: function(form)
        {
            NProgress.start();
            $.ajax({
                'dataType'  : 'json',
                'accept'    : 'application/json',
                'method'    : 'post',
                'url'       :  $('#form-industry').attr('action'),
                'data'      :  $('#form-industry').serialize()
            }).done(function(response) {
                if(response['success']) {

                    $('#overview-industry').html(response['data']);
                    $("#industry-box").modal('hide');
                } else {
                    validatorIndustry.resetForm();
                    if(jQuery.type(response['data']) == 'string') {
                        $.fn.showError(response['data']);
                    } else  {
                        $.each(response['data'], function( fieldname, errors ) {
                            $.fn.showFormErrorValidator('#form-industry #' + fieldname, errors);
                        });
                    }
                }
            }).fail(function( jqXHR, textStatus, errorThrown) {
                $.fn.showError(textStatus);
            }).always(function() {
                NProgress.done();
            });
            return false;
        },
        invalidHandler: function(form, validator) {
        
        }
    });


    $('.btn-industry-edit').on("click", function(e){
        e.preventDefault();

        NProgress.start();
        $.ajax({
            'dataType'  : 'json',
            'accept'    : 'application/json',
            'method'    : 'get',
            'url'       : '$routeIndustry',
        }).done(function(response) {
           if(response['success']) {
                                $('#form-industry #industry_id').val(response['data']['industry_id']).trigger('change');
           
                validatorIndustry.resetForm();

                $("#industry-box").modal('show');
            } else {
                $.fn.showError(response['data']);
            }
        }).fail(function( jqXHR, textStatus, errorThrown) {
            $.fn.showError(textStatus);
        }).always(function() {
            NProgress.done();
        });
        return false;

    });
    
    $('.btn-industry-close').on("click", function(e){
        e.preventDefault();
        
        $("#industry-box").modal('hide');
        return false;
    });




    var validatorImage = $('#form-image').validate({
        debug: true,
        onclick: false,
        onkeyup: false,
        onfocusout: false,
        ignore: [],
        rules: {
           'image': {
                required: true,
                extension: 'jpg|jpeg|png',
                accept: 'image/jpeg,image/png'
            },
        },

        submitHandler: function(form)
        {
            var formdata = false;
            if (window.FormData){
                formdata = new FormData(form); //form[0]);
            }

            NProgress.start();
            $.ajax({
                'dataType'  : 'json',
                'accept'    : 'application/json',
                'method'    : 'post',
                'url'       :  $('#form-image').attr('action'),
                'data'      : formdata ? formdata : $('#form-image').serialize(),
                'processData': false,
                'contentType': false,
            }).done(function(response) {
                if(response['success']) {
                                    $('#company-img').attr('src',response['data']);
                    $("#image-box").modal('hide');
                } else {
                    validatorImage.resetForm();
                    if(jQuery.type(response['data']) == 'string') {
                        $.fn.showError(response['data']);
                    } else  {
                        $.each(response['data'], function( fieldname, errors ) {
                            console.log('#form-image #' + fieldname);

                            $.fn.showFormErrorValidator('#form-image #' + fieldname, errors);
                        });
                    }
                }
            }).fail(function( jqXHR, textStatus, errorThrown) {
                $.fn.showError(textStatus);
            }).always(function() {
                NProgress.done();
            });
            return false;
        },
        invalidHandler: function(form, validator) {
        
        }
    });

    $('.btn-image-open').on("click", function(e){
        e.preventDefault();
        $('#form-image #image').fileinput('reset');
        $('#form-image #image').val('');
        validatorImage.resetForm();
        $("#image-box").modal('show');
        return false;
    });

    $('.btn-image-close').on("click", function(e){
        e.preventDefault();
        
        $("#image-box").modal('hide');
        return false;
    });


    var validatorCover = $('#form-header').validate({
        debug: true,
        onclick: false,
        onkeyup: false,
        onfocusout: false,
        ignore: [],
        rules: {
           'header': {
                required: true,
                extension: 'jpg|jpeg|png',
                accept: 'image/jpeg,image/png'
            },
        },

        submitHandler: function(form)
        {
            var formdata = false;
            if (window.FormData){
                formdata = new FormData(form); //form[0]);
            }

            NProgress.start();
            $.ajax({
                'dataType'  : 'json',
                'accept'    : 'application/json',
                'method'    : 'post',
                'url'       :  $('#form-header').attr('action'),
                'data'      : formdata ? formdata : $('#form-header').serialize(),
                'processData': false,
                'contentType': false,
            }).done(function(response) {
                if(response['success']) {
                    $('#user-header-img').attr('src',response['data']);
                    $("#image-header-box").modal('hide');
                    location.reload();
                } else {
                    validatorCover.resetForm();
                    if(jQuery.type(response['data']) == 'string') {
                        $.fn.showError(response['data']);
                    } else  {
                        $.each(response['data'], function( fieldname, errors ) {
                            $.fn.showFormErrorValidator('#form-header #' + fieldname, errors);
                        });
                    }
                }
            }).fail(function( jqXHR, textStatus, errorThrown) {
                $.fn.showError(textStatus);
            }).always(function() {
                NProgress.done();
            });
            return false;
        },
        invalidHandler: function(form, validator) {
        
        }
    });

    $('.btn-header-open').on("click", function(e){
        e.preventDefault();
        $('#form-header #header').fileinput('reset');
        $('#form-header #header').val('');
        validatorImage.resetForm();
        $("#image-header-box").modal('show');
        return false;
    });

    $('.btn-header-close').on("click", function(e){
        e.preventDefault();
        $("#image-header-box").modal('hide');
        return false;
    });


    var validatorCover = $('#form-footer').validate({
        debug: true,
        onclick: false,
        onkeyup: false,
        onfocusout: false,
        ignore: [],
        rules: {
           'footer': {
                required: true,
                extension: 'jpg|jpeg|png',
                accept: 'image/jpeg,image/png'
            },
        },

        submitHandler: function(form)
        {
            var formdata = false;
            if (window.FormData){
                formdata = new FormData(form); //form[0]);
            }

            NProgress.start();
            $.ajax({
                'dataType'  : 'json',
                'accept'    : 'application/json',
                'method'    : 'post',
                'url'       :  $('#form-footer').attr('action'),
                'data'      : formdata ? formdata : $('#form-footer').serialize(),
                'processData': false,
                'contentType': false,
            }).done(function(response) {
                if(response['success']) {
                    $('#user-footer-img').attr('src',response['data']);
                    $("#image-footer-box").modal('hide');
                    location.reload();
                } else {
                    validatorCover.resetForm();
                    if(jQuery.type(response['data']) == 'string') {
                        $.fn.showError(response['data']);
                    } else  {
                        $.each(response['data'], function( fieldname, errors ) {
                            $.fn.showFormErrorValidator('#form-footer #' + fieldname, errors);
                        });
                    }
                }
            }).fail(function( jqXHR, textStatus, errorThrown) {
                $.fn.showError(textStatus);
            }).always(function() {
                NProgress.done();
            });
            return false;
        },
        invalidHandler: function(form, validator) {
        
        }
    });


    $('.btn-footer-open').on("click", function(e){
        e.preventDefault();
        $('#form-footer #footer').fileinput('reset');
        $('#form-footer #footer').val('');
        validatorImage.resetForm();
        $("#image-footer-box").modal('show');
        return false;
    });

    $('.btn-footer-close').on("click", function(e){
        e.preventDefault();
        $("#image-footer-box").modal('hide');
        return false;
    });



    $('.btn-image-explorer').on("click", function(e){
        e.preventDefault();
        $('#form-image #image').click();
        return false;
    });


    var validatorCover = $('#form-cover').validate({
        debug: true,
        onclick: false,
        onkeyup: false,
        onfocusout: false,
        ignore: [],
        rules: {
           'cover': {
                required: true,
                extension: 'jpg|jpeg|png',
                accept: 'image/jpeg,image/png'
            },
        },

        submitHandler: function(form)
        {
            var formdata = false;
            if (window.FormData){
                formdata = new FormData(form); //form[0]);
            }

            NProgress.start();
            $.ajax({
                'dataType'  : 'json',
                'accept'    : 'application/json',
                'method'    : 'post',
                'url'       :  $('#form-cover').attr('action'),
                'data'      : formdata ? formdata : $('#form-cover').serialize(),
                'processData': false,
                'contentType': false,
            }).done(function(response) {
                if(response['success']) {
                                    $('#user-cover-img').attr('src',response['data']);
                    $("#cover-box").modal('hide');
                } else {
                    validatorCover.resetForm();
                    if(jQuery.type(response['data']) == 'string') {
                        $.fn.showError(response['data']);
                    } else  {
                        $.each(response['data'], function( fieldname, errors ) {
                            $.fn.showFormErrorValidator('#form-cover #' + fieldname, errors);
                        });
                    }
                }
            }).fail(function( jqXHR, textStatus, errorThrown) {
                $.fn.showError(textStatus);
            }).always(function() {
                NProgress.done();
            });
            return false;
        },
        invalidHandler: function(form, validator) {
        
        }
    });


    $('.btn-cover-open').on("click", function(e){
        e.preventDefault();
        $('#form-cover #cover').fileinput('reset');
        $('#form-cover #cover').val('');
        validatorCover.resetForm();
        $("#cover-box").modal('show');
        return false;
    });

    $('.btn-cover-close').on("click", function(e){
        e.preventDefault();
        
        $("#cover-box").modal('hide');
        return false;
    });

    $('.btn-cover-explorer').on("click", function(e){
        e.preventDefault();
        
        $('#form-cover #cover').click();
        return false;
    });

    $("#form-cover #cover").fileinput({
        theme: 'fas',
        language: 'es',
        showUpload: false,
        dropZoneEnabled: false,
        maxFileCount: 1,
        allowedFileExtensions: ['jpg', 'jpeg', 'png', 'gif'],
        mainClass: "input-group",
        msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $image_size_cover',
    });

    $("#form-image #image").fileinput({
        theme: 'fas',
        language: 'es',
        showUpload: false,
        dropZoneEnabled: false,
        maxFileCount: 1,
        allowedFileExtensions: ['jpg', 'jpeg', 'png', 'gif'],
        mainClass: "input-group",
        msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $image_size_profile',
    });


    $("#form-footer #footer").fileinput({
        theme: 'fas',
        language: 'es',
        showUpload: false,
        dropZoneEnabled: false,
        maxFileCount: 1,
        allowedFileExtensions: ['jpg', 'jpeg', 'png', 'gif'],
        mainClass: "input-group",
        msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $image_size_footer',
    });


    $("#form-header #header").fileinput({
        theme: 'fas',
        language: 'es',
        showUpload: false,
        dropZoneEnabled: false,
        maxFileCount: 1,
        allowedFileExtensions: ['jpg', 'jpeg', 'png', 'gif'],
        mainClass: "input-group",
        msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $image_size_header',
    });

   $('#form-skill #skills').select2({ 
        theme: 'bootstrap4',
        width: '100%', 
        placeholder: 'LABEL_SELECT_ONE_SKILLS'
    });
    $('#form-language #languages').select2({ 
        theme: 'bootstrap4',
        width: '100%',
        placeholder: 'LABEL_SELECT_ONE_LANGUAGE'
    });
    
    
    CKEDITOR.replace('description');

    autocompleteLocation.addListener('place_changed', $.fn.fillInAddressLocation);

    $('#form-location #is_main').bootstrapToggle({'on' : 'LABEL_MAIN_LOCATION',  'off' : 'LABEL_SECONDARY_LOCATION', 'width' : '160px', 'height' : '40px'});

    $('#form-foundation-year #foundation_year').datetimepicker({
        viewMode: 'years',
        format: 'YYYY'
    });



    
});


JS;
$this->inlineScript()->captureEnd();

?>

<style>

.user-profile-ov {
    position: relative;
}

.user-profile-ov .add-dp {
    position: absolute;
    top: 30%;
    right: 10%;
}

.user-profile-ov .add-dp  i {
    font-size: 14px;
    border: 2px solid #fff;
    background: #e44d3a;
    padding: 11px;
    color: #ffff
}

</style>

<!-- Content Header (Page header) -->
<section class="content-header">
   <div class="container-fluid">
      <div class="row mb-2">
         <div class="col-sm-12">
            <h1>LABEL_PROFILE</h1>
         </div>
      </div>
   </div>
   <!-- /.container-fluid -->
</section>
<input type="text" name="test" id="test" style="display: none">
<div class="row">
   <div class="col-12">
      <section class="cover-sec">
         <img
            id="user-cover-img"
            src="<?php echo $this->url('storage', ['type' => 'company-cover', 'code' => $currentCompany->uuid, 'filename' => $cover]) ?>"
            alt="">
         <div class="add-pic-box change-cover-image">
            <div class="container">
               <div class="row no-gutters">
                  <div class="col-lg-12 col-sm-12">
                     <a href="#" class="btn-cover-open">
                     <i class="fa fa-camera"></i>
                     </a>
                  </div>
               </div>
            </div>
         </div>
      </section>
   </div>
</div>
<div class="row">
   <div class="col-lg-3">
      <div class="main-left-sidebar">
         <div class="user_profile">
            <div class="user-pro-img">
               <img id="company-img"
                  src="<?php echo $this->url('storage', ['type' => 'company', 'code' => $currentCompany->uuid, 'filename' => $image]) ?>"
                  alt="">
               <div class="add-dp" id="OpenImgUpload">
                  <a href="#" class="btn-image-open">
                  <i    class="fa fa-camera"></i></a>
               </div>
            </div>
            <!--user-pro-img end-->
            <div class="user_pro_status">
               <ul class="flw-status list-unstyled">
                  <li><span>LABEL_FOLLOWERS</span> <b><?php echo $follower?></b>
                  </li>
               </ul>
            </div>
            <!--user_pro_status end-->
            <div class="user-social-network-ov">
               <h3>
                  LABEL_SOCIAL_NETWORKS <a href="#" title="" class="btn-social-network-edit"><i class="fa fa-pencil"></i></a>
               </h3>
            </div>
            <ul id="social-networks" class="social_links list-unstyled">
               <?php
                  $l = strlen($facebook);
                  if ($l > 32) {
                      $s = substr($facebook, 0, 32) . '...';
                  } else {
                      $s = $facebook;
                  }
                  ?>
               <li><a href="<?php echo $facebook ?>" target="_blank" title=""><i
                  class="fa fa-facebook-square btn-social-network-edit"></i> <?php echo $s?></a></li>
               <?php
                  $l = strlen($twitter);
                  if ($l > 32) {
                      $s = substr($twitter, 0, 32) . '...';
                  } else {
                      $s = $twitter;
                  }
                  ?>
               <li><a href="<?php echo $twitter ?>" title="" target="_blank">
                  <i class="fa fa-twitter btn-social-network-edit"></i> 
                  <?php echo $s?></a>
               </li>
               <?php
                  $l = strlen($instagram);
                  if ($l > 32) {
                      $s = substr($instagram, 0, 32) . '...';
                  } else {
                      $s = $instagram;
                  }
                  ?>
               <li><a href="<?php echo $instagram ?>" target="_blank" title=""><i
                  class="fa fa-instagram btn-social-network-edit"></i> <?php echo $s?></a></li>
            </ul>
         </div>
         <!--user_profile end-->
      </div>
      <!--main-left-sidebar end-->
   </div>
   <div class="col-lg-6">
      <div class="main-ws-sec">
         <div class="user-tab-sec rewivew">
            <h3><?php echo $company_name ?></h3>
         </div>
         <!--user-tab-sec end-->
         <div class="user-profile-extended-ov">
            <h3>
               LABEL_OVERVIEW <a href="#" title="" class="btn-extended-edit"><i class="fa fa-pencil"></i></a>
            </h3>
            <span id="overview-description"><?php echo $overview ?></span>
         </div>
         <div class="user-profile-extended-ov st2">
            <h3>
               LABEL_LOCATIONS 
               <a href="#" title="" class="btn-location-add"> <i class="fa fa-plus-square"></i></a>
            </h3>
            <span id="locations-records">
               <?php 
                  $max = count($locations);
                  for($i = 0;  $i < $max; $i++) : 
                  $location = $locations[$i];
                  
                  ?>
               <p>
                  <?php echo $location['formatted_address']   ?><?php echo $location['is_main'] == 'y' ? ' (LABEL_MAIN_LOCATION) ' : ''?>
                  <a href="#" title="" data-link="<?php echo $location['link_edit'] ?>" class="btn-location-edit"><i class="fa fa-pencil"></i></a>&nbsp; 
                  <a href="#" title="" data-link="<?php echo $location['link_delete'] ?>" class="btn-location-delete"><i class="fa fa-trash"></i></a>
               </p>
               <?php if($i < ($max - 1)) : ?>
               <hr/>
               <?php endif; ?>
               <?php endfor; ?> 
            </span>
         </div>
         <!--user-profile-ov end-->
         <div class="user-profile-ov">
            <h3>
               LABEL_INDUSTRY <a href="#" title="" class="btn-industry-edit"><i class="fa fa-pencil"></i></a>
            </h3>
            <span id="overview-industry"><?php echo $industry ?><span>
         </div>
         <!--user-profile-ov end-->
         <!--user-profile-ov end-->
         <div class="user-profile-ov">
            <h3>
               LABEL_COMPANY_SIZE <a href="#" title="" class="btn-company-size-edit"><i class="fa fa-pencil"></i></a>
            </h3>
            <span id="overview-company-size"><?php echo $company_size?></span>
         </div>
         <!--user-profile-ov end-->
         <!--user-profile-ov end-->
         <div class="user-profile-ov">
            <h3>
               LABEL_FOUNDATION_YEAR <a href="#" title="" class="btn-foundation-year-edit"><i class="fa fa-pencil"></i></a>
            </h3>
            <span id="overview-foundation-year"><?php echo $foundation_year ?></span>
         </div>
         <!--user-profile-ov end-->
         <!--user-profile-ov end-->
         <div class="user-profile-ov">
            <h3>
               LABEL_WEBSITE <a href="#" title="" class="btn-website-edit"><i class="fa fa-pencil"></i></a>
            </h3>
            <span id="overview-website"><?php echo $website ?></span>
         </div>
         <!--user-profile-ov end-->
         <!--user-profile-ov end-->
         <div class="user-profile-ov">
            
         <h3>
               LABEL_HEADER_PDF (2480 x 268px)
            </h3>
            <p>LABEL_TEXT_HEADER_PDF</p>
         <img
               id="user-header-img"
               style="width: 100%;"
               src="<?php echo $this->url('storage', ['type' => 'company', 'code' => $currentCompany->uuid, 'filename' => $header]) ?>"
               alt="">
               <div class="add-dp">
            <div class="add-pic-box change-header-image">
               <div class="container">
                  <div class="row no-gutters">
                     <div class="col-lg-12 col-sm-12">
                        <a href="#" class="btn-header-open">
                        <i      class="fa fa-camera"></i>
                        </a>
                     </div>
                  </div>
               </div>
            </div>
               </div>
         </div>
         <!--user-profile-ov end-->
         <!--user-profile-ov end-->
         <div class="user-profile-ov">
         <h3>
         LABEL_FOOTER_PDF (2480 x 268px)
            </h3>
            <p>LABEL_TEXT_FOOTER_PDF</p>
   <img
      id="user-footer-img"
      style="width: 100%;"
      src="<?php echo $this->url('storage', ['type' => 'company', 'code' => $currentCompany->uuid, 'filename' => $footer]) ?>"
      alt="">
   <div class="add-dp">
      <div class="add-pic-box change-footer-image">
         <div class="container">
            <div class="row no-gutters">
               <div class="col-lg-12 col-sm-12">
                  <a href="#" class="btn-footer-open">
                  <i    class="fa fa-camera"></i>
                  </a>
               </div>
            </div>
         </div>
      </div>
   </div>
</div>
         <!--user-profile-ov end-->
      </div>
      <!--main-ws-sec end-->
   </div>
   <div class="col-lg-3">
      <div class="right-sidebar">
         <?php //echo $this->companySuggestionHelper($company_id)?>
      </div>
      <!--right-sidebar end-->
   </div>
   <!--right-sidebar end-->
</div>
<div class="modal" tabindex="-1" role="dialog" id="extended-box">
   <div class="modal-dialog" role="document">
      <?php
         $form = $this->formExtended;
         $form->setAttributes([
             'method' => 'post',
             'action' => $routeExtended,
             'name' => 'form-extended',
             'id' => 'form-extended'
         ]);
         $form->prepare();
         echo $this->form()->openTag($form);
         ?> 
      <div class="modal-content">
         <div class="modal-header">
            <h3 class="modal-title">LABEL_CHANGE</h3>
         </div>
         <div class="modal-body">
            <div class="form-group">
               <?php 
                  $element = $form->get('description');
                  $element->setAttributes(['class' => 'form-control']); 
                  $element->setOptions(['label' => 'LABEL_OVERVIEW']);
                  echo $this->formLabel($element);
                  echo $this->formTextArea($element);
                  ?>
            </div>
         </div>
         <div class="modal-footer">
            <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
            <button type="button" class="btn btn-default btn-extended-close">LABEL_CANCEL</button>
         </div>
         <?php echo $this->form()->closeTag($form); ?>  
      </div>
   </div>
</div>
<div class="modal" tabindex="-1" role="dialog" id="foundation-year-box">
   <div class="modal-dialog" role="document">
      <?php
         $form = $this->formFoundationYear;
         $form->setAttributes([
             'method' => 'post',
             'action' => $routeFoundationYear,
             'name' => 'form-foundation-year',
             'id' => 'form-foundation-year'
         ]);
         $form->prepare();
         echo $this->form()->openTag($form);
         ?> 
      <div class="modal-content">
         <div class="modal-header">
            <h3 class="modal-title">LABEL_CHANGE</h3>
         </div>
         <div class="modal-body">
            <div class="form-group">
               <?php 
                  $element = $form->get('foundation_year');
                  $element->setAttributes(['class' => 'form-control']); 
                  $element->setOptions(['label' => 'LABEL_FOUNDATION_YEAR']);
                  echo $this->formLabel($element);
                  echo $this->formText($element);
                  ?>
            </div>
         </div>
         <div class="modal-footer">
            <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
            <button type="button" class="btn btn-default btn-fondation-year-close">LABEL_CANCEL</button>
         </div>
         <?php echo $this->form()->closeTag($form); ?>  
      </div>
   </div>
</div>
<div class="modal" tabindex="-1" role="dialog" id="website-box">
   <div class="modal-dialog" role="document">
      <?php
         $form = $this->formWebsite;
         $form->setAttributes([
             'method' => 'post',
             'action' => $routeWebsite,
             'name' => 'form-website',
             'id' => 'form-website'
         ]);
         $form->prepare();
         echo $this->form()->openTag($form);
         ?> 
      <div class="modal-content">
         <div class="modal-header">
            <h3 class="modal-title">LABEL_CHANGE</h3>
         </div>
         <div class="modal-body">
            <div class="form-group">
               <?php 
                  $element = $form->get('website');
                  $element->setAttributes(['class' => 'form-control']); 
                  $element->setOptions(['label' => 'LABEL_WEBSITE']);
                  echo $this->formLabel($element);
                  echo $this->formText($element);
                  ?>
            </div>
         </div>
         <div class="modal-footer">
            <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
            <button type="button" class="btn btn-default btn-website-close">LABEL_CANCEL</button>
         </div>
         <?php echo $this->form()->closeTag($form); ?>  
      </div>
   </div>
</div>
<div class="modal" tabindex="-1" role="dialog" id="industry-box">
   <div class="modal-dialog" role="document">
      <?php
         $form = $this->formIndustry;
         $form->setAttributes([
             'method' => 'post',
             'action' => $routeIndustry,
             'name' => 'form-industry',
             'id' => 'form-industry'
         ]);
         $form->prepare();
         echo $this->form()->openTag($form);
         ?> 
      <div class="modal-content">
         <div class="modal-header">
            <h3 class="modal-title">LABEL_CHANGE</h3>
         </div>
         <div class="modal-body">
            <div class="form-group">
               <?php 
                  $element = $form->get('industry_id');
                  $element->setAttributes(['class' => 'form-control']); 
                  $element->setOptions(['label' => 'LABEL_INDUSTRY']);
                  echo $this->formLabel($element);
                  echo $this->formSelect($element);
                  ?>
            </div>
         </div>
         <div class="modal-footer">
            <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
            <button type="button" class="btn btn-default btn-industry-close">LABEL_CANCEL</button>
         </div>
         <?php echo $this->form()->closeTag($form); ?>  
      </div>
   </div>
</div>
<div class="modal" tabindex="-1" role="dialog" id="company-size-box">
   <div class="modal-dialog" role="document">
      <?php
         $form = $this->formCompanySize;
         $form->setAttributes([
             'method' => 'post',
             'action' => $routeCompanySize,
             'name' => 'form-company-size',
             'id' => 'form-company-size'
         ]);
         $form->prepare();
         echo $this->form()->openTag($form);
         ?> 
      <div class="modal-content">
         <div class="modal-header">
            <h3 class="modal-title">LABEL_CHANGE</h3>
         </div>
         <div class="modal-body">
            <div class="form-group">
               <?php 
                  $element = $form->get('company_size_id');
                  $element->setAttributes(['class' => 'form-control']); 
                  $element->setOptions(['label' => 'LABEL_COMPANY_SIZE']);
                  echo $this->formLabel($element);
                  echo $this->formSelect($element);
                  ?>
            </div>
         </div>
         <div class="modal-footer">
            <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
            <button type="button" class="btn btn-default btn-company-size-close">LABEL_CANCEL</button>
         </div>
         <?php echo $this->form()->closeTag($form); ?>  
      </div>
   </div>
</div>
<div class="modal" tabindex="-1" role="dialog" id="location-box">
   <div class="modal-dialog" role="document">
      <?php
         $form = $this->formLocation;
         $form->setAttributes([
             'method' => 'post',
             'action' => '',
             'name' => 'form-location',
             'id' => 'form-location'
         ]);
         $form->prepare();
         echo $this->form()->openTag($form);
         
         $fieldnames = [
             'formatted_address',
             'address1',
             'address2',
             'country',
             'state',
             'city1',
             'city2',
             'postal_code',
             'latitude',
             'longitude',
         ];
         
         foreach($fieldnames as $fieldname) {
         
             $element = $form->get($fieldname);
             echo $this->formHidden($element);
         }
         ?>
      <div class="modal-content">
         <div class="modal-header">
            <h3 class="modal-title">LABEL_CHANGE</h3>
         </div>
         <div class="modal-body">
            <div class="form-group datefm">
               <?php 
                  $element = $form->get('location_search');
                  $element->setAttributes(['class' => 'form-control']); 
                  $element->setOptions(['label' => 'LABEL_LOCATION']);
                  echo $this->formLabel($element);
                  echo $this->formText($element);
                  ?>
               <i class="fa fa-map-marker"></i>
            </div>
            <div class="form-group">
               <?php 
                  $element = $form->get('is_main');
                  echo $this->formCheckbox($element);
                  ?>
            </div>
         </div>
         <div class="modal-footer">
            <button type="submit" class="btn btn-primary ">LABEL_SAVE</button>
            <button type="button" class="btn btn-default btn-location-close">LABEL_CANCEL</button>
         </div>
         <?php echo $this->form()->closeTag($form); ?>  
      </div>
   </div>
</div>
<div class="modal" tabindex="-1" role="dialog" id="social-networks-box">
   <div class="modal-dialog" role="document">
      <?php
         $form = $this->formSocialNetwork;
         $form->setAttributes([
             'method' => 'post',
             'action' => $routeSocialNetworks,
             'name' => 'form-social-network',
             'id' => 'form-social-network'
         ]);
         $form->prepare();
         echo $this->form()->openTag($form);
         ?> 
      <div class="modal-content">
         <div class="modal-header">
            <h3 class="modal-title">LABEL_CHANGE</h3>
         </div>
         <div class="modal-body">
            <div class="form-group">
               <?php 
                  $element = $form->get('facebook');
                  $element->setAttributes(['class' => 'form-control']); 
                  $element->setOptions(['label' => 'LABEL_FACEBOOK']);
                  echo $this->formLabel($element);
                  echo $this->formText($element);
                  ?>
            </div>
            <div class="form-group">
               <?php 
                  $element = $form->get('twitter');
                  $element->setAttributes(['class' => 'form-control']); 
                  $element->setOptions(['label' => 'LABEL_TWITTER']);
                  echo $this->formLabel($element);
                  echo $this->formText($element);
                  ?>
            </div>
            <div class="form-group">
               <?php 
                  $element = $form->get('instagram');
                  $element->setAttributes(['class' => 'form-control']); 
                  $element->setOptions(['label' => 'LABEL_INSTAGRAM']);
                  echo $this->formLabel($element);
                  echo $this->formText($element);
                  ?>
            </div>
            <div class="form-group">
            </div>
            <div class="modal-footer">
               <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
               <button type="button" class="btn btn-default btn-social-network-close">LABEL_CANCEL</button>
            </div>
         </div>
         <?php echo $this->form()->closeTag($form); ?>  
      </div>
   </div>
</div>
<div class="modal" tabindex="-1" role="dialog" id="image-box">
   <div class="modal-dialog" role="document">
      <?php 
         $form = $this->formImage;
                  $form->setAttributes([
                      'method' => 'post',
                      'action' => $routeImageUpload,
                      'name' => 'form-image',
                      'id' => 'form-image',
                      'enctype' => 'multipart/form-data' 
                  ]);
                  $form->prepare();
                  echo $this->form()->openTag($form);
                  ?> 
      <div class="modal-content">
         <div class="modal-header">
            <h3 class="modal-title">LABEL_CHANGE</h3>
         </div>
         <div class="modal-body">
            <div class="form-group">
               <div class="file-loading">
                  <?php 
                     $element = $form->get('image');
                     $element->setAttributes(['class' => 'form-control', 'accept' => 'image/jpeg,image/png']);
                     $element->setOptions(['label' => 'LABEL_IMAGE']);
                     echo $this->formLabel($element);
                     echo $this->formFile($element);
                     ?>
               </div>
            </div>
         </div>
         <div class="modal-footer">
            <button type="submit" class="btn btn-primary">LABEL_UPLOAD</button>
            <button type="button" class="btn btn-default btn-image-close">LABEL_CANCEL</button>
         </div>
         <?php echo $this->form()->closeTag($form); ?>  
      </div>
   </div>
</div>
<div class="modal" tabindex="-1" role="dialog" id="image-header-box">
   <div class="modal-dialog" role="document">
      <?php 
         $form = $this->formHeader;
                  $form->setAttributes([
                      'method' => 'post',
                      'action' => $routeHeaderUpload,
                      'name' => 'form-header',
                      'id' => 'form-header',
                      'enctype' => 'multipart/form-data' 
                  ]);
                  $form->prepare();
                  echo $this->form()->openTag($form);
                  ?> 
      <div class="modal-content">
         <div class="modal-header">
            <h3 class="modal-title">LABEL_CHANGE</h3>
         </div>
         <div class="modal-body">
            <div class="form-group">
               <div class="file-loading">
                  <?php 
                     $element = $form->get('header');
                     $element->setAttributes(['class' => 'form-control', 'accept' => 'image/jpeg,image/png']);
                     $element->setOptions(['label' => 'LABEL_IMAGE']);
                     echo $this->formLabel($element);
                     echo $this->formFile($element);
                     ?>
               </div>
            </div>
         </div>
         <div class="modal-footer">
            <button type="submit" class="btn btn-primary">LABEL_UPLOAD</button>
            <button type="button" class="btn btn-default btn-header-close">LABEL_CANCEL</button>
         </div>
         <?php echo $this->form()->closeTag($form); ?>  
      </div>
   </div>
</div>
<div class="modal" tabindex="-1" role="dialog" id="image-footer-box">
   <div class="modal-dialog" role="document">
      <?php 
         $form = $this->formFooter;
                  $form->setAttributes([
                      'method' => 'post',
                      'action' => $routeFooterUpload,
                      'name' => 'form-footer',
                      'id' => 'form-footer',
                      'enctype' => 'multipart/form-data' 
                  ]);
                  $form->prepare();
                  echo $this->form()->openTag($form);
                  ?> 
      <div class="modal-content">
         <div class="modal-header">
            <h3 class="modal-title">LABEL_CHANGE</h3>
         </div>
         <div class="modal-body">
            <div class="form-group">
               <div class="file-loading">
                  <?php 
                     $element = $form->get('footer');
                     $element->setAttributes(['class' => 'form-control', 'accept' => 'image/jpeg,image/png']);
                     $element->setOptions(['label' => 'LABEL_IMAGE']);
                     echo $this->formLabel($element);
                     echo $this->formFile($element);
                     ?>
               </div>
            </div>
         </div>
         <div class="modal-footer">
            <button type="submit" class="btn btn-primary">LABEL_UPLOAD</button>
            <button type="button" class="btn btn-default btn-footer-close">LABEL_CANCEL</button>
         </div>
         <?php echo $this->form()->closeTag($form); ?>  
      </div>
   </div>
</div>
<div class="modal" tabindex="-1" role="dialog" id="cover-box">
<div class="modal-dialog" role="document">
   <?php 
      $form = $this->formCover;
               $form->setAttributes([
                   'method' => 'post',
                   'action' => $routeCoverUpload,
                   'name' => 'form-cover',
                   'id' => 'form-cover',
                   'enctype' => 'multipart/form-data' 
               ]);
               $form->prepare();
               echo $this->form()->openTag($form);
               ?> 
   <div class="modal-content">
      <div class="modal-header">
         <h3 class="modal-title">LABEL_CHANGE</h3>
      </div>
      <div class="modal-body">
         <div class="form-group">
            <div class="file-loading">
               <?php 
                  $element = $form->get('cover');
                  $element->setAttributes(['class' => 'form-control', 'accept' => 'image/jpeg,image/png']);
                  $element->setOptions(['label' => 'LABEL_COVER']);
                  echo $this->formLabel($element);
                  echo $this->formFile($element);
                  ?>
            </div>
         </div>
         <div class="modal-footer">
            <button type="submit" class="btn btn-primary ">LABEL_UPLOAD</button>
            <button type="button" class="btn btn-default btn-cover-close">LABEL_CANCEL</button>
         </div>
         <?php echo $this->form()->closeTag($form); ?>  
      </div>
   </div>
</div>