Subversion Repositories SmartDukaan

Rev

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