Subversion Repositories SmartDukaan

Rev

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