Subversion Repositories SmartDukaan

Rev

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