Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 6823 | Rev 6827 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 www 1
<?php
2
$notify = '';
3
$messages = $this->flashMessenger()->getInfoMessages();
6816 stevensc 4
 
3782 stevensc 5
foreach ($messages as $message) {
6
	$notify .= "$.fn.showInfo('$message')";
1 www 7
}
8
 
9
$messages = $this->flashMessenger()->getSuccessMessages();
3782 stevensc 10
foreach ($messages as $message) {
11
	$notify .= "$.fn.showSuccess('$message')";
1 www 12
}
13
 
14
$messages = $this->flashMessenger()->getWarningMessages();
3782 stevensc 15
foreach ($messages as $message) {
16
	$notify .= " $.fn.showWarning('$message')";
1 www 17
}
18
 
19
$messages = $this->flashMessenger()->getErrorMessages();
3782 stevensc 20
foreach ($messages as $message) {
21
	$notify .= " $.fn.showError('$message')";
1 www 22
}
23
 
3782 stevensc 24
if ($notify) {
25
	$this->inlineScript()->captureStart();
26
	echo " jQuery( document ).ready(function( $ ) { $notify }); ";
27
	$this->inlineScript()->captureEnd();
1 www 28
}
29
 
6824 stevensc 30
$this->inlineScript()->appendFile('https://maps.googleapis.com/maps/api/js?key=' . $google_map_key . '&libraries=places');
31
$googleMapPlacesUrl = 'https://maps.googleapis.com/maps/api/js?key=' . $google_map_key . '&libraries=places';
32
$error_msg = "Por favor seleccione una ubicación real";
6818 stevensc 33
 
6824 stevensc 34
$js = <<<JS
35
let autoComplete;
36
 
37
function handleScriptLoad(updateQuery, autoCompleteRef, setAddresObject, setError) {
38
  autoComplete = new window.google.maps.places.Autocomplete(
39
    autoCompleteRef.current,
40
    { types: ["(cities)"]}
41
  );
42
  autoComplete.setFields(["address_components", "formatted_address", "geometry"]);
43
  autoComplete.addListener("place_changed", () =>
44
    handlePlaceSelect(updateQuery, setAddresObject, setError)
45
  );
46
}
47
 
48
async function handlePlaceSelect(updateQuery, setAddresObject, setError) {
49
  const addressObject = autoComplete.getPlace();
50
  // console.log(addressObject.geometry.location.lat());
51
  // console.log(addressObject.geometry.location.lng());
52
  const query = addressObject.formatted_address;
53
  if(query){
54
    setError("");
55
    updateQuery(query);
56
    setAddresObject({
57
      ...addressObject,
58
      address_components:[
59
        ...addressObject.address_components,
60
        {
61
          latitude: addressObject.geometry.location.lat(),
62
          longitude: addressObject.geometry.location.lng(),
63
          types:["geometry"]
64
        }
65
      ]
66
    });
67
  }else{
68
    setError("$error_msg");
69
  }
70
}
71
JS;
72
 
73
$this->inlineScript()->appendScript($js);
74
 
1 www 75
?>
76
<!DOCTYPE html>
77
<html>
78
 
3782 stevensc 79
<head>
80
	<?php
81
	echo $this->headTitle();
82
	?>
83
	<link rel="icon" href="<?php echo $this->networkFavicoHelper(); ?>">
84
	<?php
85
	echo $this->headMeta()->appendHttpEquiv('X-UA-Compatible', 'IE=edge')
86
		->appendHttpEquiv('expires', '0')
87
		->appendHttpEquiv('expires', 'Tue, 01 Jan 1980 1:00:00 GMT')
88
		->appendHttpEquiv('pragma', 'no-cache')
89
		->appendHttpEquiv('Cache-Control', 'no-store')
90
		->appendHttpEquiv('Cache-Control', 'max-age=0')
91
		->appendHttpEquiv('Cache-Control', 'no-cache')
92
		->appendHttpEquiv('charset', 'UTF-8')
93
		->appendName('viewport', 'width=device-width, initial-scale=1.0');
94
	?>
95
	<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('css/animate.css') ?>">
96
	<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('css/bootstrap.min.css') ?>">
97
	<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('css/line-awesome.css') ?>">
98
	<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('css/line-awesome-font-awesome.min.css') ?>">
99
	<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('vendors/fontawesome-free/css/all.min.css') ?>">
100
	<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('css/font-awesome.min.css') ?>">
101
	<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('lib/slick/slick.css') ?>">
102
	<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('lib/slick/slick-theme.css') ?>">
103
	<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('look-and-field/main.css') ?>" />
104
	<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('look-and-field/style-cesa.css') ?>" />
1 www 105
 
3782 stevensc 106
	<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('vendors/nprogress/nprogress.css') ?>">
3639 efrain 107
 
3782 stevensc 108
	<?php
109
	echo $this->headStyle();
110
	echo $this->networkStylesAndColorsHelper();
1 www 111
 
3782 stevensc 112
	echo $this->headLink();
113
	echo $this->headScript();
114
	?>
115
</head>
1 www 116
 
6507 stevensc 117
<body>
118
	<?php echo $this->content ?>
1 www 119
 
6508 stevensc 120
	<footer class="footy-sec container">
6507 stevensc 121
		<img class="fl-rgt" src="<?php echo $this->basePath('/images/LL-08.png') ?>" alt="">
122
		<?php echo $this->footerHelper() ?>
4908 stevensc 123
 
6507 stevensc 124
		<div class="d-flex align-items-center">
125
			<img src="<?php echo $this->basePath('images/copy-icon2.png') ?>" alt="">
126
			<p>CESA MS Copyright <?php echo date('Y') ?></p>
3782 stevensc 127
		</div>
6507 stevensc 128
	</footer>
3731 efrain 129
 
3782 stevensc 130
	<!-- jQuery -->
131
	<script type="text/javascript" src="<?php echo $this->basePath('vendors/jquery/jquery.min.js') ?>"></script>
132
	<!-- Bootstrap 4 -->
133
	<script type="text/javascript" src="<?php echo $this->basePath('vendors/bootstrap/js/bootstrap.bundle.min.js') ?>"></script>
134
	<!--  Aplicacion -->
135
	<script type="text/javascript" src="<?php echo $this->basePath('vendors/bootstrap-notify/bootstrap-notify.min.js') ?>"></script>
136
 
137
	<script type="text/javascript" src="<?php echo $this->basePath('js/app.js') ?>"></script>
138
 
139
	<?php
140
	echo $this->inlineScript();
141
	?>
142
</body>
143
 
1 www 144
</html>