/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


function ajax_request(ProductID){

    $.ajax({
       type: "POST",
       url: "src/ajax/shop.php",
       data: "op=AddProduct&ProductID=" + ProductID,
       success: function(msg){
        message = msg.split("|");
        if (message[1] != ''){
            alert('Lisatud ostukorvi. ' + message[1]);
            document.getElementById("OrderTotal").innerHTML = message[1];
        }
       }
     });
}

function DelShop(ID){
    $.ajax({
       type: "POST",
       url: "src/ajax/shop.php",
       data: "op=Remove&ProductID="+ID,
       success: function(msg){
        message = msg.split("|");
        if (message[1] != ''){
            document.getElementById("ShopTable").innerHTML = message[1];
        }
       }
     });

}
function SendShop(){

    $.ajax({
       type: "POST",
       url: "src/ajax/shop.php",
       data: "op=Cart",
       success: function(msg){
        message = msg.split("|");
          if (message[1] != undefined){
                alert(message[1]);
                window.location.reload(); return false;
          }else{
                alert('Meil juhtus õnnetus. Anna andeks ja anna meile sellest teada.');
          }
       }
     });

}

