AnonSec Shell
Server IP : 162.214.74.102  /  Your IP : 216.73.217.46
Web Server : Apache
System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64
User : lrsys ( 1015)
PHP Version : 5.6.40
Disable Function : exec,passthru,shell_exec,system
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/lrsys/www/lrsys_apps/imobles/application/plugins/module_imobles/views/enterprises/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/lrsys/www/lrsys_apps/imobles/application/plugins/module_imobles/views/enterprises/add.tpl
<div class="wrapper wrapper-content" style="padding-bottom: 0;">
    {$title_action = $_L['module imobles Add enterprise']}
    {if (!empty($enterprises->id))}
        {$title_action = $_L['module imobles Edit enterprise']}
    {/if}
    {$can_edit = true}
    <div class="row">

        <div class="col-md-12">

            <div class="ibox float-e-margins">

                <div class="ibox-title">
                    <h5>{$title_action}</h5>
                    {if   $typeForm!='modal'}
                        <a href="{$_url}module_imobles/enterprises/listAll"
                           class="btn btn-xs btn-primary btn-rounded pull-right">
                            <i class="fa fa-bars"></i> {$_L['module imobles list enterprise']}
                        </a>
                    {else}
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    {/if}
                </div>

                <div class="ibox-content" id="ibox_form_entreprise">

                    <div class="alert alert-danger" id="emsg">
                        <span id="emsgbody"></span>
                    </div>


                    <ul class="nav nav-tabs">
                        <li class="active"><a style="" data-toggle="tab" href="#general_data">{$_L['module imobles data enterprises'] }</a></li>
                        <li><a data-toggle="tab" href="#towers">{$_L['module imobles towers']}</a></li>
                        <li><a data-toggle="tab" href="#hotsite">{$_L['module imobles hotsite']}</a></li>
                    </ul>

                    <form class="form-horizontal" id="form-enterprises" method="post" enctype="multipart/form-data"   >

                        <input name="id" id="id" type="hidden" value="{if isset($enterprises->id)}{$enterprises->id}{/if}">
                        
                        <!-- Valido os empreendimentos salvos-->
                        <input name="verified" id="verified" type="hidden" value="1">
                        <div class="tab-content">

                            <!-- DADOS GERAIS -->
                            <div id="general_data" class="tab-pane fade in active">

                                <div class="row">
                                    <div class="col-md-2 col-sm-12 col-xs-12">  
                                        <label class=" control-label" >{$_L['Active']}</label>
                                        <input type="checkbox" {if $enterprises->enable}checked{/if} data-toggle="toggle" data-size="small" data-on="{$_L['Yes']}" data-off="{$_L['No']}" id="enable" name="enable" value="1">     
                                    </div>
                                    <div class="col-md-2 col-sm-12 col-xs-12">  
                                        <label class=" control-label" >{$_L['module imobles site_enabled']}</label>
                                        <input type="checkbox" {if $enterprises->site_enabled}checked{/if} data-toggle="toggle" data-size="small" data-on="{$_L['Yes']}" data-off="{$_L['No']}" id="site_enabled" name="site_enabled" value="1">     
                                    </div>
                                    <div class="col-md-2 col-sm-12 col-xs-12">  
                                        <label class=" control-label" >{$_L['module imobles sanitized']}</label>
                                        <input type="checkbox" {if $enterprises->sanitized}checked{/if} data-toggle="toggle" data-size="small" data-on="{$_L['Yes']}" data-off="{$_L['No']}" id="sanitized" name="sanitized" value="1">
                                    </div>
                                    <div class="col-md-4 col-sm-12 col-xs-12">  
                                        <label class=" control-label" >{$_L['module imobles imobles_client']}</label>
                                        <input type="checkbox" {if $enterprises->imobles_client}checked{/if} data-toggle="toggle" data-size="small" data-on="{$_L['Yes']}" data-off="{$_L['No']}" id="site_enabled" name="imobles_client" value="1">     
                                    </div>
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles entreprise name']} {$_L['*']}
                                        </label>
                                        <input name='name' value="{$enterprises->name}" class="form-control">
                                    </div>
                                    
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles entreprise name alternative']} {$_L['*']}
                                        </label>
                                        <input name='alternative_names' value="{$enterprises->alternative_names}" class="form-control">
                                    </div>



                                    <div class="col-md-12 col-sm-12 col-xs-12">
                                        <label class="control-label" for="title">
                                            {$_L['Description']} <small class="red">*</small>
                                        </label> 
                                        <textarea class="form-control"  name="desc"
                                                  rows="3">{$enterprises->desc}</textarea>
                                    </div>
                                    <div class="col-md-12 col-sm-12 col-xs-12">
                                        <label class="control-label" for="title">
                                            {$_L['Obs']}
                                        </label> 
                                        <textarea class="form-control"  name="obs"
                                                  rows="3">{$enterprises->obs}</textarea>
                                    </div>


                                    <div class="col-sm-12 col-md-12">
                                        <label class="control-label" for="title">
                                            {$_L['module imobles enterprise_amenities']} 
                                        </label>
                                        <select name="module_imobles_enterprise_amenities[]" multiple=""  id="module_imobles_enterprise_amenities" class="form-control ">
                                            {if not empty($module_imobles_enterprise_amenities)}
                                                {foreach $module_imobles_enterprise_amenities as $m}
                                                    <option value="{$m->id}" selected> {$m->name}</option>
                                                {/foreach}
                                            {/if}
                                        </select>
                                        <span class="help-block"><a href="#" id="add_new_enterprise_amenities">{$_L['module imobles Add enterprise_amenities']}</a> </span>

                                    </div>

                                    <div class="col-sm-12 col-md-3">
                                        <label class="control-label" for="title">
                                            {$_L['module imobles enterprise_standard']} 
                                        </label>
                                        <select name="module_imobles_enterprise_standard_id" id="module_imobles_enterprise_standard_id" class="form-control ">
                                            {if not empty($module_imobles_enterprise_standard)}
                                                <option value="{$module_imobles_enterprise_standard->id}" selected> {$module_imobles_enterprise_standard->name}</option>
                                            {/if}
                                        </select>
                                        <span class="help-block"><a href="#" id="add_new_enterprise_standard">{$_L['module imobles Add enterprise_standard']}</a> </span>

                                    </div>  

                                    <div class="col-sm-12 col-md-3">
                                        <label class="control-label" for="title">
                                            {$_L['module imobles company_construction']} 
                                        </label>
                                        <select name="module_imobles_company_construction_id" id="module_imobles_company_construction_id" class="form-control ">
                                            {if not empty($module_imobles_company_construction)}
                                                <option value="{$module_imobles_company_construction->id}" selected> {$module_imobles_company_construction->name}</option>
                                            {/if}
                                        </select>
                                        <span class="help-block"><a href="#" id="add_new_company_construction">{$_L['module imobles Add company_construction']}</a> </span>
                                    </div>  


                                    <div class="col-sm-12 col-md-3">
                                        <label class="control-label" for="title">
                                            {$_L['module imobles financing company construction']} 
                                        </label>
                                        <select name="financing_company_construction" id="financing_company_construction" class="form-control ">
                                            <option value="Yes"{if $enterprises->financing_company_construction=='Yes'}selected{/if}> {$_L['Yes']}</option>
                                            <option value="No"{if $enterprises->financing_company_construction=='No'}selected{/if}> {$_L['No']}</option>
                                            <option value="With Restriction"{if $enterprises->financing_company_construction=='With Restriction'}selected{/if}> {$_L['module imobles entreprise With restriction']}</option>
                                        </select>
                                    </div>  

                                    <div class="col-sm-12 col-md-3">
                                        <label class="control-label" for="title">
                                            {$_L['module imobles permute']} 
                                        </label>
                                        <select name="permute" id="permute" class="form-control ">
                                            <option value="Yes"{if $enterprises->permute=='Yes'}selected{/if}> {$_L['Yes']}</option>
                                            <option value="No"{if $enterprises->permute=='No'}selected{/if}> {$_L['No']}</option>
                                            <option value="Uninformed"{if $enterprises->permute=='Uninformed'}selected{/if}> 
                                                {$_L['module imobles uninformed']}</option>
                                        </select>
                                    </div>  
                                </div>
                                
                                <div class='row'>


                                    {*<div class="col-sm-12 col-md-6 ">
                                        <label class="control-label" >
                                            {$_L['module imobles site imobles']} 
                                        </label>
                                        <input name='site_imobles' value="{$enterprises->site_imobles}" class="form-control">
                                    </div>
                                    <div class="col-sm-12 col-md-6 ">
                                        <label class="control-label" >
                                            {$_L['module imobles link hotsite']} 
                                        </label>
                                        <input name='link_hotsite' value="{$enterprises->link_hotsite}" class="form-control">
                                    </div>*}
                                   

                                    <div class="col-sm-12 col-md-6 ">
                                        <label class="control-label" >
                                            {$_L['module imobles hubspot']} 
                                        </label>
                                        <input name='hubspot' value="{$enterprises->hubspot}" class="form-control">
                                    </div>   
                                    <div class="col-sm-12 col-md-3 ">
                                        <label class="control-label" >
                                            {$_L['module imobles entreprise date delivery']} 
                                        </label>
                                        <input type="text" class="form-control date"  name="release_date" datepicker
                                                                           data-date-format="{$_c['formatDate']}" data-auto-close="true"
                                                                           value="{if not empty($enterprises->release_date)}{date( $_c['df'], strtotime($enterprises->release_date))}{/if}">

                                    </div>  
                                    <div class="col-sm-12 col-md-3 ">
                                        <label class="control-label" >
                                            {$_L['module imobles enterprise init sales']} 
                                        </label>
                                        <input type="text" class="form-control date"  name="init_sales" datepicker
                                                                        data-date-format="{$_c['formatDate']}" data-auto-close="true"
                                                                        value="{if not empty($enterprises->init_sales)}{date( $_c['df'], strtotime($enterprises->init_sales))}{/if}">

                                    </div>  
                                </div>

                                <div class="row">
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles entreprise virtual tour']}
                                        </label>
                                        <input name='videoTourLink' value="{if isset($enterprises->videoTourLink)}{$enterprises->videoTourLink}{/if}" class="form-control">
                                    </div>
                                </div>           

                                <div class="row">
                                    <div class="col-md-2 col-sm-12">
                                        <label class="control-label" for="title">{$_L['module imobles publication type']}</label>
                                        <select name="portal_publication_type" id="portal_publication_type" class="form-control">
                                            <option value="STANDARD"{if $enterprises->portal_publication_type=='STANDARD'}selected{/if}> {$_L['module imobles publication type standard']}</option>
                                            <option value="PREMIUM"{if $enterprises->portal_publication_type=='PREMIUM'}selected{/if}> {$_L['module imobles publication type premium']}</option>
                                            <option value="SUPER_PREMIUM"{if $enterprises->portal_publication_type=='SUPER_PREMIUM'}selected{/if}> {$_L['module imobles publication type super premium']}</option>
                                        </select>
                                    </div>
                                </div>

                                </div>                                                               



                                <div class='row'>
                                <div class="col-xs-12 div_form">  <h2>{$_L['module imobles financing simulation']}</h2> </div>

                                <div class="col-sm-12 col-md-1 ">&nbsp;</div>
                                <div class="col-sm-12 col-md-1 ">
                                    <label class="control-label">
                                    {$_L['module imobles financing input']}
                                    </label>
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <label class="control-label" >
                                    {$_L['module imobles financing signal']}
                                    </label>
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <label class="control-label" >
                                    {$_L['module imobles financing montlhy']}
                                    </label>
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <label class="control-label" >
                                    {$_L['module imobles financing semester']}
                                    </label>
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <label class="control-label" >
                                    {$_L['module imobles financing keys']}
                                    </label>                                        
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <label class="control-label" >
                                    {$_L['module imobles financing financed']}
                                    </label>                                        
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <label class="control-label" >
                                    {$_L['module imobles financing total']}
                                    </label>                                        
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <label class="control-label" >
                                    {$_L['module imobles financing founding']}
                                    </label>                                        
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <label class="control-label" >
                                    {$_L['module imobles financing calculated total']}
                                    </label>                                        
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <label class="control-label" >
                                    {$_L['module imobles financing difference']}
                                    </label>                                        
                                </div>
                            </div>                            

                            <div class='row'>
                                <div class="col-sm-12 col-md-1 ">
                                    <label class="control-label" >{$_L['module imobles financing number of installments']}</label>
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <input name='financing_input_qtd' id='financing_input_qtd' value="{if $enterprises->financing_input_qtd}{$enterprises->financing_input_qtd}{/if}" class="form-control integer">
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <input name='financing_signal_qtd' id='financing_signal_qtd' value="{if $enterprises->financing_signal_qtd}{$enterprises->financing_signal_qtd}{/if}" class="form-control integer">
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <input name='financing_monthly_qtd' id='financing_monthly_qtd' value="{if $enterprises->financing_monthly_qtd}{$enterprises->financing_monthly_qtd}{/if}" class="form-control integer">
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <input name='financing_semester_qtd' id='financing_semester_qtd' value="{if $enterprises->financing_semester_qtd}{$enterprises->financing_semester_qtd}{/if}" class="form-control integer">
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <input name='financing_keys_qtd' id='financing_keys_qtd' value="{if $enterprises->financing_keys_qtd}{$enterprises->financing_keys_qtd}{/if}" class="form-control integer">
                                </div>                                    
                            </div>

                            <div class='row'>
                                <div class="col-sm-12 col-md-1 ">
                                    <label class="control-label" >{$_L['module imobles financing value']}</label>
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <input name='financing_input_value' id='financing_input_value' value="{if $enterprises->financing_input_value}{number_format($enterprises->financing_input_value,2,$_c['dec_point'],$_c['thousands_sep'])}{/if}" class="form-control value">
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <input name='financing_signal_value' id='financing_signal_value' value="{if $enterprises->financing_signal_value}{number_format($enterprises->financing_signal_value,2,$_c['dec_point'],$_c['thousands_sep'])}{/if}" class="form-control value">
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <input name='financing_monthly_value' id='financing_monthly_value' value="{if $enterprises->financing_monthly_value}{number_format($enterprises->financing_monthly_value,2,$_c['dec_point'],$_c['thousands_sep'])}{/if}" class="form-control value">
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <input name='financing_semester_value' id='financing_semester_value' value="{if $enterprises->financing_semester_value}{number_format($enterprises->financing_semester_value,2,$_c['dec_point'],$_c['thousands_sep'])}{/if}" class="form-control value">
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <input name='financing_keys_value' id='financing_keys_value' value="{if $enterprises->financing_keys_value}{number_format($enterprises->financing_keys_value,2,$_c['dec_point'],$_c['thousands_sep'])}{/if}" class="form-control value">
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <input name='financing_financed_value' id='financing_financed_value' value="{if $enterprises->financing_financed_value}{number_format($enterprises->financing_financed_value,2,$_c['dec_point'],$_c['thousands_sep'])}{/if}" class="form-control value">
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <input name='financing_total_value' id='financing_total_value' value="{if $enterprises->financing_total_value}{number_format($enterprises->financing_total_value,2,$_c['dec_point'],$_c['thousands_sep'])}{/if}" class="form-control value">
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <input name='financing_founding_value' id='financing_founding_value' value="{if $enterprises->financing_founding_value}{number_format($enterprises->financing_founding_value,2,$_c['dec_point'],$_c['thousands_sep'])}{/if}" class="form-control value" readonly="true">
                                </div>                                    
                                <div class="col-sm-12 col-md-1 ">
                                    <input name='financing_total_calculated_value' id='financing_total_calculated_value' value="{if $enterprises->financing_total_calculated_value}{number_format($enterprises->financing_total_calculated_value,2,$_c['dec_point'],$_c['thousands_sep'])}{/if}" class="form-control value" readonly="true">
                                </div>
                                <div class="col-sm-12 col-md-1 " id="divFinancingDiff">
                                    <input name='financing_difference_value' id='financing_difference_value' value="{if $enterprises->financing_difference_value}{number_format($enterprises->financing_difference_value,2,$_c['dec_point'],$_c['thousands_sep'])}{/if}" class="form-control value" readonly="true">
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <button type="button" class="btn btn-primary" id="financing_calculate">
                                        {$_L['module imobles financing calculate']}
                                    </button>
                                </div>
                            </div>

                            <div class='row'>
                                <div class="col-sm-12 col-md-1 ">
                                    <label class="control-label" >{$_L['module imobles financing percent']}</label>
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <input name='value_input_porcentage' id='value_input_porcentage' value="{if $enterprises->value_input_porcentage}{number_format($enterprises->value_input_porcentage,6,$_c['dec_point'],$_c['thousands_sep'])}{/if}" class="form-control porcentage6" readonly="true">
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <input name='value_signal_porcentage' id='value_signal_porcentage' value="{if $enterprises->value_signal_porcentage}{number_format($enterprises->value_signal_porcentage,6,$_c['dec_point'],$_c['thousands_sep'])}{/if}" class="form-control porcentage6" readonly="true">
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <input name='value_installment_porcentage' id='value_installment_porcentage' value="{if $enterprises->value_installment_porcentage}{number_format($enterprises->value_installment_porcentage,6,$_c['dec_point'],$_c['thousands_sep'])}{/if}" class="form-control porcentage6" readonly="true">
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <input name='value_semester_porcentage' id='value_semester_porcentage' value="{if $enterprises->value_semester_porcentage}{number_format($enterprises->value_semester_porcentage,6,$_c['dec_point'],$_c['thousands_sep'])}{/if}" class="form-control porcentage6" readonly="true">
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <input name='value_keys_porcentage' id='value_keys_porcentage' value="{if $enterprises->value_keys_porcentage}{number_format($enterprises->value_keys_porcentage,6,$_c['dec_point'],$_c['thousands_sep'])}{/if}" class="form-control porcentage6" readonly="true">
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <input name='value_financed_porcentage' id='value_financed_porcentage' value="{if $enterprises->value_financed_porcentage}{number_format($enterprises->value_financed_porcentage,6,$_c['dec_point'],$_c['thousands_sep'])}{/if}" class="form-control porcentage6" readonly="true">
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <input name='value_total_porcentage' id='value_total_porcentage' value="{if $enterprises->value_total_porcentage}{number_format($enterprises->value_total_porcentage,6,$_c['dec_point'],$_c['thousands_sep'])}{/if}" class="form-control porcentage6" readonly="true">
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <input name='value_founding_porcentage' id='value_founding_porcentage' value="{if $enterprises->value_founding_porcentage}{number_format($enterprises->value_founding_porcentage,6,$_c['dec_point'],$_c['thousands_sep'])}{/if}" class="form-control porcentage6" readonly="true">
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                </div>
                                <div class="col-sm-12 col-md-1 ">
                                    <input name='value_difference_porcentage' id='value_difference_porcentage' value="{if $enterprises->value_difference_porcentage}{number_format($enterprises->value_difference_porcentage,6,$_c['dec_point'],$_c['thousands_sep'])}{/if}" class="form-control porcentage6" readonly="true">
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-sm-12 col-md-2 ">
                                    <label class="control-label" >
                                        % {$_L['module imobles discount know']} 
                                    </label>
                                    <input name='discount' value="{if $enterprises->discount}{number_format($enterprises->discount,2,$_c['dec_point'],$_c['thousands_sep'])}{/if} " class="form-control value">
                                </div>   
                            </div>


                                                                           
                                <div class="row">
                                    <div class="col-xs-12 div_form">  <h2> {$_L['Google']}</h2> </div>
                                     <div class="col-xs-12 col-md-12">          
                                        <div class="margin-10px">              
                                            <label  class="control-label" for="enterprise_google_place">{$_L['module imobles enterprise google_place']}</label>   
                                            <select class="form-control"  id="enterprise_google_place" name="google_place_id">
                        {*                        <option value="">{$_L['Select']}</option> *}
                                                {if isset($enterprises->google_place_id) && $enterprises->google_place_id != ""}
                                                <option value="{$enterprises->google_place_id}">{$enterprises->google_place_id}</option>  
                                                {/if}
                                            </select>  
                                        </div>       
                                    </div>
                                     <div class="col-sm-12 col-md-6 ">
                                         <label class="control-label" >
                                             {if $enterprises->link_google}
                                             <a href="{$enterprises->link_google}" target="_blank"><icon class='fa fa-link'></icon>{$_L['module imobles link google']}</a> 
                                             {else}
                                             {$_L['module imobles link google']}
                                             {/if}
                                         </label>
                                         <input name='link_google' id="link_google" value="{$enterprises->link_google}" class="form-control">
                                     </div>
                                     <div class="col-sm-12 col-md-3 ">
                                         <label class="control-label" >
                                             {$_L['module imobles phone']} 
                                         </label>
                                         <input name='phone' id="phone" value="{$enterprises->phone}" class="form-control phone">
                                     </div>   

                                     <div class="col-sm-12 col-md-3 ">
                                         <label class="control-label" >
                                             {$_L['module imobles site']} 
                                         </label>
                                         <input name='site' id="site" value="{$enterprises->site}" class="form-control">
                                     </div>   
                                     <div class="col-sm-12 col-md-6 ">
                                        <label class="control-label" >
                                            {$_L['module imobles latitude']} 
                                        </label>
                                        <input name='latitude' id="latitude" value="{$enterprises->latitude}" class="form-control">
                                    </div>
                                    <div class="col-sm-12 col-md-6 ">
                                        <label class="control-label" >
                                            {$_L['module imobles longitude']} 
                                        </label>
                                        <input name='longitude' id="longitude" value="{$enterprises->longitude}" class="form-control">
                                    </div>
                                </div>
                                    
                                <!-- Campos relacionados com Google Place -->
                                <input type="hidden" name='google_geometry' id="google_geometry" value='{if isset($enterprises->google_geometry)}{$enterprises->google_geometry}{/if}'>
                                <input type="hidden" name='google_plus_code' id="google_plus_code" value='{if isset($enterprises->google_plus_code)}{$enterprises->google_plus_code}{/if}'>
                                <input type="hidden" name='google_rating' id="google_rating" value='{if isset($enterprises->google_rating)}{$enterprises->google_rating}{/if}'>
                                <input type="hidden" name='google_reference' id="google_reference" value='{if isset($enterprises->google_reference)}{$enterprises->google_reference}{/if}'>
                                <input type="hidden" name='google_reviews' id="google_reviews" value='{if isset($enterprises->google_reviews)}{$enterprises->google_reviews}{/if}'>
                                <input type="hidden" name='google_user_ratings_total' id="google_user_ratings_total" value='{if isset($enterprises->google_user_ratings_total)}{$enterprises->google_user_ratings_total}{/if}'>
                                <input type="hidden" name='google_json' id="google_json" value='{if isset($enterprises->google_json)}{$enterprises->google_json}{/if}'>
     

                                <div class='row ' id="div_zip">
                                    <div class="col-xs-12 div_form">  <h2> {$_L['Address']}</h2> </div>

                                    <div class="col-md-12 col-sm-12 col-xs-12">
                                        <label class="control-label" for="address">{$_L['Address']}</label>
                                        <input type="text" id="address_log"  onFocus="geolocate()" autocomplete="nope" name="address_log"  value='{$enterprises->address_log}' class="form-control" maxlength="100"/>
                                    </div>

                                    <div class="col-md-4 col-sm-12 col-xs-12">
                                        <label class="control-label">{$_L['Neighborhood']}</label>
                                        <input type="text" id="address_neighborhood" name="address_neightborhood" value='{$enterprises->address_neightborhood}' class="form-control" maxlength="100"/>
                                    </div>

                                    <div class="col-md-2 col-sm-12 col-xs-12">
                                        <label class="control-label">{$_L['Number']}</label>
                                        <input type="text" id="address_number" name="address_number" value="{$enterprises->address_number}" class="form-control" maxlength="100"/>
                                    </div> 
                                    <div class="col-md-6 col-sm-12 col-xs-12">
                                        <label class="control-label">{$_L['Complement']}</label>
                                        <input type="text" id="address_complement" name="address_complement" value='{$enterprises->address_complement}' class="form-control" maxlength="100"/>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-3 col-sm-12 col-xs-12">
                                        <label class="control-label" for="address_zip">{$_L['ZIP Postal Code']} </label>
                                        <input type="text"  value="{$enterprises->address_zip}"  id="address_zip" name="address_zip" class="cep form-control">
                                    </div>


                                    <div class="col-md-4 col-sm-12 col-xs-12">
                                        <label class="control-label" for="state">{$_L['State Region']}</label>
                                        <select name="address_state_id" id="address_state_id" class="form-control" style="width:100%">
                                            <option value="">{$_L['Select State']}</option>
                                            {foreach $state as $s}
                                                <option {if $enterprises->address_state_id==$s['id']}selected{/if} value="{$s['id']}">{$s['state_name']}</option>
                                            {/foreach}
                                        </select>
                                    </div>                 

                                    <div class="col-md-5 col-sm-12 col-xs-12">
                                        <label class=" control-label" id="label_cidade" for="city">{$_L['City']}</label>
                                        <select data-value='{$enterprises->address_city_id}' name="address_city_id" id="address_city_id" class="form-control" style="width:100%">
                                        </select>
                                    </div>   

                                </div>


                                <div class='row '>
                                    <div class="col-xs-12 div_form">  <h2> {$_L['module imobles Address dec']}</h2> </div>
                                    <div class="col-md-12 col-sm-12 col-xs-12">
                                        <label class="control-label" for="dec_address_log">{$_L['Address']}</label>
                                        <input type="text" id="dec_address_log"  onFocus="geolocateDC()" autocomplete="nope" name="dec_address_log"  value='{$enterprises->dec_address_log}' class="form-control" maxlength="100"/>
                                    </div>


                                    <div class="col-md-4 col-sm-12 col-xs-12">
                                        <label class="control-label">{$_L['Neighborhood']}</label>
                                        <input type="text" id="dec_address_neighborhood" name="dec_address_neightborhood" value='{$enterprises->dec_address_neightborhood}' class="form-control" maxlength="100"/>
                                    </div>

                                    <div class="col-md-2 col-sm-12 col-xs-12">
                                        <label class="control-label">{$_L['Number']}</label>
                                        <input type="text" id="dec_address_number" name="dec_address_number" value="{$enterprises->dec_address_number}" class="form-control" maxlength="100"/>
                                    </div> 

                                    <div class="col-md-6 col-sm-12 col-xs-12">
                                        <label class="control-label">{$_L['Complement']}</label>
                                        <input type="text" id="dec_address_complement" name="dec_address_complement" value='{$enterprises->dec_address_complement}' class="form-control" maxlength="100"/>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-3 col-sm-12 col-xs-12">
                                        <label class="control-label" for="dec_address_zip">{$_L['ZIP Postal Code']} </label>
                                        <input type="text"  value="{$enterprises->dec_address_zip}"  id="dec_address_zip" name="dec_address_zip" class="cep form-control">
                                    </div>


                                    <div class="col-md-4 col-sm-12 col-xs-12">
                                        <label class="control-label" for="dec_address_state_id">{$_L['State Region']}</label>
                                        <select name="dec_address_state_id" id="dec_address_state_id" class="form-control" style="width:100%">
                                            <option value="">{$_L['Select State']}</option>
                                            {foreach $state as $s}
                                                <option {if $enterprises->dec_address_state_id==$s['id']}selected{/if} value="{$s['id']}">{$s['state_name']}</option>
                                            {/foreach}
                                        </select>
                                    </div>                 

                                    <div class="col-md-5 col-sm-12 col-xs-12">
                                        <label class=" control-label" id="label_cidade" for="dec_address_city_id">{$_L['City']}</label>
                                        <select data-value='{$enterprises->dec_address_city_id}' name="dec_address_city_id" id="dec_address_city_id" class="form-control" style="width:100%">
                                        </select>
                                    </div>   
                                </div>
                                
                                <div class='row'>
                                    <div class="col-xs-12 div_form">  <h2> {$_L['module imobles tech']}</h2> </div>
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles company_construction unitclass']} {$_L['*']}
                                        </label>
                                        <input name='csv_translator_class' value="{$enterprises->csv_translator_class}" class="form-control">
                                    </div>
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles enterprise unitmethod']} {$_L['*']}
                                        </label>
                                        <input name='csv_translator_method' value="{$enterprises->csv_translator_method}" class="form-control">
                                    </div>
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles relevance']}
                                        </label>
                                        <input type="number" name='relevance' value="{if isset($enterprises->relevance)}{$enterprises->relevance}{/if}" class="form-control">
                                    </div>
                                    {if isset($enterprises->id)}
                                        <div class="col-sm-12 col-md-12 ">
                                            <label class="control-label" >
                                                {$_L['module imobles enterprise site_url']}
                                            </label>
                                            <input name='site_url' value="{$enterprises->site_url}" class="form-control">
                                        </div>
                                    {/if}
                                </div>
                            </div>  
                                        
                            
                            <!-- ABA PARA INCLUIR OS DADOS DO HOTSITE -->
                            <div id="hotsite" class="tab-pane fade in">

                                <div class="row">
                                    
                                    <div class="col-md-3 col-sm-12 col-xs-12">  
                                        <label class=" control-label" >{$_L['module imobles hotsite development_enabled']} {$_L['*']}</label>
                                        <input type="checkbox" {if isset($enterprises->hotsite_params->development_hotsite_enabled)  && $enterprises->hotsite_params->development_hotsite_enabled ==1}checked{/if} data-toggle="toggle" data-size="small" data-on="{$_L['Yes']}" data-off="{$_L['No']}" id="development_hotsite_enabled" name="hotsite[development_hotsite_enabled]" value="1">     
                                    </div>
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles hotsite development_title']} {$_L['*']}
                                        </label>
                                        <input name='hotsite[development_title]' value="{if isset($enterprises->hotsite_params->development_title)}{$enterprises->hotsite_params->development_title}{/if}" class="form-control">
                                    </div>
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles hotsite development_subtitle']} {$_L['*']}
                                        </label>
                                        <input name='hotsite[development_subtitle]' value="{if isset($enterprises->hotsite_params->development_subtitle)}{$enterprises->hotsite_params->development_subtitle}{/if}" class="form-control">
                                    </div>
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles hotsite floor_plant_title']} {$_L['*']}
                                        </label>
                                        <input name='hotsite[floor_plant_title]' value="{if isset($enterprises->hotsite_params->floor_plant_title)}{$enterprises->hotsite_params->floor_plant_title}{/if}" class="form-control">
                                    </div>
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles hotsite amenities_title']} {$_L['*']}
                                        </label>
                                        <input name='hotsite[amenities_title]' value="{if isset($enterprises->hotsite_params->amenities_title)}{$enterprises->hotsite_params->amenities_title}{/if}" class="form-control">
                                    </div>
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles hotsite amenities_subtitle']} {$_L['*']}
                                        </label>
                                        <input name='hotsite[amenities_subtitle]' value="{if isset($enterprises->hotsite_params->amenities_subtitle)}{$enterprises->hotsite_params->amenities_subtitle}{/if}" class="form-control">
                                    </div>
                                    
                                    
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles hotsite amenities_bullet_01_title']} {$_L['*']}
                                        </label>
                                        <input name='hotsite[amenities_bullet_01_title]' value="{if isset($enterprises->hotsite_params->amenities_bullet_01_title)}{$enterprises->hotsite_params->amenities_bullet_01_title}{/if}" class="form-control">
                                    </div>
                                    
                                    
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles hotsite amenities_bullet_01_subtitle']} {$_L['*']}
                                        </label>
                                        <input name='hotsite[amenities_bullet_01_subtitle]' value="{if isset($enterprises->hotsite_params->amenities_bullet_01_subtitle)}{$enterprises->hotsite_params->amenities_bullet_01_subtitle}{/if}" class="form-control">
                                    </div>
                                    
                                    
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles hotsite amenities_bullet_02_title']} {$_L['*']}
                                        </label>
                                        <input name='hotsite[amenities_bullet_02_title]' value="{if isset($enterprises->hotsite_params->amenities_bullet_02_title)}{$enterprises->hotsite_params->amenities_bullet_02_title}{/if}" class="form-control">
                                    </div>
                                    
                                    
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles hotsite amenities_bullet_02_subtitle']} {$_L['*']}
                                        </label>
                                        <input name='hotsite[amenities_bullet_02_subtitle]' value="{if isset($enterprises->hotsite_params->amenities_bullet_02_subtitle)}{$enterprises->hotsite_params->amenities_bullet_02_subtitle}{/if}" class="form-control">
                                    </div>
                                    
                                    
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles hotsite amenities_bullet_03_title']} {$_L['*']}
                                        </label>
                                        <input name='hotsite[amenities_bullet_03_title]' value="{if isset($enterprises->hotsite_params->amenities_bullet_03_title)}{$enterprises->hotsite_params->amenities_bullet_03_title}{/if}" class="form-control">
                                    </div>
                                    
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles hotsite amenities_bullet_03_subtitle']} {$_L['*']}
                                        </label>
                                        <input name='hotsite[amenities_bullet_03_subtitle]' value="{if isset($enterprises->hotsite_params->amenities_bullet_03_subtitle)}{$enterprises->hotsite_params->amenities_bullet_03_subtitle}{/if}" class="form-control">
                                    </div>
                                    
                                    
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles hotsite amenities_bullet_04_title']} {$_L['*']}
                                        </label>
                                        <input name='hotsite[amenities_bullet_04_title]' value="{if isset($enterprises->hotsite_params->amenities_bullet_04_title)}{$enterprises->hotsite_params->amenities_bullet_04_title}{/if}" class="form-control">
                                    </div>
                                    
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles hotsite amenities_bullet_04_subtitle']} {$_L['*']}
                                        </label>
                                        <input name='hotsite[amenities_bullet_04_subtitle]' value="{if isset($enterprises->hotsite_params->amenities_bullet_04_subtitle)}{$enterprises->hotsite_params->amenities_bullet_04_subtitle}{/if}" class="form-control">
                                    </div>
                                    
                                    
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles hotsite amenities_bullet_05_title']} {$_L['*']}
                                        </label>
                                        <input name='hotsite[amenities_bullet_05_title]' value="{if isset($enterprises->hotsite_params->amenities_bullet_05_title)}{$enterprises->hotsite_params->amenities_bullet_05_title}{/if}" class="form-control">
                                    </div>
                                    
                                    
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles hotsite amenities_bullet_05_subtitle']} {$_L['*']}
                                        </label>
                                        <input name='hotsite[amenities_bullet_05_subtitle]' value="{if isset($enterprises->hotsite_params->amenities_bullet_05_subtitle)}{$enterprises->hotsite_params->amenities_bullet_05_subtitle}{/if}" class="form-control">
                                    </div>
                                    
                                    
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles hotsite amenities_bullet_06_title']} {$_L['*']}
                                        </label>
                                        <input name='hotsite[amenities_bullet_06_title]' value="{if isset($enterprises->hotsite_params->amenities_bullet_06_title)}{$enterprises->hotsite_params->amenities_bullet_06_title}{/if}" class="form-control">
                                    </div>
                                    
                                    
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles hotsite amenities_bullet_06_subtitle']} {$_L['*']}
                                        </label>
                                        <input name='hotsite[amenities_bullet_06_subtitle]' value="{if isset($enterprises->hotsite_params->amenities_bullet_06_subtitle)}{$enterprises->hotsite_params->amenities_bullet_06_subtitle}{/if}" class="form-control">
                                    </div>
                                    
                                    
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles hotsite location_title']} {$_L['*']}
                                        </label>
                                        <input name='hotsite[location_title]' value="{if isset($enterprises->hotsite_params->location_title)}{$enterprises->hotsite_params->location_title}{/if}" class="form-control">
                                    </div>
                                    
                                    
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles hotsite location_subtitle']} {$_L['*']}
                                        </label>
                                        <input name='hotsite[location_subtitle]' value="{if isset($enterprises->hotsite_params->location_subtitle)}{$enterprises->hotsite_params->location_subtitle}{/if}" class="form-control">
                                    </div>
                                    
                                    
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles hotsite color_01']} {$_L['*']}
                                        </label>
                                        <input name='hotsite[color_01]' value="{if isset($enterprises->hotsite_params->color_01)}{$enterprises->hotsite_params->color_01}{/if}" class="form-control">
                                    </div>
                                    
                                    
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles hotsite color_02']} {$_L['*']}
                                        </label>
                                        <input name='hotsite[color_02]' value="{if isset($enterprises->hotsite_params->color_02)}{$enterprises->hotsite_params->color_02}{/if}" class="form-control">
                                    </div>
                                    
                                    
                                    <div class="col-sm-12 col-md-12 ">
                                        <label class="control-label" >
                                            {$_L['module imobles hotsite color_03']} {$_L['*']}
                                        </label>
                                        <input name='hotsite[color_03]' value="{if isset($enterprises->hotsite_params->color_03)}{$enterprises->hotsite_params->color_03}{/if}" class="form-control">
                                    </div>
                                   
                                </div>
                            </div>  

                              <!-- ANEXOS -->
                            <div id='towers' class="tab-pane fade">   
                                <div class="row">

                                    <div class="col-sm-12 col-md-12 col-xs-12">

                                        <div class="row">
                                            <div class="table-responsive m-t">
                                                <table class="table" id="enterprise_towers_items">
                                                    <thead>
                                                        <tr>
                                                            <th>{$_L['Name']}</th>
                                                            <th> {$_L['module imobles stage']} </th>
                                                            <th> {$_L['module imobles entreprise date delivery'] } </th>
                                                            <th class="col-md-2 ">{$_L['module imobles floors number']}
                                                            </th> 
                                                            <th class="col-md-1 ">
                                                            </th> 
                                                        </tr>
                                                    </thead>
                                                    <tbody id="body-enterprise_towerss">
                                                        {foreach $enterpriseTorers as $item}

                                                            <tr class="itm_nm_ftura ">
                                                                <td class="middle">
                                                                    <input type="hidden" id="enterprise_towers_id_{$rowNumTowers}" name="enterprise_towers_id[]" value="{$item->id}" >
                                                                    <input type="text" maxlength="100" class="form-control" id="enterprise_towers_title_{$rowNumTowers}" name="enterprise_towers_title[]" value="{$item->title}" >
                                                                </td> 
                                                                <td>
                                                                    <select name="enterprise_towers_stage[]"  class="form-control ">
                                                                        <option value=""> {$_L['Select']}</option>
                                                                        <option value="In Works" {if $item->stage=='In Works'}selected{/if}> {$_L['In Works']}</option>
                                                                        <option value="Ready to move in" {if $item->stage=='Ready to move in'}selected{/if}> {$_L['Ready to move in']}</option>
                                                                        <option value="Lauch" {if $item->stage=='Lauch'}selected{/if}> {$_L['Lauch']}</option>
                                                                        <option value="Pre Launch" {if $item->stage=='Pre Launch'}selected{/if}> {$_L['Pre Launch']}</option>
                                                                    </select>
                                                                </td>
                                                                <td>
                                                                    <input type="text" class="form-control date"  name="enterprise_towers_date_delivery[]" datepicker
                                                                           data-date-format="{$_c['formatDate']}" data-auto-close="true"
                                                                           value="{if not empty($item->date_delivery)}{date( $_c['df'], strtotime($item->date_delivery))}{/if}">

                                                                </td>
                                                                <td class="middle">
                                                                    <input type="text"  class="form-control"  value="{$item->floors}" class="form-control  integer" name="enterprise_towers_floors[]">
                                                                </td>
                                                                <td class="middle col-xs-1"> 
                                                                    <span class="btn btn-danger btn-xs delete_enterprise_towers" data-row="{$rowNumTowers++}" data-enterprise_towers-id="{$item->id}"><i class="fa fa-trash"></i> </span>
                                                                </td>
                                                            </tr>
                                                        {/foreach}
                                                        {if $rowNumTowers==0}
                                                            {*    <tr class="itm_nm_ftura ">
                                                            <td class="middle">
                                                            <input type="hidden" id="enterprise_towers_id_{$rowNumTowers}" name="enterprise_towers_id[]" value="" >
                                                            <input type="text" class="form-control" id="enterprise_towers_title_{$rowNumTowers}" name="enterprise_towers_title[]" value="" >
                                                            </td>                                                         
                                                            <td class="middle">
                                                            <input type="text"  class="form-control"   value="" class="form-control  integer" name="enterprise_towers_floors[]">
                                                            </td>
                                                            <td class="middle col-xs-1"> 
                                                            <span class="btn btn-danger btn-xs delete_enterprise_towers" data-row="{$rowNumTowers++}" data-enterprise_towers-id="0"><i class="fa fa-trash"></i> </span>
                                                            </td>
                                                            </tr>*}
                                                        {/if}
                                                    </tbody>
                                                </table>

                                                <input id="rowNumTowers" type="hidden" value="{$rowNumTowers}">
                                            </div>
                                        </div>

                                    </div>

                                </div>
                                <div class="row">
                                    <button type="button" class="btn btn-primary" id="towers-add"><i class="fa fa-plus"></i> {$_L['module imobles towers add']}
                                    </button>
                                </div>

                            </div>
                        </div>
                        <div class="row" style="margin-top:20px">
                            <div class=" col-md-12 form-group">
                                <div class="col-lg-10">
                                    <a href="#" class="md-btn md-btn-primary waves-effect waves-light" id="submit_entreprise">
                                        <i class="fa fa-check"></i> {$_L['Submit']}
                                    </a>
                                    {if   $typeForm!='modal'}
                                        | <a href="{$_url}module_imobles/enterprises/listAll">{$_L['Or Cancel']}</a>
                                    {/if}

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

            </div>



        </div>

        </form>

    </div>

