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 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="robots" content="none">
<style>
body
{
margin: 64px;
margin-top:0;
font-size:100%;
font-family: arial, sans;
background-color: #FFF;
}
</style>
<script type='text/javascript'>
var num=1; // numéro du fichier courant
var min=1; // nombre minimum de fichiers
var max=5000; // nombre maximum de fichiers
var extension = '.jpg';
var mypix=new Array();
var thispic = 0;
var thispic_temp = 0;
/* fonction qui permet d'afficher l'image */
function Affich()
{
document.getElementById("image1").src= mypix[0];
Affich2(0);
}
function Affich2(num_img)
{
document.getElementById("image2").src= mypix[num_img];
document.getElementById("image2").title= mypix[num_img];
document.getElementById("name_img").value= mypix[num_img];
/* au moins 2 images reçues */
if(mypix.length > 1)
{
Prev_img3();
Next_img4();
}
}
/* fonction qui permet de revenir à l'image précédente */
function Prev()
{
if(thispic==0){
thispic=mypix.length;
}
thispic--;
Affich2(thispic);
return false;
}
/* fonction qui permet d'aller à l'image suivante */
function Next()
{
thispic++;
if(thispic==mypix.length){
thispic=0;
}
Affich2(thispic);
return false;
}
/* Gestion des images en miniatures */
function Prev_img3()
{
thispic_temp = thispic;
if(thispic_temp==0){
thispic_temp=mypix.length;
}
thispic_temp--;
document.getElementById("image3").src= mypix[thispic_temp];
return false;
}
function Next_img4()
{
thispic_temp = thispic;
thispic_temp++;
if(thispic_temp==mypix.length){
thispic_temp=0;
}
document.getElementById("image4").src= mypix[thispic_temp];
return false;
}
function getXMLHttpRequest() {
var xhr = null;
if (window.XMLHttpRequest || window.ActiveXObject) {
if (window.ActiveXObject) {
try {
xhr = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
xhr = new ActiveXObject("Microsoft.XMLHTTP");
}
} else {
xhr = new XMLHttpRequest();
}
} else {
alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
return null;
}
return xhr;
}
setInterval(fonctionReloadTableau, 10000);
function fonctionReloadTableau()
{
var xhr = getXMLHttpRequest();
xhr.onreadystatechange = function()
{
var newlistImg = xhr.responseText;
var ancienne_mypix_length = mypix.length;
var ancien_index = thispic;
//traitement de newlistImg pour màj tableau
mypix = newlistImg.split(",")
//recalcul de l'index
var thispic_new = thispic + (mypix.length - ancienne_mypix_length);
Affich2(thispic_new);
// maj de la dernière image.
document.getElementById("image1").src= mypix[0];
}
xhr.open("GET", "/cgi-bin/xxxxx.exe", true);
xhr.send(null);
}
</script>
</head>
<body onload="fonctionReloadTableau()">
<div id="scroll">
<HR align=center size=6 width="100%" color="1B35A8">
<br><br>
<div align="left">
<b>Visualisation image1:</b> <img id="image1" name="image1" src="" height="350" width="450" align="center">
</div>
<br><br>
<HR align=center size=6 width="100%" color="1B35A8">
<br><br>
<div align="left">
<b>Visualisation archives:</b> <input type="text" size="60" p style="font-family: arial;font-size: 15px;background-color: #C0C0C0;" name="name_img" id="name_img" readonly>
<br><br>
<img id="image3" src="" height="50" width="50" align="center" hspace=50px>
<input type="button" p style="font-family: arial;font-size: 35px" name="prec" value="<" onclick="Prev()">
<img id="image2" src="" height="350" width="450" align="center" hspace=50px value="">
<input type="button" p style="font-family: arial;font-size: 35px" name="suiv" value=">" onclick="Next()">
<img id="image4" src="" height="50" width="50" align="center" hspace=50px>
</div>
<br><br>
<div align="center">
<b>Cliquez <a href="img_jpg/" name="datafile">ici</a> pour sélectionner une image dans la base de données.</b>
</div>
</div>
</body>
</html> |