Subversion Repositories SmartDukaan

Rev

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