</div>
<div id="option_stage" class="hidden hide">
    <option value="In Works" selected> {$_L['In Works']}</option>
    <option value="Ready to move in" > {$_L['Ready to move in']}</option>
    <option value="Lauch"> {$_L['Lauch']}</option>
    <option value="Pre Launch"> {$_L['Pre Launch']}</option>
</div>
<input type="hidden" id="type_form" value="{$typeForm}">
<input type="hidden"  id="_msg_select_city" value="{$_L['module imobles Select city']}">
<input type="hidden" name="_msg_add_new_enterprise_standard" id="_msg_add_new_enterprise_standard" value="{$_L['module imobles new enterprise_standard']}">
<input type="hidden" name="_msg_enterprise_standard_name" id="_msg_enterprise_standard_name" value="{$_L['module imobles enterprise_standard name']}">
<input type="hidden" name="_msg_add_new_enterprise_amenities" id="_msg_add_new_enterprise_amenities" value="{$_L['module imobles new enterprise_amenities']}">
<input type="hidden" name="_msg_enterprise_amenities_name" id="_msg_enterprise_amenities_name" value="{$_L['module imobles enterprise_amenities name']}">
<input type="hidden" name="_msg_edit" id="_msg_edit" value="{$_L['Edit']}">
<input type="hidden" name="_msg_ok" id="_msg_ok" value="{$_L['OK']}">
<input type="hidden" name="_msg_cancel" id="_msg_cancel" value="{$_L['Cancel']}">
<input type="hidden" name="_msg_save" id="_msg_save" value="{$_L['Save']}">
<input type="hidden" name="_msg_saved" id="_msg_saved" value="{$_L['Add Successfull']}">


