Subversion Repositories SmartDukaan

Rev

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