Разработка web-узла системы бронирования номеров в отелях, страница 5

                    xmlhttp.onreadystatechange=function()

          {       

                    if(xmlhttp.readyState==4)

                    {        //alert(xmlhttp.responseText);

                              var e = document.getElementById("view_room"+id)

                              e.innerHTML = xmlhttp.responseText;        

                              count = parseInt(document.getElementById("cnt").innerHTML);

                              //alert(count)

                              count++;

                              document.getElementById("cnt").innerHTML = (count+'');

                    }

          }

    xmlhttp.open("GET",url,false);

    xmlhttp.send(null);     

}

function purchase_room(id, from, to)

{

          xmlhttp=GetXmlHttp();

    if (xmlhttp==null)

    {

        alert ("Browser does not support HTTP Request");

        return;

    }

    var url="makePurchase.php?id="+id+"&to="+to+"&from="+from;

                    xmlhttp.onreadystatechange=function()

          {       

                    if(xmlhttp.readyState==4)

                    {        //alert(xmlhttp.responseText);

                              var e = document.getElementById("done")

                              e.innerHTML = xmlhttp.responseText;        

                              e = document.getElementById("go").disabled = true;

                    }

          }

    xmlhttp.open("GET",url,false);

    xmlhttp.send(null);               

}

function addComment(login, post)

{

          xmlhttp=GetXmlHttp();

    if (xmlhttp==null)

    {

        alert ("Browser does not support HTTP Request");

        return;

    }

    var url="guestbook.php?l="+login+"&p="+post;

          //alert(url);

          xmlhttp.onreadystatechange=function()

          {       

                    if(xmlhttp.readyState==4)

                    {       

                              //alert(xmlhttp.responseText);

                              var e = document.getElementById("guest")

                              e.innerHTML = xmlhttp.responseText;        

                              //e.setAttribute('id','old_comment');

                              document.getElementById("postfield").value = "";

                    }

          }

    xmlhttp.open("GET",url,false);

          //xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')

    xmlhttp.send(null);               

}

function updateGuestBook()

{

          xmlhttp=GetXmlHttp();

    if (xmlhttp==null)

    {

        alert ("Browser does not support HTTP Request");

        return;

    }

    var url="guestbook.php";

          //alert(url);

          xmlhttp.onreadystatechange=function()

          {       

                    if(xmlhttp.readyState==4)

                    {       

                              //alert(xmlhttp.responseText);

                              var e = document.getElementById("guest")

                              e.innerHTML = xmlhttp.responseText;        

                              //e.setAttribute('id','old_comment');

                    }

          }

    xmlhttp.open("GET",url,true);

          //xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')

    xmlhttp.send(null);     

}