Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
29578 tejbeer 1
<style>
2
.priceTable tr th{
3
 
4
    padding-bottom:6px;
5
}
6
 
7
.priceTable tr td{
8
 
9
    padding-bottom:6px;
10
}
11
 
12
.modal {
13
     left: 1037px;
14
    top: 39px; 
15
 
16
}
17
</style>
18
<section>
19
<table class="table table-striped priceTable"  >
20
	<thead>
21
			 <tr class="price-drop-header">
22
			 	<th>Brand</th>
23
		 		<th>Before $yms.get(0).format($dateYearMonthFormatter)</th>
24
 
25
				#foreach($ym in $yms )
26
				 <th> <input type="hidden" value="$ym.format($dateMonthYearFormatter)"/> $ym.format($dateYearMonthFormatter)</th>
27
				 #end
28
				 <th>Total</th> 
29
			</tr>
30
	</thead>
31
 
32
	<tbody>
33
 
34
	   #foreach($brand in $brands)
35
	     <tr> 
36
		   <td class="brand_name"><b>$brand</b></td>
37
		         #set($total = 0.0)  
38
 
39
 
40
			#if($pendingActivationBeforeSixMonthMap.get($brand))
41
		        <td><button type="button" class="btn btn-primary activation-before-six-month" data-id="$fofoId" data-toggle="modal" data-target="#activationDetailsContainer">$pendingActivationBeforeSixMonthMap.get($brand)</button></td>
42
		          #set($total = $total + $pendingActivationBeforeSixMonthMap.get($brand))
43
		     #else
44
		       <td>-</td>
45
		     #end
46
 
47
 
48
	         #if($sortedBrandValue.get($brand))
49
	         #foreach($sortedBrandValue in $sortedBrandValue.get($brand))
50
	            #set($total = $total + $sortedBrandValue)
51
		           #if($sortedBrandValue != 0.0)				 
52
                     <td><button type="button" class="btn btn-primary activation-yearmonth" data-id="$fofoId" data-toggle="modal" data-target="#activationDetailsContainer">$sortedBrandValue</button></td>
53
 				   #else
54
				     <td><b>-</b></td>
55
			       #end
56
		        #end
57
 
58
		       #end
59
			#if($total != 0.0)
60
			   <td><b>$total</b></td>
61
			   #else
62
			   <td><b>0</b></td>
63
			   #end
64
		</tr>
65
		  #end
66
	</tbody>
67
 
68
 
69
<div class="activation-details-container">
70
	<div id="activationDetailsContainer" class="modal" role="dialog">
71
		  <div class="modal-dialog modal-md">
72
			<!-- Modal content-->
73
			<div class="modal-content"  style="width: 500px;"></div>
74
 
75
		</div>
76
	</div>
77
</div>
78
</table>
79
 
80
 
81
<script>
82
	$(document).ready(function() {
83
 
84
	$(document).on('click', ".activation-yearmonth", function() {
85
	  var fofoId= $(this).data('id');
86
		var brand = $(this).closest("tr").children('td:first').text();
87
 
88
	  var yearMonth = $(this).closest('table').find('.price-drop-header input[type=hidden]').eq( $(this).closest("td").index()-2).val();
89
	    console.log("id"+yearMonth+brand+fofoId);
90
	   doGetAjaxRequestHandler(context + "/getMonthlyActivationItemDetail?fofoId=" + fofoId  + "&brand=" + brand + "&yearMonth=" + yearMonth, function (response) {
91
	                        $('.activation-details-container .modal-content').html(response);
92
	                    });    
93
 
94
 
95
	    });
96
 
97
    $(document).on('click', ".activation-before-six-month", function() {
98
	  var fofoId= $(this).data('id');
99
	  var brand = $(this).closest("tr").children('td:first').text();
100
 
101
     console.log("id"+brand);
102
      console.log("fofoId"+fofoId);
103
 
104
 
105
		   doGetAjaxRequestHandler(context + "/getMonthlyActivationBeforeSixMonthsItemDetail?fofoId=" + fofoId  + "&brand=" + brand, function (response) {
106
		                        $('.activation-details-container .modal-content').html(response);
107
                });    
108
 
109
 
110
 
111
    });
112
 
113
       });       
114
</script>
115
 
116
</section>
117
 
118
 
119