Subversion Repositories SmartDukaan

Rev

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