Subversion Repositories SmartDukaan

Rev

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