Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="row">
- <h4 class="txt-ondeestamos">Atualmente a nossa Matriz esta localizada em Minas Gerais e possuímos filiais nos Estados de São Paulo, Goiás, Ceará e Pará. Selecione o Estado abaixo e veja a localização de cada uma de nossas unidades.</h4>
- <div class="col-md-6">
- <div id="regions_div" style="width: 750px; height: 500px;"></div>
- </div>
- <div class="col-md-6 feature">
- <h4 style="color:#162A75">Selecione uma de nossas <br><b style="color:#162A75">5 unidades</b>, e solicite um</h3>
- <p><b style="background-color:#162A75;color:white;font-size:1.5em">Fale Conosco</b></p><br>
- <h4>Unidades em <span id="estado"></span>:<h4>
- <div id="dadosLojas" style="overflow-y: scroll; height:200px;">
- </div>
- </div>
- </div>
- </div>
- <?php include("footer.php") ?>
- <script type="text/javascript" src="js/loader.js"></script>
- <script type="text/javascript" src="js/jsapi.js"></script>
- <script type="text/javascript">
- google.charts.load('current', {'packages':['geochart']});
- google.charts.setOnLoadCallback(drawRegionsMap);
- function drawRegionsMap() {
- var data = google.visualization.arrayToDataTable([
- ['Country'],
- ['Brazil'],
- ['Acre'],
- ['Alagoas'],
- ['Amapa'],
- ['Amazonas'],
- ['Bahia'],
- ['Ceara'],
- ['Distrito Federal'],
- ['Espirito Santo'],
- ['Goias'],
- ['Maranhao'],
- ['Mato Grosso'],
- ['Mato Grosso do Sul'],
- ['Minas Gerais'],
- ['Para'],
- ['Paraiba'],
- ['Parana'],
- ['Pernambuco'],
- ['Piaui'],
- ['Rio de Janeiro'],
- ['Rio Grande do Norte'],
- ['Rio Grande do Sul'],
- ['Rondonia'],
- ['Roraima'],
- ['Santa Catarina'],
- ['Sao Paulo'],
- ['Sergipe'],
- ['Tocantins']
- ]);
- var options = {
- region: 'BR',
- resolution: 'provinces',
- datalessRegionColor: 'white',
- defaultColor: '#cdcdcd',
- enableRegionInteractivity: true,
- };
- var chart = new google.visualization.GeoChart(document.getElementById('regions_div'));
- dicEstados = {
- '1' : 'Acre',
- '2' : 'Alagoas',
- '3' : 'Amapa',
- '4' : 'Amazonas',
- '5' : 'Bahia',
- '6' : 'Ceara',
- '7' : 'Distrito Federal',
- '8' : 'Espirito Santo',
- '9' : 'Goias',
- '10' : 'Maranhao',
- '11' : 'Mato Grosso',
- '12' : 'Mato Grosso do Sul',
- '13' : 'Minas Gerais',
- '14' : 'Para',
- '15' : 'Paraiba',
- '16' : 'Parana',
- '17' : 'Pernambuco',
- '18' : 'Piaui',
- '19' : 'Rio de Janeiro',
- '20' : 'Rio Grande do Norte',
- '21' : 'Rio Grande do Sul',
- '22' : 'Rondonia',
- '23' : 'Roraima',
- '24' : 'Santa Catarina',
- '25' : 'Sao Paulo',
- '26' : 'Sergipe',
- '27' : 'Tocantins'
- }
- unidades = {
- 'Minas Gerais':
- {
- '0' :
- {
- 'Loja' : 'Matriz - São Sebastião do Paraíso',
- 'Fone' : '(35) 3539-8150',
- 'Endereco' : 'Av. Dárcio Cantieri, nº 1750 - Jardim São José - CEP: 37950-000'
- },
- },
- 'Ceara':
- {
- '0' :
- {
- 'Loja' : 'Filial - Fortaleza',
- 'Fone' : '(85) 3211-6666',
- 'Endereco' : 'Av. Heraclito Graça, nº 395 - Centro - CEP: 60.140-061'
- },
- },
- 'Sao Paulo':
- {
- '0' :
- {
- 'Loja' : 'Filial - São Paulo',
- 'Fone' : '(11) 4083-2610',
- 'Endereco' : 'EDIFÍCIO DENVER/Av. Fagundes Filho, nº 145 – CJ 48Vila Monte Alegre - CEP: 04.304-000'
- },
- },
- 'Para':
- {
- '0' :
- {
- 'Loja' : 'Filial - Belém',
- 'Fone' : '(91) 3075-5500',
- 'Endereco' : 'Av. Assis de Vasconcelos, nº 488 – Campina - CEP: 66.017-070'
- },
- },
- 'Goias':
- {
- '0' :
- {
- 'Loja' : 'Filial - Goiânia',
- 'Fone' : '(62) 3291-5309',
- 'Endereco' : 'Endereço: Rua 29, nº 62- Quadra L18, Lote 14 Setor Oeste - CEP: 74.140-060'
- },
- }
- }
- function myClickHandler(){
- var selection = chart.getSelection();
- var message = '';
- for (var i = 0; i < selection.length; i++) {
- var item = selection[i];
- if (item.row != null && item.column != null) {
- message += '{' + item.row + ',column:' + item.column + '}';
- } else if (item.row != null) {
- message += '' + item.row + '';
- } else if (item.column != null) {
- message += '{column:' + item.column + '}';
- }
- }
- if (message == '') {
- message = 'nothing';
- }
- document.getElementById("dadosLojas").innerHTML = '';
- for(var i = 0; i < 2 ; i ++){ //Para fins de demonstracao, so existem duas lojas em cada unidade
- document.getElementById("estado").innerHTML = dicEstados[message];
- document.getElementById("dadosLojas").innerHTML +=
- '<br>Unidade: ' +
- unidades[dicEstados[message]][i]['Loja'] +
- '<br>Fone: ' +
- unidades[dicEstados[message]][i]['Fone'] +
- '<br>Endereco: '
- + unidades[dicEstados[message]][i]['Endereco'] + '<br>';
- }
- }
- google.visualization.events.addListener(chart, 'select', myClickHandler);
- chart.draw(data, options);
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement