$(function() { $(".thumbs a").click(function(){ var largePath = $(this).attr("href"); var largeAlt = $(this).attr("title"); $("#largeImg").animate({opacity: 0.0},500,function(){ $('#largeImg').attr("src", largePath) .load(function(){ $('#largeImg').animate({opacity: 1.0}, 500);                      }); }); return false; }); $( "#dialog-response" ).dialog({ closeOnEscape: true, autoOpen: false, height: 220, width: 390, modal: true, buttons: { OK: function() { location.reload(true); $( this ).dialog( "close" ); } } }); $( "#dialog-wait" ).dialog({ closeOnEscape: false, autoOpen: false, height: 220, width: 390, modal: true, close: function() { $(".ui-dialog-titlebar-close").show(); } }); function sendRequest() { var lname = $('#userID').attr('value'); var lpassword = MD5($('#password').attr('value')); $.ajax({ type: "GET", global: false, async: true, timeout: 30000, url: "/cgi-bin/WebShop/intern/tcAuth.php", data: "userID="+ lname +"&passWD="+ lpassword + "&do=login", datatype: "html", contentType: "application/x-www-form-urlencoded", success: function(data, txtst, objectX) { $( "#responseDIV" ).html( data ); $( "#dialog-wait" ).dialog( "close" ); $( "#dialog-response" ).dialog( "open" ); }, error: function(objectX, txtst, errorcode) { $( "#responseDIV" ).html( errorcode ); $( "#dialog-wait" ).dialog( "close" ); $( "#dialog-response" ).dialog( "open" ); } }); $( "#dialog-login" ).dialog( "close" ); } $( "#dialog-login" ).dialog({ autoOpen: false, closeOnEscape: false, height: 220, width: 390, modal: true, buttons: { "Login": function() { sendRequest(); } }, close: function() { allFields.val( "" ).removeClass( "ui-state-error" ); } }); $( ".ClickLogin" ).click(function() { $( "#dialog-login" ).dialog( "open" ); }); $( "#Suchbutton" ).click(function() { $("#SucheErweitert").slideToggle("fast"); }); $( ".abmelden" ).click(function() { $( "#dialog-wait" ).dialog( "open" ); var element = $(this); $.ajax({ type: "GET", global: false, async: false, timeout: 30000, url: "/cgi-bin/WebShop/intern/tcAuth.php", data: "do=logout", datatype: "html", contentType: "application/x-www-form-urlencoded", success: function(data, txtst, objectX) { //alert(data); $( "#responseDIV" ).html( data ); $( "#dialog-wait" ).dialog( "close" ); $( "#dialog-response" ).dialog( "open" ); }, error: function(objectX, txtst, errorcode) { //alert(errorcode ); $( "#responseDIV" ).html( errorcode ); $( "#dialog-wait" ).dialog( "close" ); $( "#dialog-response" ).dialog( "open" ); }, complete: function(txtst, objectX) { //alert(html( txtst )); //alert( 'complete' ); } }); }); $( ".refreshCart" ).click(function() { $( "#dialog-wait" ).dialog( "open" ); var element = $(this); var Id = element.attr("id"); var Anzahl = $("#Anzahl"+Id).val(); var ArtikelNummer = $("#Artikelnummer"+Id).val(); var ArtikelPreis = $("#Preis"+Id).val(); $.ajax({ type: "GET", global: false, async: false, timeout: 30000, url: "/cgi-bin/WebShop/index.php?site=Korrektur", data: "Artikelnummer="+ ArtikelNummer +"&Anzahl="+ Anzahl + "&Preis=" + ArtikelPreis, datatype: "html", contentType: "application/x-www-form-urlencoded", success: function(data, txtst, objectX) { //alert(data); $( "#responseDIV" ).html( data ); $( "#dialog-wait" ).dialog( "close" ); $( "#dialog-response" ).dialog( "open" ); }, error: function(objectX, txtst, errorcode) { //alert(errorcode ); $( "#responseDIV" ).html( errorcode ); $( "#dialog-wait" ).dialog( "close" ); $( "#dialog-response" ).dialog( "open" ); }, complete: function(txtst, objectX) { //alert(html( txtst )); //alert( 'complete' ); } }); }); $( ".removeFromCart" ).click(function() { $( "#dialog-wait" ).dialog( "open" ); var element = $(this); var Id = element.attr("id"); Id = Id.substring(7); var Anzahl =0; var ArtikelNummer = $("#Artikelnummer"+Id).val(); var ArtikelPreis = $("#Preis"+Id).val(); $.ajax({ type: "GET", global: false, async: false, timeout: 30000, url: "/cgi-bin/WebShop/index.php?site=Korrektur", data: "Artikelnummer="+ ArtikelNummer +"&Anzahl="+ Anzahl + "&Preis=" + ArtikelPreis, datatype: "html", contentType: "application/x-www-form-urlencoded", success: function(data, txtst, objectX) { //alert(data); $( "#responseDIV" ).html( data ); $( "#dialog-wait" ).dialog( "close" ); $( "#dialog-response" ).dialog( "open" ); }, error: function(objectX, txtst, errorcode) { //alert(errorcode ); $( "#responseDIV" ).html( errorcode ); $( "#dialog-wait" ).dialog( "close" ); $( "#dialog-response" ).dialog( "open" ); }, complete: function(txtst, objectX) { //alert(html( txtst )); //alert( 'complete' ); } }); }); $( ".addToCart" ).click(function() { $( "#dialog-wait" ).dialog( "open" ); var element = $(this); var Id = element.attr("id"); var Anzahl = $("#Anzahl"+Id).val(); var ArtikelNummer = $("#Artikelnummer"+Id).val(); var ArtikelPreis = $("#Preis"+Id).val(); $.ajax({ type: "GET", global: false, async: false, timeout: 30000, url: "/cgi-bin/WebShop/index.php?site=Add", data: "Artikelnummer="+ ArtikelNummer +"&Anzahl="+ Anzahl + "&Preis=" + ArtikelPreis, datatype: "html", contentType: "application/x-www-form-urlencoded", success: function(data, txtst, objectX) { //alert(data); $( "#responseDIV" ).html( data ); $( "#dialog-wait" ).dialog( "close" ); //location.reload(true); $( "#dialog-response" ).dialog( "open" ); }, error: function(objectX, txtst, errorcode) { //alert(errorcode ); $( "#responseDIV" ).html( errorcode ); $( "#dialog-wait" ).dialog( "close" ); $( "#dialog-response" ).dialog( "open" ); }, complete: function(txtst, objectX) { //alert(html( txtst )); //alert( 'complete' ); } }); }); });