Subversion Repositories SmartDukaan

Rev

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

Rev 28455 Rev 28641
Line 18... Line 18...
18
<section>
18
<section>
19
<table class="table table-striped priceTable"  >
19
<table class="table table-striped priceTable"  >
20
			<thead>
20
			<thead>
21
					 <tr class="price-drop-header">
21
					 <tr class="price-drop-header">
22
					 	<th>Brand</th>
22
					 	<th>Brand</th>
-
 
23
					 	<th>Before $yms.get(0).format($dateYearMonthFormatter)</th>
23
						#foreach($ym in $ym )
24
						#foreach($ym in $yms )
24
						 <th> <input type="hidden" value="$ym.format($dateMonthYearFormatter)"/> $ym.format($dateYearMonthFormatter)</th>
25
						 <th> <input type="hidden" value="$ym.format($dateMonthYearFormatter)"/> $ym.format($dateYearMonthFormatter)</th>
25
						 #end
26
						 #end
26
						 <th>Total</th>
27
						 <th>Total</th> 
27
						 
-
 
28
					</tr>
28
					</tr>
29
			</thead>
29
			</thead>
30
							    
30
							    
31
			<tbody>
31
			<tbody>
32
			
32
			
-
 
33
			#if(!$sortedBrandValue.isEmpty())
-
 
34
			 
33
			
35
			 
34
					 #foreach($sortedBrandValue in $sortedBrandValue.entrySet())
36
			 #foreach($brand in $brands)
-
 
37
			 
35
		          <tr> 
38
                    <tr> 
36
		          
39
                    
37
			       <td class="brand_name"><b>$sortedBrandValue.getKey()</b></td>
40
			       <td class="brand_name"><b>$brand</b></td>
38
		          #set($total = 0.0) 
41
			        #set($total = 0.0)  
-
 
42
			       #if($priceDropBrandSixMonthMap.get($brand))
-
 
43
			        <td><button type="button" class="btn btn-primary price-drop-six-month" data-id="$fofoId" data-toggle="modal" data-target="#priceDropDetailsContainer">$priceDropBrandSixMonthMap.get($brand)</button></td>
-
 
44
			       
-
 
45
			       #set($total = $total + $priceDropBrandSixMonthMap.get($brand))
-
 
46
			       #else
-
 
47
			       <td>-</td>
-
 
48
			       #end
-
 
49
		         #if($sortedBrandValue.get($brand))
-
 
50
		        
39
		        #foreach($sortedBrandValue in $sortedBrandValue.getValue() )
51
		        #foreach($sortedBrandValue in $sortedBrandValue.get($brand))
40
		            #set($total = $total + $sortedBrandValue )
52
		            #set($total = $total + $sortedBrandValue)
41
		           #if($sortedBrandValue != 0.0)				 
53
		           #if($sortedBrandValue != 0.0)				 
42
                   <td><button type="button" class="btn btn-primary my-price-drop" data-id="$fofoId" data-toggle="modal" data-target="#priceDropDetailsContainer">$sortedBrandValue</button></td>
54
                   <td><button type="button" class="btn btn-primary my-price-drop" data-id="$fofoId" data-toggle="modal" data-target="#priceDropDetailsContainer">$sortedBrandValue</button></td>
43
 				   #else
55
 				   #else
44
				<td><b>-</b></td>
56
				<td><b>-</b></td>
45
			      #end
57
			      #end
46
		       #end
58
		       #end
-
 
59
		       #else
-
 
60
		       #foreach($ym in $ym )
-
 
61
		       <td>-</td>
-
 
62
		       #end
-
 
63
		       #end
47
					#if($total != 0.0)
64
			#if($total != 0.0)
48
			   <td><b>$total</b></td>
65
			   <td><b>$total</b></td>
49
			   #else
66
			   #else
50
			   <td><b>0</b></td>
67
			   <td><b>0</b></td>
51
			   #end
68
			   #end
52
			  </tr>
69
			 </tr>
53
				  #end
70
				  #end
54
				 
71
				  #else
55
				 
72
                <tr>
-
 
73
                <td><h3>You do not have any Pending price drop</h3></td>
-
 
74
                 </tr>
56
				  
75
                 #end
57
			</tbody>
76
			</tbody>
58
<div class="price-drop-details-container">
77
<div class="price-drop-details-container">
59
	<div id="priceDropDetailsContainer" class="modal" role="dialog">
78
	<div id="priceDropDetailsContainer" class="modal" role="dialog">
60
		  <div class="modal-dialog modal-md">
79
		  <div class="modal-dialog modal-md">
61
			<!-- Modal content-->
80
			<!-- Modal content-->
Line 71... Line 90...
71
		
90
		
72
	<script>
91
	<script>
73
	$(document).ready(function() {
92
	$(document).ready(function() {
74
	
93
	
75
	$(document).on('click', ".my-price-drop", function() {
94
	$(document).on('click', ".my-price-drop", function() {
76
	var fofoId= $(this).data('id');
95
	  var fofoId= $(this).data('id');
77
		var brand = $(this).closest("tr").children('td:first').text();
96
		var brand = $(this).closest("tr").children('td:first').text();
78
	
97
	
79
  var yearMonth = $(this).closest('table').find('.price-drop-header input[type=hidden]').eq( $(this).closest("td").index()-1).val();
98
  var yearMonth = $(this).closest('table').find('.price-drop-header input[type=hidden]').eq( $(this).closest("td").index()-2).val();
80
    console.log("id"+yearMonth+brand+fofoId);
99
    console.log("id"+yearMonth+brand+fofoId);
81
   doGetAjaxRequestHandler(context + "/getPriceDropDetails?fofoId=" + fofoId  + "&brand=" + brand + "&yearMonth=" + yearMonth, function (response) {
100
   doGetAjaxRequestHandler(context + "/getPriceDropDetails?fofoId=" + fofoId  + "&brand=" + brand + "&yearMonth=" + yearMonth, function (response) {
82
                        $('.price-drop-details-container .modal-content').html(response);
101
                        $('.price-drop-details-container .modal-content').html(response);
83
                    });    
102
                    });    
84
   
103
   
85
   
104
   
86
    }); 
105
    });
-
 
106
    
-
 
107
    $(document).on('click', ".price-drop-six-month", function() {
-
 
108
	  var fofoId= $(this).data('id');
-
 
109
		var brand = $(this).closest("tr").children('td:first').text();
-
 
110
	
-
 
111
     console.log("id"+brand);
-
 
112
      console.log("fofoId"+fofoId);
-
 
113
      
-
 
114
      
-
 
115
   doGetAjaxRequestHandler(context + "/getPriceDropDetailSixMonths?fofoId=" + fofoId  + "&brand=" + brand, function (response) {
-
 
116
                        $('.price-drop-details-container .modal-content').html(response);
-
 
117
                    });    
-
 
118
   
-
 
119
   
-
 
120
    });
-
 
121
     
87
       });       
122
       });       
88
	</script>
123
	</script>
89
		
124
		
90
		
125