Subversion Repositories SmartDukaan

Rev

Rev 28455 | Rev 28644 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
28455 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>
28641 amit.gupta 23
					 	<th>Before $yms.get(0).format($dateYearMonthFormatter)</th>
24
						#foreach($ym in $yms )
28455 tejbeer 25
						 <th> <input type="hidden" value="$ym.format($dateMonthYearFormatter)"/> $ym.format($dateYearMonthFormatter)</th>
26
						 #end
28641 amit.gupta 27
						 <th>Total</th> 
28455 tejbeer 28
					</tr>
29
			</thead>
30
 
31
			<tbody>
32
 
28641 amit.gupta 33
			#if(!$sortedBrandValue.isEmpty())
34
 
35
 
36
			 #foreach($brand in $brands)
37
 
38
                    <tr> 
39
 
40
			       <td class="brand_name"><b>$brand</b></td>
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
 
51
		        #foreach($sortedBrandValue in $sortedBrandValue.get($brand))
52
		            #set($total = $total + $sortedBrandValue)
28455 tejbeer 53
		           #if($sortedBrandValue != 0.0)				 
54
                   <td><button type="button" class="btn btn-primary my-price-drop" data-id="$fofoId" data-toggle="modal" data-target="#priceDropDetailsContainer">$sortedBrandValue</button></td>
55
 				   #else
56
				<td><b>-</b></td>
57
			      #end
58
		       #end
28641 amit.gupta 59
		       #else
60
		       #foreach($ym in $ym )
61
		       <td>-</td>
62
		       #end
63
		       #end
64
			#if($total != 0.0)
28455 tejbeer 65
			   <td><b>$total</b></td>
66
			   #else
67
			   <td><b>0</b></td>
68
			   #end
28641 amit.gupta 69
			 </tr>
28455 tejbeer 70
				  #end
28641 amit.gupta 71
				  #else
72
                <tr>
73
                <td><h3>You do not have any Pending price drop</h3></td>
74
                 </tr>
75
                 #end
28455 tejbeer 76
			</tbody>
77
<div class="price-drop-details-container">
78
	<div id="priceDropDetailsContainer" class="modal" role="dialog">
79
		  <div class="modal-dialog modal-md">
80
			<!-- Modal content-->
81
			<div class="modal-content"  style="width: 300px;"></div>
82
 
83
		</div>
84
	</div>
85
</div>
86
 
87
		</table>
88
 
89
</section>
90
 
91
	<script>
92
	$(document).ready(function() {
93
 
94
	$(document).on('click', ".my-price-drop", function() {
28641 amit.gupta 95
	  var fofoId= $(this).data('id');
28455 tejbeer 96
		var brand = $(this).closest("tr").children('td:first').text();
97
 
28641 amit.gupta 98
  var yearMonth = $(this).closest('table').find('.price-drop-header input[type=hidden]').eq( $(this).closest("td").index()-2).val();
28455 tejbeer 99
    console.log("id"+yearMonth+brand+fofoId);
100
   doGetAjaxRequestHandler(context + "/getPriceDropDetails?fofoId=" + fofoId  + "&brand=" + brand + "&yearMonth=" + yearMonth, function (response) {
101
                        $('.price-drop-details-container .modal-content').html(response);
102
                    });    
103
 
104
 
28641 amit.gupta 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
 
28455 tejbeer 122
       });       
123
	</script>
124
 
125