Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
23914 govind 1
<script type="text/javascript">
28928 amit.gupta 2
	start=moment("$scheme.getFormattedEndDateTime()", "DD/MM/YYYY");
28930 amit.gupta 3
	startDate = start.format(moment.HTML5_FMT.DATETIME_LOCAL_SECONDS);
28929 amit.gupta 4
	$('input[name="extendScheme"]').daterangepicker($.extend(getSingleDatePicker(),{"drops": "up", "startDate":start}), dateRangeCallback);
28918 amit.gupta 5
 
23914 govind 6
  		 $(".add-scheme").click(function(){
7
        $("#newItemToSchemeModal").modal({backdrop: false});
8
    });
9
  		$("#newItemToSchemeModal").on('hidden.bs.modal', function () {
10
            $("#addSchemeForm").trigger("reset");
11
  });
12
	    </script>
22860 ashik.ali 13
<h3 style="padding-left:3%;padding-top:2%;font-weight:bold;">Scheme Id : $scheme.getId()</h3>
23914 govind 14
 
22860 ashik.ali 15
<div class="row" style="padding-left:3%;">
23343 ashik.ali 16
	<div class="col-lg-4">
24445 amit.gupta 17
	<table><tr>
23914 govind 18
		<td>
23343 ashik.ali 19
		#if($scheme.getActiveTimestamp())
20
			<span>Activated On : $scheme.getFormattedActiveTimestamp()</span>
22860 ashik.ali 21
			<p></p>
23343 ashik.ali 22
		#end
23
		#if($scheme.getExpireTimestamp())
24
			<span>Expired On : $scheme.getFormattedExpireTimestamp()</span>
28927 amit.gupta 25
			<p></p>
23343 ashik.ali 26
		#end
23914 govind 27
		</td>
29899 tejbeer 28
		#if($isAdmin && $fullAccess)
24445 amit.gupta 29
		<td><button class="btn btn-sm btn-primary add-scheme" data="$scheme.getId()" style="width:100%;background-color:#007aff;color:white;padding-right: 10px" data-toggle="modal" data-target="#newItemToSchemeModal">Add Item</button></td>
30
		#end
31
		<tr></table>
23343 ashik.ali 32
		<table class="table table-striped table-advance table-hover">
33
			<tbody>
23914 govind 34
				<tr>	
23343 ashik.ali 35
					<th>Item Id</th>
36
					<th>Description</th>
29899 tejbeer 37
					#if($isAdmin && $fullAccess)
24445 amit.gupta 38
					<th>Delete Item</th>
23914 govind 39
					#end
23343 ashik.ali 40
				</tr>
23914 govind 41
				#if($scheme.getItemStringMap().size()>0)
23343 ashik.ali 42
    			#foreach( $itemIdDescriptionEntry in $scheme.getItemStringMap().entrySet())
43
    				<tr data="$itemId">
44
    					<td>$itemIdDescriptionEntry.key</td>
45
    					<td>$itemIdDescriptionEntry.value</td>
29899 tejbeer 46
    					#if($isAdmin && $fullAccess)
23914 govind 47
    					<td><button class="btn btn-primary delete-schemes" data-schemeid="$scheme.getId()" data-itemid="$itemIdDescriptionEntry.key">Delete</button>
48
    					#end
23343 ashik.ali 49
    				</tr>
50
    			#end
23914 govind 51
    			#else
52
    					<tr>
53
		    					<td colspan="12" style="text-align:center;">NO ITEM FOUND FOR SCHEME</td>
54
		    				</tr>
55
    				#end
23343 ashik.ali 56
			</tbody>
57
    	</table>
58
		<p></p>
29899 tejbeer 59
        #if($isAdmin && $fullAccess)
22860 ashik.ali 60
			<span>Created By : $scheme.getCreatedBy()</span>
61
			<p></p>
62
			#if((!$scheme.getActiveTimestamp()) && (!$scheme.getExpireTimestamp()))
63
				<div class="btn-group" style="width:40%">
23181 ashik.ali 64
					<button class="btn active-scheme" data="$scheme.getId()" style="width:100%;background-color:#e98c8f;color:white;">Active</button>
22860 ashik.ali 65
				</div>
66
			#else
67
				#if(($scheme.getActiveTimestamp()) && (!$scheme.getExpireTimestamp()))
23914 govind 68
				<table>
25068 amit.gupta 69
					<td>
70
						<div class="scheme-extend">			
71
				    		<div class="row">
72
					    		<div class="col-lg-12">
73
									<div class="input-group" style="width:80%">
74
											<input type = "hidden" value="$scheme.getId()" id="schemeId">
28919 amit.gupta 75
											<input  placeholder = "Extend Date Time" id="extendScheme" name="extendScheme" type="text" class="form-control">
25069 amit.gupta 76
											 <span class="input-group-btn"> <button class="btn btn-primary extendScheme" id="extendScheme-button" type="button">Extend</button></span>
25068 amit.gupta 77
									</div>
78
								</div>	
79
							</div>
80
	       				</div>
23914 govind 81
					</td>
25068 amit.gupta 82
					<td>
83
						<div class="input-group" style="width:80%">
84
							<input type = "hidden" value="$scheme.getId()" id="schemeId">
28919 amit.gupta 85
							<input  placeholder = "Expire Time" name="extendScheme" type="text" class="form-control expireTime">
25068 amit.gupta 86
							<span class="input-group-btn"> 
25069 amit.gupta 87
								<button class="btn btn-primary expire-scheme" data="$scheme.getId()">Expire</button>
25068 amit.gupta 88
							</span>
89
						</div>
90
					</td>
91
				</table>
92
				<br><br>
22860 ashik.ali 93
				#end
94
			#end
23343 ashik.ali 95
		#end
22860 ashik.ali 96
	</div>
26318 tejbeer 97
<div id="newItemToSchemeModal" class="modal" role="dialog">
23914 govind 98
				  <div class="modal-dialog">
99
 
100
				    <!-- Modal content-->
101
				    <div class="modal-content">
102
				      <div class="modal-header">
103
				        <button type="button" class="close" data-dismiss="modal">&times;</button>
104
				        <h4 class="modal-title"><b>Add Item To Scheme</b></h4>
105
				      </div>
106
				      <div class="modal-body">
107
			      		<form id="addSchemeForm">
108
						  <div class="form-group row">
109
						  	<div class="col-lg-4" style="display: none;">
110
						  		<label for="schemeId">SchemeId</label>
111
							    <input type="number" class="form-control"  value="$scheme.getId()" id="schemeids" readonly>
112
							</div>
113
							<div class="col-lg-4">
114
							    <label for="ItemId"><b>ItemId</b></label>
115
							    <input type="text" class="form-control" id="itemids" placeholder="Item Id"/>
116
							</div>
117
						  </div>
118
						</form>
119
				      </div>
120
				      <div class="modal-footer">
23928 govind 121
						  <button type="button" class="btn btn-primary add-item">Add-Item</button>
23914 govind 122
				        <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
123
				      </div>
124
				    </div>
125
 
126
				  </div>
127
				  </div>
22860 ashik.ali 128
</div>