Subversion Repositories SmartDukaan

Rev

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

Rev 8578 Rev 8590
Line 12... Line 12...
12
    width: 100px;
12
    width: 100px;
13
}
13
}
14
</style>
14
</style>
15
<script type="text/javascript">
15
<script type="text/javascript">
16
$(function(){	
16
$(function(){	
17
$("#uploadContentFile").live('submit', function(){
17
$("#uploadCampaignFile").live('submit', function(){
18
    var formData = new FormData($(this)[0]);
18
    var formData = new FormData($(this)[0]);
19
	var name = $('#newsletterName').val();
19
	var name = $('#newsletterName').val();
20
    jQuery.ajax({
20
    jQuery.ajax({
21
        url: "/user-image!createNewsletter?newsletterName="+name,
21
        url: "/user-image!createNewsletter?newsletterName="+name,
22
        type: 'POST',
22
        type: 'POST',
23
        data: formData,
23
        data: formData,
24
        async: false,
24
        async: false,
25
        success: function (data) {
25
        success: function (data) {
26
            alert("Changes propagated successfully");
26
		$('html').html(data.replace(/<html>(.*)<\/html>/, "$1"));
27
			$('#uploadContentFile')[0].reset();
-
 
28
        },
27
        },
29
		 error : function() {
28
		 error : function() {
30
		 	alert("OOPS!!!Failed to do changes.Try Again.");
29
		 	alert("OOPS!!!Failed to do changes.Try Again.");
31
		 },
30
		 },
32
        cache: false,
31
        cache: false,
Line 38... Line 37...
38
});
37
});
39
});  
38
});  
40
</script>
39
</script>
41
</head>
40
</head>
42
<body>
41
<body>
43
<h3>Upload News Letter Images</h3>
42
<div id="content">
44
<div style="display: none;" class="msgSuccess">
43
<div style="color:blue;padding:0px;">
45
<p style="font-size: 12px; color: green;">Image Uploaded Sucessfully</p>
44
    #sactionmessage()
46
</div>
45
    </div>
47
<div style="display: none;" class="msgError">
46
    <div style="color:red;padding:0px;">
48
<p style="font-size: 12px; color: red;">Image Failed to upload</p>
47
    #sactionerror()
49
</div>
48
</div>
-
 
49
<h3>Upload News Letter Images</h3>
50
<div style="padding-top: 20px;">
50
<div style="padding-top: 20px;">
51
<label for="newsletterName">NewsLetter Name : </label>
51
<label for="newsletterName">NewsLetter Name : </label>
52
<input id="newsletterName" name="newsletterName" type="text"/>
52
<input id="newsletterName" name="newsletterName" type="text"/>
53
<br></br>
53
<br></br>
54
<form id="uploadContentFile" action="/user-image" enctype="multipart/form-data" method="post">
54
<form id="uploadCampaignFile" action="/user-image" enctype="multipart/form-data" method="post">
55
<label for="imagePath">Image Path : </label>
55
<label for="imagePath">Image Path : </label>
56
<input name="userImage" id="file" type="file" />
56
<input name="userImage" id="file" type="file" />
57
<br></br>
57
<br></br>
58
<label for="imageName">Image Name : </label>
58
<label for="imageName">Image Name : </label>
59
<input id="imageName" name="imageName" type="text"/>
59
<input id="imageName" name="imageName" type="text"/>
60
<br></br>
60
<br></br>
61
<input type="submit" value="Update" name="upload" />
61
<input type="submit" value="Update" name="upload" />
62
</form>
62
</form>
63
</div>
63
</div>
-
 
64
</div>
64
</body>
65
</body>
65
66