Subversion Repositories SmartDukaan

Rev

Rev 36522 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
26674 tejbeer 1
<style>
27875 amit.gupta 2
    .table-striped > tbody > tr:nth-child(odd) > td {
3
        background: white;
4
        background-color: white;
5
    }
6
 
7
    .table-striped > tbody > tr:nth-child(even) > td {
8
        background: white;
9
        background-color: white;
10
    }
11
 
12
    .table-striped > tbody > tr:hover > td,
13
    .table-striped > tbody > tr:hover {
14
        background-color: #e98c8f;
15
        color: white;
16
    }
17
 
18
    .btn:hover {
19
        color: grey;
20
        text-decoration: none;
21
    }
22
 
23
    .btn-primary:hover {
24
        color: grey;
25
        text-decoration: none;
26
    }
27
 
28
    .sale-details {
29
        cursor: pointer;
30
    }
26674 tejbeer 31
</style>
32
 
33
<section class="wrapper">
27875 amit.gupta 34
    <div class="row">
35
        <div class="col-lg-12">
35858 amit 36
            <h3 class="page-header"><i class="icon_document_alt"></i>OFFER HISTORY
37
                <button class="btn btn-success btn-sm" id="publish-all-btn" type="button" style="margin-left:15px;">Publish All</button>
36703 amit 38
                <a class="btn btn-warning btn-sm refresh-offer-cache" href="javascript:void(0)" style="margin-left:5px;">Refresh Cache</a>
35858 amit 39
            </h3>
27875 amit.gupta 40
            <ol class="breadcrumb">
41
                <li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
32381 jai.hind 42
                <li><i class="icon_document_alt"></i>OFFERS</li>
27875 amit.gupta 43
            </ol>
44
        </div>
45
    </div>
46
 
47
    <table style="Width:100%">
48
 
49
        <td align="left" style="Width:20%">
26719 tejbeer 50
        </td>
27875 amit.gupta 51
 
26719 tejbeer 52
        <td style="Width:80%">
27875 amit.gupta 53
            <div id="offer-search">
54
                <div class="row">
55
                    <div class="col-lg-12">
35858 amit 56
                    <div class="col-md-3 col-sm-3 col-xs-12 form-group pull-right top_search">
32381 jai.hind 57
                            <div class="input-group">
58
                                            <span class="input-group-btn">
59
                                         <button class="btn btn-primary submit" id="offer-file-submit" type="button">Add Offers Using Targets</button>
60
                             	</span>
61
                            	</div>
62
                       </div>
27875 amit.gupta 63
                        <div class="col-md-3 col-sm-3 col-xs-12 form-group pull-right top_search">
64
                            <div class="input-group">
29680 amit.gupta 65
                                <input type="file" class="form-control" id="offer-file"
32349 amit.gupta 66
                                       placeholder="Upload Target Offers"/>
32381 jai.hind 67
 
29680 amit.gupta 68
                            </div>
69
                        </div>
32381 jai.hind 70
 
29680 amit.gupta 71
                        <div class="col-md-3 col-sm-3 col-xs-12 form-group pull-right top_search">
72
                            <div class="input-group">
27875 amit.gupta 73
                                <input type="month" class="form-control" id="yearmonth"
30651 amit.gupta 74
                                       placeholder="YYYY-MM"/>
27875 amit.gupta 75
                                <span class="input-group-btn">
30651 amit.gupta 76
                      				<button class="btn btn-primary submit" id="yearmonth-submit"
77
                                            type="button">Go!</button>
29680 amit.gupta 78
                    			</span>
27875 amit.gupta 79
                            </div>
80
                        </div>
81
                    </div>
26719 tejbeer 82
                </div>
27875 amit.gupta 83
            </div>
84
        </td>
85
    </table>
86
    <div id="offer-listings-table">
87
        <div class="row">
88
            <div class="col-lg-12">
89
                <table class="table table-striped table-advance table-hover">
90
                    <tbody>
91
                    <tr>
92
                        <th>Id</th>
93
                        <th>Name</th>
36452 amit 94
                        <th>Reference</th>
28556 amit.gupta 95
                        <th>Payout Type</th>
27875 amit.gupta 96
                        <th>Scheme Type</th>
32027 amit.gupta 97
                        <th>Discount</th>
27875 amit.gupta 98
                        <th>Partner Criteria</th>
99
                        <th>Item Criteria</th>
100
                        <th>Start</th>
101
                        <th>End</th>
102
                        <th>Created</th>
31605 amit.gupta 103
                        <th>Processed</th>
