Subversion Repositories SmartDukaan

Rev

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