PageRenderTime 12ms CodeModel.GetById 2ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/kharm/public/js/ajax.js

http://kharm-xml.googlecode.com/
JavaScript | 93 lines | 64 code | 8 blank | 21 comment | 6 complexity | c18fc665fc4070eef88f7ada902d6ba4 MD5 | raw file
 1google.load('jquery','1.4.4');
 2
 3var congres;
 4var theme;
 5var lat;
 6
 7function getCongres(annee_demandee){
 8	if (annee_demandee>0) {
 9		$.get('ajax.php', {
10				typeRequest: "congres",
11				annee:annee_demandee
12			}, function(data){
13			}
14		);
15	}
16}
17
18function addMarkers(data) {
19	var geocoder = new google.maps.Geocoder();
20	var addresses = new Array();
21	for (var i=0; i < 2 ; i++) {
22		addresses.push({address: data[i]["lieu"]});
23	}
24	alert(addresses.length);
25	geocoder.geocode(addresses, 
26		function (response, status) {
27			if (response != null) {
28				for (var j=0; j < response.length; j++) {
29					var marker = new google.maps.Marker({
30						position: response[j]["geometry"]["location"],
31					    map: map,
32					    title: data[j]["name"]});
33				}
34			}
35		}
36	);
37}
38/*
39function add_marker(addr, name) {
40	var geocoder = new google.maps.Geocoder();
41	var request = {addr};
42	geocoder.geocode(request, 
43		function(response, status) {
44			if (response != null) {
45				var marker = new google.maps.Marker({
46					position: response[0]["geometry"]["location"],
47				    map: map,
48				    title: name});
49			}
50		}
51	);
52}*/
53
54function test(response, status,name) {
55	/*
56        
57	google.maps.event.addListener(marker, 'click', function() {
58		map.setCenter(response[0]["geometry"]["location"]);
59		map.setZoom(18);
60	});*/
61}
62
63
64function getTheme(annee_demandee){
65	if(annee_demandee>0){
66		$.get('ajax.php', { 
67				typeRequest: "theme",
68				annee:annee_demandee
69			}, function(data){
70			    theme = data;
71			}
72		);
73	}
74}
75
76function getAllC(){
77	$.get('ajax.php', {  
78				typeRequest: "tout_C"
79		}, function(data){
80				congres = data;
81				select_congress(congres);
82		}
83	);
84}
85
86function getAllT(){
87	$.get('ajax.php', {  
88				typeRequest: "tout_T"
89		}, function(data){
90				theme = data;
91		}
92	);
93}