Subversion Repositories SmartDukaan

Rev

Rev 1047 | Rev 1172 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1047 Rev 1109
Line 1... Line 1...
1
// Ebizon Move script js into the file
1
// Ebizon Move script js into the file
2
 
2
 
3
$(document).ready(function() {
3
$(document).ready(function(){
4
  $('#addAdrBtn').click(function(){
4
	$('#addAdrBtn').click(function(){
5
    $('#newShipAdr').show();			 
5
		$('#newShipAdr').show();
6
    scrollWin();
6
		scrollWin();
-
 
7
	});
-
 
8
 
-
 
9
	$('#communication_category').change(function(){
-
 
10
		$('#orderComponent, #awbComponent, #productComponent, #subjectComponent, #msgComponent').hide();
-
 
11
 
-
 
12
		switch($(this).val())	{
-
 
13
 
-
 
14
			case 1:
-
 
15
				$('#orderComponent, #productComponent, #subjectComponent, #msgComponent').show();
-
 
16
				console.log(1);
-
 
17
				break;
-
 
18
 
-
 
19
			case 2:
-
 
20
				$('#orderComponent, #subjectComponent, #msgComponent').show();
-
 
21
				console.log(2);
-
 
22
				break;
-
 
23
 
-
 
24
			case 3:
-
 
25
				$('#orderComponent, #subjectComponent, #msgComponent').show();
-
 
26
				console.log(3);
-
 
27
				break;
-
 
28
 
-
 
29
			case 4:
-
 
30
				$('#orderComponent, #msgComponent').show();
-
 
31
				console.log(4);
-
 
32
				break;
-
 
33
 
-
 
34
			case 5:
-
 
35
				$('#orderComponent, #msgComponent').show();
-
 
36
				console.log(5);
-
 
37
				break;
-
 
38
 
-
 
39
			case 6:
-
 
40
				$('#orderComponent, #awbComponent, #productComponent, #subjectComponent, #msgComponent').show();
-
 
41
				console.log(6);
-
 
42
				break;
-
 
43
 
-
 
44
			case 7:
-
 
45
				$('#orderComponent, #msgComponent').show();
-
 
46
				console.log(7);
-
 
47
				break;
-
 
48
 
-
 
49
			default:
-
 
50
				$('#orderComponent, #awbComponent, #productComponent, #subjectComponent, #msgComponent').hide();
-
 
51
				console.log('default');
-
 
52
				break;
-
 
53
		}
-
 
54
		$('#contactusFormMessagePart').show();
7
  });
55
	});
8
 
56
 
9
  function scrollWin(){
57
  function scrollWin(){
10
    $('html, body').animate({
58
    $('html, body').animate({
11
      scrollTop: $("#newShipAdr").offset().top
59
      scrollTop: $("#newShipAdr").offset().top
12
    }, 2000);
60
    }, 2000);
Line 166... Line 214...
166
    var items = this.id;
214
    var items = this.id;
167
    var itemsarray = items.split('-');
215
    var itemsarray = items.split('-');
168
    addResearch(itemsarray[1], itemsarray[0]);
216
    addResearch(itemsarray[1], itemsarray[0]);
169
    return false;
217
    return false;
170
  });
218
  });
171
  $("#research_delete").click(function(){
-
 
172
    var research_tot=$("#research_total").val();
219
  $("#research_delete").click(function(){var research_tot = $("#research_total").val();
173
 
-
 
174
    var seldata="";
220
  	var seldata = "";
175
    var tot=0;
221
	var tot = 0;
176
    var saprt="";
222
	var saprt = "";
177
    var containerdiv = "#pane1";
223
	var containerdiv = "#pane1";
178
    var par= containerdiv + " input[type=checkbox]:checked";
224
	var par = containerdiv + " input[type=checkbox]:checked";
-
 
225
 
179
    $(par).each(function(){
226
	$(par).each(function(){
180
      saprt = (tot>0)? "_":"";
227
		saprt = (tot > 0) ? "_" : "";
181
      seldata += saprt+$(this).val();
228
		seldata += saprt + $(this).val();
182
      tot++
229
		tot ++;
183
    });
230
	});
-
 
231
 
184
    if(tot>0){
232
	if(tot > 0)	{
185
      var t=(research_tot*1)-(tot*1);
233
		var t = (research_tot * 1) - (tot * 1);
186
      $("#research_total").val(t);
234
		$("#research_total").val(t);
187
 
235
 
188
      //alert("AJAX request to delete products in research. Product ID: "+seldata+" and total: "+tot);
-
 
189
      jQuery.ajax({
236
		jQuery.ajax({
190
        type: "GET",
237
			type: "GET",
191
        url: "/myresearch/" + seldata + "?_method=delete",
238
			url: "/myresearch/" + seldata + "?_method=delete",
192
        data: "productid="+seldata,
239
			data: "productid=" + seldata,
193
        success: function(msg){
240
			success: function(msg){
194
        //   alert( "Data Saved: " + msg );
-
 
195
        }
-
 
196
      });
-
 
197
      var arrayprod_id=seldata.split("_");
-
 
198
      jQuery.each(arrayprod_id,function(intIndex, objValue){
241
				jQuery.each(seldata.split("_"), function(intIndex, objValue){
199
        var tableref="#"+objValue;
-
 
200
        $(tableref).animate({
-
 
201
          backgroundColor: "#fcffb3"
-
 
202
        }, 'slow');
-
 
203
        $(tableref).animate({
-
 
204
          backgroundColor: "#F5F5F5"
-
 
205
        }, 'slow', function() {
-
 
206
          $(this).fadeOut('slow', function() {
242
					$("#pane1").find("#" + objValue).fadeOut('slow', function() {
207
            $(this).remove();
243
						$(this).remove();
208
            if(t === 0){
-
 
209
              $("#research_default").css("display","block");
244
						if(t === 0)	$("#research_default").css("display", "block");
210
            }
-
 
211
          } )
245
					});
212
        });
246
				});
213
 
247
			}
214
      });
248
		});
215
    }else{
249
	} else	{
216
      alert("Please select atleast one product");
250
		alert("Please select atleast one product");
217
    }
251
	}
218
  });
252
  });
219
});
253
});
220
 
-
 
221
 
-
 
222
254