{literal}
    <script>
        // This example displays an address form, using the autocomplete feature
        // of the Google Places API to help users fill in the information.

        // This example requires the Places library. Include the libraries=places
        // parameter when you first load the API. For example:
        // <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places">

        var placeSearch, autocomplete, dec_autocomplete;
        var componentForm = {
            number: 'short_name',
            route: 'long_name',
            locality: 'long_name',
            administrative_area_level_1: 'short_name',
            country: 'long_name',
            zip: 'short_name'
        };

        function initAutocomplete() {
            // Create the autocomplete object, restricting the search to geographical
            // location types.
            autocomplete = new google.maps.places.Autocomplete(
                    /** @type {!HTMLInputElement} */(document.getElementById('address_log')),
                    {types: ['geocode']});

            // When the user selects an address from the dropdown, populate the address
            // fields in the form.
            autocomplete.addListener('place_changed', fillInAddress);

            dec_autocomplete = new google.maps.places.Autocomplete(
                    /** @type {!HTMLInputElement} */(document.getElementById('dec_address_log')),
                    {types: ['geocode']});

            // When the user selects an address from the dropdown, populate the address
            // fields in the form.
            dec_autocomplete.addListener('place_changed', fillInAddressDC);
        }

        function fillInAddress() {
            // Get the place details from the autocomplete object.
            var place = autocomplete.getPlace();
            var city = "";
            var state = "";


            jQuery('#address_neighborhood').val("");
            jQuery('#address_number').val("");
            jQuery('#address_zip').val("");
            // Get each component of the address from the place details
            // and fill the corresponding field on the form.
            for (var i = 0; i < place.address_components.length; i++) {
                var addressType = place.address_components[i].types[0];

                console.log(addressType + " = " + place.address_components[i]['short_name']);
                switch (place.address_components[i].types[0]) {
                    case 'locality':
                    case 'sublocality_level_1':
                        jQuery('#address_neighborhood').val(place.address_components[i]['long_name']);
                        break;
                    case 'route':
                        jQuery('#address_log').val(place.address_components[i]['long_name']);
                        break;
                    case 'administrative_area_level_2':
                        city = place.address_components[i]['long_name'];

                        break;
                    case 'administrative_area_level_1':
                        state = place.address_components[i]['short_name'];
                        break;
                    case 'street_number':
                        jQuery('#address_number').val(place.address_components[i]['short_name']);
                        break;
                    case 'postal_code':
                        jQuery('#address_zip').val(place.address_components[i]['short_name']);
                        break;
                }


            }

            //tratamento dos dados de estado e cidade
            $.get($("#_url").val() + 'ajax/state-by-uf/' + state, function (j) {
                console.log(city);
                jQuery('#address_state_id').val(j).trigger("change");
                $.getJSON($("#_url").val() + 'ajax/city', {state_id: j}, function (j) {
                    // var options = '<option value="city">' + $('#state_id').val() + '</option>';
                    //                  var options = '<option value="city">' + $('#state_id').find('option:first-child').text() + '</option>';
                    var options = '';
                    for (var i = 0; i < j.length; i++) {
                        if (j[i].city_name != city) {
                            options += '<option value="' + j[i].id + '">' + j[i].city_name + '</option>';
                        } else {
                            options += '<option selected value="' + j[i].id + '">' + j[i].city_name + '</option>';
                        }
                    }
                    $('#address_city_id').select2("destroy");
                    $('#address_city_id').html(options);
                    $('#address_city_id').select2({theme: "bootstrap",
                        width: '100%'});

                });

            });


        }

        // Bias the autocomplete object to the user's geographical location,
        // as supplied by the browser's 'navigator.geolocation' object.
        function geolocate() {
            if (navigator.geolocation) {
                navigator.geolocation.getCurrentPosition(function (position) {
                    var geolocation = {
                        lat: position.coords.latitude,
                        lng: position.coords.longitude
                    };
                    var circle = new google.maps.Circle({
                        center: geolocation,
                        radius: position.coords.accuracy
                    });
                    autocomplete.setBounds(circle.getBounds());
                });
            }
        }

        //  DECORATOR

        function fillInAddressDC() {
            // Get the place details from the autocomplete object.
            var place = dec_autocomplete.getPlace();
            var city = "";
            var state = "";


            jQuery('#dec_address_neighborhood').val("");
            jQuery('#dec_address_number').val("");
            jQuery('#dec_address_zip').val("");
            // Get each component of the address from the place details
            // and fill the corresponding field on the form.
            for (var i = 0; i < place.address_components.length; i++) {
                var addressType = place.address_components[i].types[0];

                console.log(addressType + " = " + place.address_components[i]['short_name']);
                switch (place.address_components[i].types[0]) {
                    case 'locality':
                    case 'sublocality_level_1':
                        jQuery('#dec_address_neighborhood').val(place.address_components[i]['short_name']);
                        break;
                    case 'route':
                        jQuery('#dec_address_log').val(place.address_components[i]['long_name']);
                        break;
                    case 'administrative_area_level_2':
                        city = place.address_components[i]['long_name'];

                        break;
                    case 'administrative_area_level_1':
                        state = place.address_components[i]['short_name'];
                        break;
                    case 'street_number':
                        jQuery('#dec_address_number').val(place.address_components[i]['short_name']);
                        break;
                    case 'postal_code':
                        jQuery('#dec_address_zip').val(place.address_components[i]['short_name']);
                        break;
                }


            }

            //tratamento dos dados de estado e cidade
            $.get($("#_url").val() + 'ajax/state-by-uf/' + state, function (j) {
                console.log(city);
                jQuery('#dec_address_state_id').val(j).trigger("change");
                $.getJSON($("#_url").val() + 'ajax/city', {state_id: j}, function (j) {
                    // var options = '<option value="city">' + $('#state_id').val() + '</option>';
//                    var options = '<option value="city">' + $('#state_id').find('option:first-child').text() + '</option>';
                    var options = '';
                    for (var i = 0; i < j.length; i++) {
                        if (j[i].city_name != city) {
                            options += '<option value="' + j[i].id + '">' + j[i].city_name + '</option>';
                        } else {
                            options += '<option selected value="' + j[i].id + '">' + j[i].city_name + '</option>';
                        }
                    }
                    $('#dec_address_city_id').select2("destroy");
                    $('#dec_address_city_id').html(options);
                    $('#dec_address_city_id').select2({theme: "bootstrap",
                        width: '100%'});

                });

            });


        }

        // Bias the autocomplete object to the user's geographical location,
        // as supplied by the browser's 'navigator.geolocation' object.
        function geolocateDC() {
            if (navigator.geolocation) {
                navigator.geolocation.getCurrentPosition(function (position) {
                    var geolocation = {
                        lat: position.coords.latitude,
                        lng: position.coords.longitude
                    };
                    var circle = new google.maps.Circle({
                        center: geolocation,
                        radius: position.coords.accuracy
                    });
                    dec_autocomplete.setBounds(circle.getBounds());
                });
            }
        }
    </script>
    <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBNGUI-PaiX1K_Kkab5ctQ6NXFOX1ZClXY&libraries=places&callback=initAutocomplete"
    async defer></script>
{/literal}

Anon7 - 2022
AnonSec Team