1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Document sans nom</title>
<script type="text/javascript" src="shr.js"></script>
<script type="text/javascript">
function chargerVilles(){
var xhr=getXhr();
xhr.open("GET","villes.php",true);
xhr.onreadystatechange=function(){
if((xhr.readyState==4)&&(xhr.status==200)){
var rep=xhr.responseText;
document.getElementById("villes").innerHTML=rep;
}
}
xhr.send(null);
}
function chargerBasesStations(idV){
var xhr=getXhr();
xhr.open("GET","bases_stations.php?idV="+idV,true);
xhr.onreadystatechange=function(){
if((xhr.readyState==4)&&(xhr.status==200)){
var rep=xhr.responseText;
document.getElementById("bs").innerHTML=rep;
}
}
xhr.send(null);
}
function chargerAP(idBS){
var xhr=getXhr();
xhr.open("GET","AP.php?idBS="+idBS,true);
xhr.onreadystatechange=function(){
if((xhr.readyState==4)&&(xhr.status==200)){
var rep=xhr.responseText;
document.getElementById("ap").innerHTML=rep;
}
}
xhr.send(null);
}
function chargerCPE(idAP){
var xhr=getXhr();
xhr.open("GET","CPE.php?idAP="+idAP,true);
xhr.onreadystatechange=function(){
if((xhr.readyState==4)&&(xhr.status==200)){
var rep=xhr.responseText;
document.getElementById("cpe").innerHTML=rep;
}
}
xhr.send(null);
}
function chargerTrafic(mode){
var xhr=getXhr();
var id;
if(mode=='CPE'){
id=document.getElementById("lcpe").value
}
else{
id=document.getElementById("lap").value
}
xhr.open("GET","trafic.php?mode="+mode+"&id="+id,true);
xhr.onreadystatechange=function(){
if((xhr.readyState==4)&&(xhr.status==200)){
var rep=xhr.responseText;
document.getElementById("res").innerHTML=rep;
}
}
xhr.send(null);
}
function chargerTraficGraphique(mode){
var xhr=getXhr();
var id;
if(mode=='CPE'){
id=document.getElementById("lcpe").value
}
else{
id=document.getElementById("lap").value
}
xhr.open("GET","traficgraph.php?mode="+mode+"&id="+id,true);
xhr.onreadystatechange=function(){
if((xhr.readyState==4)&&(xhr.status==200)){
var rep="<img src="+xhr.responseText+">";
document.getElementById("res").innerHTML=rep;
}
}
xhr.send(null);
}
</script>
</head>
<body onload="chargerVilles()">
Villes:<div id="villes" style="display:inline"></div>
Bases de station:
<div id="bs" style="display:inline">
<select name="bs">
<option value="-1">-------------</option></select>
</div>
AP:<div id="ap" style="display:inline">
<select name="ap">
<option value="-1">-------------</option></select>
</div>
CPE:<div id="cpe" style="display:inline">
<select name="cpe">
<option value="-1">-------------</option></select>
</div>
<div id="boutons">
<input type="button" id="bAP" value="Trafic AP" onclick="chargerTrafic('AP')" />
<input type="button" id="bAP" value="Trafic CPE" onclick="chargerTrafic('CPE')" />
<input type="button" id="bAPG" value="Graphics AP" onclick="chargerTraficGraphique('AP')" />
<input type="button" id="bCPEG" value="Graphics CPE" onclick="chargerTraficGraphique('CPE')" />
</div>
<div id="res">
</div>
</body>
</html> |
Partager