27875 amit.gupta 104
                        <th>Actions</th>
105
                    </tr>
30651 amit.gupta 106
                        #if(!$offers.isEmpty())
107
                            #foreach( $offer in $offers )
108
                            <tr class="offer-details" data-offerid="$offer.getId()" data-offer-title="">
35745 amit 109
                                <td><a class="mk_offer_detail" href="javascript:void(0)">$offer.getId()</a></td>
30651 amit.gupta 110
                                <td><a class="mk_partner_view" href="javascript:void(0)">$offer.getName()</a></td>
36452 amit 111
                                <td>#if($offer.getReference())$offer.getReference()#else-#end</td>
30651 amit.gupta 112
                                <td>$offer.getPayoutType()</td>
113
                                <td>$offer.getSchemeType()</td>
32027 amit.gupta 114
                                <td>
115
                                    #if ($offer.isDiscount())
116
                                        Discount
117
                                    #else
118
                                        Non Discount
119
                                    #end
120
                                </td>
30651 amit.gupta 121
                                <td>$offer.getPartnerCriteriaString()</td>
122
                                <td>$offer.getItemCriteriaString()</td>
123
                                <td>$offer.getStartDate().format($dateFormatter)</td>
124
                                <td>$offer.getEndDate().format($dateFormatter)</td>
125
                                <td>$offer.getCreatedOn().format($dateTimeFormatter)</td>
31608 amit.gupta 126
                                #if($offer.getProcessTimestamp())
36522 amit 127
                                    <td class="processed-timestamp">$offer.getProcessTimestamp().format($dateTimeFormatter)</td>
31605 amit.gupta 128
                                #else
36522 amit 129
                                    <td class="processed-timestamp"> -</td>
31605 amit.gupta 130
                                #end
30651 amit.gupta 131
                                <td>
132
                                    <ul>
133
                                        <li>
134
                                            #if($offer.isActive())
135
                                                <a class="mk_offer_inactive" href="javascript:void(0)">Mark Inactive</a>
136
                                            #else
137
                                                <a class="mk_offer_active" href="javascript:void(0)">Mark Active</a>
138
                                            #end
139
                                        </li>
140
                                        <li><a href="/offerDownload?offerId=$offer.getId()">Download
141
                                            Report</a></li>
30729 amit.gupta 142
                                        <li><a class="process_offer" href="javascript:void(0)">Process Offer</a>
143
                                        </li>
35886 amit 144
                                        <li><a class="manage_offer_partners" href="javascript:void(0)">Manage Partners</a></li>
35857 amit 145
                                        #if(!$offer.isActive())
146
                                        <li><a class="delete_offer" href="javascript:void(0)" style="color:red;">Delete</a></li>
147
                                        #end
30651 amit.gupta 148
                                        #if(!$currentMonth)
149
                                        #end
150
                                    </ul>
151
                                </td>
152
                            </tr>
153
                            #end
154
                        #else
155
                        <tr>
156
                            <td colspan="13" style="text-align:center;">NO MATCHING DATA FOUND FOR CRITERIA</td>
157
                        </tr>
158
                        #end
27875 amit.gupta 159
                    </tbody>
160
                </table>
161
            </div>
26719 tejbeer 162
        </div>
26674 tejbeer 163
    </div>
27875 amit.gupta 164
 
30651 amit.gupta 165
    <div class="modal" id="offerDescription">
166
        <div class="modal-dialog modal-lg">
167
            <div class="modal-content">
168
            </div>
169
        </div>
170
    </div>
27875 amit.gupta 171
</section>
172
 
173
<script type="text/javascript">
30651 amit.gupta 174
    $(function () {
175
        $("#offerDescription").modal('hide');
176
        $('#offerDescription').on('hide.bs.modal', function () {
177
            $(this).find(".modal-content").html("");
178
        });
179
        $("#offer-file-submit").on('click', function () {
180
            var fileSelector = $('#offer-file')[0];
181
            if (fileSelector != undefined && fileSelector.files[0] != undefined) {
182
                if (confirm("Confirm Upload?")) {
183
                    doAjaxUploadRequestHandler(context + "/offers/upload",
184
                            "POST", fileSelector.files[0], function (
185
                                    response) {
186
                                if (response) {
187
                                    alert("Offer added successfully");
188
                                    loadOfferHistory('#main-content', moment(new Date()).format("YYYY-MM"));
189
                                }
190
                            });
191
                }
192
            } else {
193
                alert("Please upload file");
194
            }
195
        });
196
    });
27875 amit.gupta 197
</script>
198
 
26719 tejbeer 199
 
200