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
| <?php
require ("../user/class-session.php");
require ("../connexion.php");
switch ($_GET['actionpopup'])
{
case 'addmessage';
require("class-addmessage.php");
break;
}
echo $encoding="<"."?xml version=\"1.0\" encoding=\"UTF-8\" ?>";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<eta http-equiv="Refresh" content="10" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Document sans nom</title>
<style>
* {margin:0; padding:0}
.tchat { float:left; display:block; width:700px}
.tchat-left { float:left; display:block; height:600px; width:249px; border-right:1px solid #ccc}
.tchat-right { float:right; display:block; height:600px; width:450px}
.tchat-top { float:left; display:block; height:69px; width:450px; padding:5px; border-bottom:1px solid #ccc}
#tchatmiddle { float:left; display:block; height:330px; width:450px; overflow-x: hidden; padding:5px}
.tchat-bottom { float:left; display:block; background:yellow; height:169px; width:450px; padding:5px; border-top:1px solid #ccc; overflow-x: hidden}
</style>
<script type="text/javascript">
var compteur=0;
function Rafraichissement() {
//var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
var xhr_object = null;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
x = new XMLHttpRequest();
if (x.overrideMimeType) {
x.overrideMimeType('text/xml');
// Voir la note ci-dessous à propos de cette ligne
}
}
else if (window.ActiveXObject) { // IE
try {
x = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
x = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {}
}
}
if (x) {
x.onreadystatechange = function()
{
document.getElementById('tchatmiddle').innerHTML = x.responseText;
}
x.open("GET", "message.php?idc=<?php echo $idc; ?>&id=<?php echo $_SESSION["RO_loginID"]; ?>", true);
x.send(null);
}
document.getElementById('refreshcpt').innerHTML = compteur;
compteur++;
window.setTimeout("Rafraichissement()", 1000);
}
</script>
</head>
<body onload="Rafraichissement()">
<div class="tchat">
<div class="tchat-left">
</div>
<div class="tchat-right">
<div class="tchat-top">
<?php switch ($_GET['actionpopup'])
{
case 'viewid';
echo 'muse '.$_GET['idc'];
break;
}
?>
</div>
<div id="refreshcpt">compteur</div>
<div id="tchatmiddle">
chargement en cours.............
</div>
<div class="tchat-bottom">
<ol>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?lang=<?php echo $lang; ?>&actionpopup=addmessage">
<li><textarea name="message" rows="7" cols="42"></textarea></li>
<li><input type="submit" name="envoyer" value="envoyer" /></li>
<input type="hidden" value="<?php echo $_SESSION["RO_loginID"]; ?>" name="expediteur" />
<input type="hidden" value="<?php echo $_GET['idc']; ?>" name="destinataire" />
</form>
</ol>
</div>
</div>
</div>
</body>
</html> |
Partager