Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
21090 kshitij.so 1
$(function() {
2
	$(".add-new-user").live('click', function() {
3
		loadNewUserForm("page-content-wrapper","");
4
	});
5
 
6
	$(".search-user").live('click', function() {
7
		loadSearchUserForm("page-content-wrapper");
8
	});
9
 
10
	$(".edit-user").live('click', function() {
11
		var userId = $(this).attr('userId');
12
		loadUserForm("page-content-wrapper", userId);
13
	});
14
 
15
	$(".add-l3-user").live('click', function() {
16
		var referrerEmail = $(this).attr('referrerEmail');
17
		loadNewUserForm("page-content-wrapper", referrerEmail);
18
	});
19
 
20
	$("#new-user-form").live('submit', function(){
21
	    var formData = new FormData($(this)[0]);
22
 
23
	    jQuery.ajax({
24
	        url: "/Support/pmsa!addNewUser",
25
	        type: 'POST',
26
	        data: formData,
27
	        async: false,
28
	        success: function (data) {
29
	        	$("#alert-message").show();
30
	        	$("#alert-message").text(data);
31
	        	$('html, body').animate({
32
	                scrollTop: $('#page-content-wrapper').offset().top
33
	            }, 2000);
34
	        },
35
			 error : function() {
36
			 	alert("OOPS!!!Failed to do changes.Try Again.",'ERROR');
37
			 },
38
	        cache: false,
39
	        contentType: false,
40
	        processData: false
41
	    });
42
	    return false;
43
	});
44
 
45
	$("#edit-user-form").live('submit', function(){
46
	    var formData = new FormData($(this)[0]);
47
 
48
	    jQuery.ajax({
49
	        url: "/Support/pmsa!updateUser",
50
	        type: 'POST',
51
	        data: formData,
52
	        async: false,
53
	        success: function (data) {
54
	        	$("#alert-message").show();
55
	        	$("#alert-message").text(data);
56
	        	$('html, body').animate({
57
	                scrollTop: $('#page-content-wrapper').offset().top
58
	            }, 2000);
59
	        },
60
			 error : function() {
61
			 	alert("OOPS!!!Failed to do changes.Try Again.",'ERROR');
62
			 },
63
	        cache: false,
64
	        contentType: false,
65
	        processData: false
66
	    });
67
	    return false;
68
	});
69
 
70
	$(".pending-user").live('click', function() {
71
		jQuery.ajax({
72
	        type : "GET",
73
	        url : "/Support/pmsa!pendingUsers",
74
	        success : function(response) {
75
	            $('#' + 'page-content-wrapper').html(response);
76
	        }
77
	    });  
78
	});
79
 
80
	$(".recent-user").live('click', function() {
81
		jQuery.ajax({
82
	        type : "GET",
83
	        url : "/Support/pmsa!recentUsers",
84
	        success : function(response) {
85
	            $('#' + 'page-content-wrapper').html(response);
86
	        }
87
	    });  
88
	});
89
 
90
	$("#search-user").live('submit', function(){
91
	    var formData = new FormData($(this)[0]);
92
 
93
	    jQuery.ajax({
94
	        url: "/Support/pmsa!searchUser",
95
	        type: 'POST',
96
	        data: formData,
97
	        async: false,
98
	        success: function (data) {
99
	        	$('#' + 'search-results').html(data);
100
	        },
101
			 error : function() {
102
			 	alert("OOPS!!!Failed to do changes.Try Again.",'ERROR');
103
			 },
104
	        cache: false,
105
	        contentType: false,
106
	        processData: false
107
	    });
108
	    return false;
109
	});
110
 
111
});