Subversion Repositories SmartDukaan

Rev

Rev 35886 | Rev 36522 | 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>Brand %</th>
98
                        <th>Sellin %</th>
99
                        <th>Partner Criteria</th>
100
                        <th>Item Criteria</th>
101
                        <th>Start</th>
102
                        <th>End</th>
103
                        <th>Created</th>
31605 amit.gupta 104
                        <th>Processed</th>
27875 amit.gupta 105
                        <th>Actions</th>
106
                    </tr>
30651 amit.gupta 107
                        #if(!$offers.isEmpty())
108
                            #foreach( $offer in $offers )
109
                            <tr class="offer-details" data-offerid="$offer.getId()" data-offer-title="">
35745 amit 110
                                <td><a class="mk_offer_detail" href="javascript:void(0)">$offer.getId()</a></td>
30651 amit.gupta 111
                                <td><a class="mk_partner_view" href="javascript:void(0)">$offer.getName()</a></td>
36452 amit 112
                                <td>#if($offer.getReference())$offer.getReference()#else-#end</td>
30651 amit.gupta 113
                                <td>$offer.getPayoutType()</td>
114
                                <td>$offer.getSchemeType()</td>
32027 amit.gupta 115
                                <td>
116
                                    #if ($offer.isDiscount())
117
                                        Discount
118
                                    #else
119
                                        Non Discount
120
                                    #end
121
                                </td>
30651 amit.gupta 122
                                <td>$offer.getBrandShareTerms()</td>
123
                                <td>$offer.getSellinPercentage()</td>
124
                                <td>$offer.getPartnerCriteriaString()</td>
125
                                <td>$offer.getItemCriteriaString()</td>
126
                                <td>$offer.getStartDate().format($dateFormatter)</td>
127
                                <td>$offer.getEndDate().format($dateFormatter)</td>
128
                                <td>$offer.getCreatedOn().format($dateTimeFormatter)</td>
31608 amit.gupta 129
                                #if($offer.getProcessTimestamp())
130
                                    <td>$offer.getProcessTimestamp().format($dateTimeFormatter)</td>
31605 amit.gupta 131
                                #else
132
                                    <td> -</td>
133
                                #end
30651 amit.gupta 134
                                <td>
135
                                    <ul>
136
                                        <li>
137
                                            #if($offer.isActive())
138
                                                <a class="mk_offer_inactive" href="javascript:void(0)">Mark Inactive</a>
139
                                            #else
140
                                                <a class="mk_offer_active" href="javascript:void(0)">Mark Active</a>
141
                                            #end
142
                                        </li>
143
                                        <li><a href="/offerDownload?offerId=$offer.getId()">Download
144
                                            Report</a></li>
30729 amit.gupta 145
                                        <li><a class="process_offer" href="javascript:void(0)">Process Offer</a>
146
                                        </li>
35886 amit 147
                                        <li><a class="manage_offer_partners" href="javascript:void(0)">Manage Partners</a></li>
35857 amit 148
                                        #if(!$offer.isActive())
149
                                        <li><a class="delete_offer" href="javascript:void(0)" style="color:red;">Delete</a></li>
150
                                        #end
30651 amit.gupta 151
                                        #if(!$currentMonth)
152
                                        #end
153
                                    </ul>
154
                                </td>
155
                            </tr>
156
                            #end
157
                        #else
158
                        <tr>
159
                            <td colspan="13" style="text-align:center;">NO MATCHING DATA FOUND FOR CRITERIA</td>
160
                        </tr>
161
                        #end
27875 amit.gupta 162
                    </tbody>
163
                </table>
164
            </div>
26719 tejbeer 165
        </div>
26674 tejbeer 166
    </div>
27875 amit.gupta 167
 
30651 amit.gupta 168
    <div class="modal" id="offerDescription">
169
        <div class="modal-dialog modal-lg">
170
            <div class="modal-content">
171
            </div>
172
        </div>
173
    </div>
27875 amit.gupta 174
</section>
175
 
176
<script type="text/javascript">
30651 amit.gupta 177
    $(function () {
178
        $("#offerDescription").modal('hide');
179
        $('#offerDescription').on('hide.bs.modal', function () {
180
            $(this).find(".modal-content").html("");
181
        });
182
        $("#offer-file-submit").on('click', function () {
183
            var fileSelector = $('#offer-file')[0];
184
            if (fileSelector != undefined && fileSelector.files[0] != undefined) {
185
                if (confirm("Confirm Upload?")) {
186
                    doAjaxUploadRequestHandler(context + "/offers/upload",
187
                            "POST", fileSelector.files[0], function (
188
                                    response) {
189
                                if (response) {
190
                                    alert("Offer added successfully");
191
                                    loadOfferHistory('#main-content', moment(new Date()).format("YYYY-MM"));
192
                                }
193
                            });
194
                }
195
            } else {
196
                alert("Please upload file");
197
            }
198
        });
199
    });
27875 amit.gupta 200
</script>
201
 
26719 tejbeer 202
 
203