Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
20424 kshitij.so 1
<!DOCTYPE html PUBLIC 
2
    "-//W3C//DTD XHTML 1.1 Transitional//EN"
3
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
<head>
6
	<title>Import Product</title>
7
	<script src="js/jquery-1.4.2.js"></script>
8
	<script type="text/javascript">
9
      $(function(){
10
    	$("#submit").live('click', function() {
11
			var entityId=$('#entityId').val();
12
			jQuery.ajax({
13
            type : "GET",
14
            url : "/hotspot/products!fetchEntityDetails?entityId="+entityId,
15
            success : function(response) {
16
			if (response===""){
17
				alert("Error : Not valid entity");
18
				return;
19
			}
20
 
21
    		$("#details").css("display", "");
22
    		$('.productName').text("Product Title : "+response);
23
            },
24
			error : function() {
25
				alert("Unable to fetch details");
26
		 	}
27
    	});  
28
      	});	
29
    	});
30
	</script>
31
	<script type="text/javascript">
32
      $(function(){
33
    	$("#addProduct").live('click', function() {
34
			var entityId=$('#entityId').val();
35
			jQuery.ajax({
36
            type : "GET",
37
            url : "/hotspot/products!addEntity?entityId="+entityId,
38
            success : function(response) {
39
				alert(response);
40
				location.reload();
41
            },
42
			error : function() {
43
				alert("Unable to add details");
44
		 	}
45
    	});  
46
      	});	
47
    	});
48
	</script>
49
 
50
</head>
51
<body>
52
	<h2>Import Product</h2>
53
	<div>
54
		<lablel>Entity Id:</label>
55
		<input name="entityId" id="entityId"></input>
56
		<input type="button" id="submit" name="submit" value="Fetch Details"/>
57
	</div>
58
	<div id="details" style="display:none;">
59
		<p class="productName"></p>
60
		<input type="button" id="addProduct" value="Add Entity"/>
61
	</div>
62
 
63
</body>
64
</html>