Advertisement
contatowellington

Untitled

Oct 18th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.24 KB | None | 0 0
  1. <?php require_once('../../Connections/cartograxarpi.php'); ?>
  2. <?php
  3. // Load the common classes
  4. require_once('../../includes/common/KT_common.php');
  5.  
  6. // Load the tNG classes
  7. require_once('../../includes/tng/tNG.inc.php');
  8.  
  9. // Make a transaction dispatcher instance
  10. $tNGs = new tNG_dispatcher("../../");
  11.  
  12. // Make unified connection variable
  13. $conn_cartograxarpi = new KT_connection($cartograxarpi, $database_cartograxarpi);
  14.  
  15. //Start Restrict Access To Page
  16. $restrict = new tNG_RestrictAccess($conn_cartograxarpi, "../../");
  17. //Grand Levels: Any
  18. $restrict->Execute();
  19. //End Restrict Access To Page
  20.  
  21. // Make a logout transaction instance
  22. $logoutTransaction = new tNG_logoutTransaction($conn_cartograxarpi);
  23. $tNGs->addTransaction($logoutTransaction);
  24. // Register triggers
  25. $logoutTransaction->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "GET", "KT_logout_now");
  26. $logoutTransaction->registerTrigger("END", "Trigger_Default_Redirect", 99, "https://cartograxarpi.ibees.com.br/home.php");
  27. // Add columns
  28. // End of logout transaction instance
  29.  
  30. // Execute all the registered transactions
  31. $tNGs->executeTransactions();
  32.  
  33. // Get the transaction recordset
  34. $rscustom = $tNGs->getRecordset("custom");
  35. $row_rscustom = mysql_fetch_assoc($rscustom);
  36. $totalRows_rscustom = mysql_num_rows($rscustom);
  37. ?>
  38. <!DOCTYPE html >
  39. <head>
  40. <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
  41. <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
  42. <title>Using MySQL and PHP with Google Maps</title>
  43. <style>
  44. /* Always set the map height explicitly to define the size of the div
  45. * element that contains the map. */
  46. #map {
  47. height: 100%;
  48. }
  49. /* Optional: Makes the sample page fill the window. */
  50. html, body {
  51. height: 100%;
  52. margin: 0;
  53. padding: 0;
  54. }
  55. </style>
  56. <link href="../../includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" />
  57. <script src="../../includes/common/js/base.js" type="text/javascript"></script>
  58. <script src="../../includes/common/js/utility.js" type="text/javascript"></script>
  59. <script src="../../includes/skins/style.js" type="text/javascript"></script>
  60. </head>
  61.  
  62. <body>
  63. <div align="center"><a href="https://cartograxarpi.ibees.com.br/home.php">Home</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://cartograxarpi.ibees.com.br/home.php">Criar marcador CaRtoGrAxArP1</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  64. <?php
  65. echo $tNGs->getErrorMsg();
  66. ?>
  67. <a href="<?php echo $logoutTransaction->getLogoutLink(); ?>">Sair</a></div>
  68. <div id="map"></div>
  69. <script>
  70. var customLabel = {
  71. restaurant: {
  72. label: 'R'
  73. },
  74. bar: {
  75. label: 'B'
  76. }
  77. };
  78.  
  79. function initMap() {
  80. var map = new google.maps.Map(document.getElementById('map'), {
  81. center: new google.maps.LatLng(-3.7596517, -38.5756922),
  82. zoom: 13
  83. });
  84. var infoWindow = new google.maps.InfoWindow;
  85.  
  86. // Change this depending on the name of your PHP or XML file
  87. downloadUrl('resultado.php', function(data) {
  88. var xml = data.responseXML;
  89. var markers = xml.documentElement.getElementsByTagName('marker');
  90. Array.prototype.forEach.call(markers, function(markerElem) {
  91. var name = markerElem.getAttribute('name');
  92. var address = markerElem.getAttribute('address');
  93. var type = markerElem.getAttribute('type');
  94. var point = new google.maps.LatLng(
  95. parseFloat(markerElem.getAttribute('lat')),
  96. parseFloat(markerElem.getAttribute('lng')));
  97.  
  98. var infowincontent = document.createElement('div');
  99. var strong = document.createElement('strong');
  100. strong.textContent = name
  101. infowincontent.appendChild(strong);
  102. infowincontent.appendChild(document.createElement('br'));
  103.  
  104. var text = document.createElement('text');
  105. text.textContent = address
  106. infowincontent.appendChild(text);
  107. var icon = customLabel[type] || {};
  108. var marker = new google.maps.Marker({
  109. map: map,
  110. position: point,
  111. label: icon.label
  112. });
  113. marker.addListener('click', function() {
  114. infoWindow.setContent(infowincontent);
  115. infoWindow.open(map, marker);
  116. });
  117. });
  118. });
  119. }
  120.  
  121.  
  122.  
  123. function downloadUrl(url, callback) {
  124. var request = window.ActiveXObject ?
  125. new ActiveXObject('Microsoft.XMLHTTP') :
  126. new XMLHttpRequest;
  127.  
  128. request.onreadystatechange = function() {
  129. if (request.readyState == 4) {
  130. request.onreadystatechange = doNothing;
  131. callback(request, request.status);
  132. }
  133. };
  134.  
  135. request.open('GET', url, true);
  136. request.send(null);
  137. }
  138.  
  139. function doNothing() {}
  140. </script>
  141. <script async defer
  142. src="https://maps.googleapis.com/maps/api/js?key=AIzaSyC3rcDVwf8dmbKwtr2V0haRhDjAseaSW3Q&callback=initMap">
  143. </script>
  144. </body>
  145. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement