Subversion Repositories SmartDukaan

Rev

Rev 30017 | Rev 30729 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 30017 Rev 30651
Line 53... Line 53...
53
                <div class="row">
53
                <div class="row">
54
                    <div class="col-lg-12">
54
                    <div class="col-lg-12">
55
                        <div class="col-md-3 col-sm-3 col-xs-12 form-group pull-right top_search">
55
                        <div class="col-md-3 col-sm-3 col-xs-12 form-group pull-right top_search">
56
                            <div class="input-group">
56
                            <div class="input-group">
57
                                <input type="file" class="form-control" id="offer-file"
57
                                <input type="file" class="form-control" id="offer-file"
58
                                       placeholder="Uploat Target Offers" />
58
                                       placeholder="Uploat Target Offers"/>
59
                                <span class="input-group-btn">
59
                                <span class="input-group-btn">
60
                      				<button class="btn btn-primary submit" id="offer-file-submit" type="button">Add Offers Using Targets</button>
60
                      				<button class="btn btn-primary submit" id="offer-file-submit" type="button">Add Offers Using Targets</button>
61
                    			</span>
61
                    			</span>
62
                            </div>
62
                            </div>
63
                        </div>
63
                        </div>
64
                        <div class="col-md-3 col-sm-3 col-xs-12 form-group pull-right top_search">
64
                        <div class="col-md-3 col-sm-3 col-xs-12 form-group pull-right top_search">
65
                            <div class="input-group">
65
                            <div class="input-group">
66
                                <input type="month" class="form-control" id="yearmonth"
66
                                <input type="month" class="form-control" id="yearmonth"
67
                                       placeholder="YYYY-MM" />
67
                                       placeholder="YYYY-MM"/>
68
                                <span class="input-group-btn">
68
                                <span class="input-group-btn">
69
                      				<button class="btn btn-primary submit" id="yearmonth-submit" type="button">Go!</button>
69
                      				<button class="btn btn-primary submit" id="yearmonth-submit"
-
 
70
                                            type="button">Go!</button>
70
                    			</span>
71
                    			</span>
71
                            </div>
72
                            </div>
72
                        </div>
73
                        </div>
73
                    </div>
74
                    </div>
74
                </div>
75
                </div>
Line 93... Line 94...
93
                        <th>Start</th>
94
                        <th>Start</th>
94
                        <th>End</th>
95
                        <th>End</th>
95
                        <th>Created</th>
96
                        <th>Created</th>
96
                        <th>Actions</th>
97
                        <th>Actions</th>
97
                    </tr>
98
                    </tr>
98
                    #if(!$offers.isEmpty())
99
                        #if(!$offers.isEmpty())
99
                    #foreach( $offer in $offers )
100
                            #foreach( $offer in $offers )
100
                    <tr class="offer-details" data-offerid="$offer.getId()">
101
                            <tr class="offer-details" data-offerid="$offer.getId()" data-offer-title="">
101
                        <td><a class="mk_offer_detail" href="javascript:void(0)">$offer.getId()</td>
102
                                <td><a class="mk_offer_detail" href="javascript:void(0)">$offer.getId()</td>
102
                        <td><a class="mk_partner_view" href="javascript:void(0)">$offer.getName()</a></td>
103
                                <td><a class="mk_partner_view" href="javascript:void(0)">$offer.getName()</a></td>
103
                        <td>$offer.getTargetType()</td>
104
                                <td>$offer.getTargetType()</td>
104
                        <td>$offer.getPayoutType()</td>
105
                                <td>$offer.getPayoutType()</td>
105
                        <td>$offer.getSchemeType()</td>
106
                                <td>$offer.getSchemeType()</td>
106
                        <td>$offer.getBrandShareTerms()</td>
107
                                <td>$offer.getBrandShareTerms()</td>
107
                        <td>$offer.getSellinPercentage()</td>
108
                                <td>$offer.getSellinPercentage()</td>
108
                        <td>$offer.getPartnerCriteriaString()</td>
109
                                <td>$offer.getPartnerCriteriaString()</td>
109
                        <td>$offer.getItemCriteriaString()</td>
110
                                <td>$offer.getItemCriteriaString()</td>
110
                        <td>$offer.getStartDate().format($dateFormatter)</td>
111
                                <td>$offer.getStartDate().format($dateFormatter)</td>
111
                        <td>$offer.getEndDate().format($dateFormatter)</td>
112
                                <td>$offer.getEndDate().format($dateFormatter)</td>
112
                        <td>$offer.getCreatedOn().format($dateTimeFormatter)</td>
113
                                <td>$offer.getCreatedOn().format($dateTimeFormatter)</td>
113
                        <td>
114
                                <td>
114
                        	<ul>
115
                                    <ul>
115
                        		<li>
116
                                        <li>
116
                        			#if($offer.isActive())
117
                                            #if($offer.isActive())
117
                                        <a class="mk_offer_inactive" href="javascript:void(0)">Mark Inactive</a>
118
                                                <a class="mk_offer_inactive" href="javascript:void(0)">Mark Inactive</a>
118
                                    #else
119
                                            #else
119
									<a class="mk_offer_active" href="javascript:void(0)">Mark Active</a>
120
                                                <a class="mk_offer_active" href="javascript:void(0)">Mark Active</a>
120
									#end
121
                                            #end
121
								</li>
122
                                        </li>
-
 
123
                                        <li><a href="/offerDownload?offerId=$offer.getId()">Download
-
 
124
                                            Report</a></li>
-
 
125
                                        #if(!$currentMonth)
122
                        		<li><a class="download_offer" href="javascript:void(0)">Download Report</a></li>
126
                                            <li><a class="process_offer" href="javascript:void(0)">Process Offer</a>
-
 
127
                                            </li>
-
 
128
                                        #end
123
                        	</ul>
129
                                    </ul>
124
                        </td>
130
                                </td>
125
                    </tr>
131
                            </tr>
126
                    #end
132
                            #end
127
                    #else
133
                        #else
128
                    <tr>
134
                        <tr>
129
                        <td colspan="13" style="text-align:center;">NO MATCHING DATA FOUND FOR CRITERIA</td>
135
                            <td colspan="13" style="text-align:center;">NO MATCHING DATA FOUND FOR CRITERIA</td>
130
                    </tr>
136
                        </tr>
131
                    #end
137
                        #end
132
                    </tbody>
138
                    </tbody>
133
                </table>
139
                </table>
134
            </div>
140
            </div>
135
        </div>
141
        </div>
136
    </div>
142
    </div>
137
 
143
 
138
	<div  class="modal" id="offerDescription">
144
    <div class="modal" id="offerDescription">
139
		<div class="modal-dialog modal-lg">
145
        <div class="modal-dialog modal-lg">
140
		    <div class="modal-content" >
146
            <div class="modal-content">
141
		    </div>
147
            </div>
142
	    </div>
148
        </div>
143
	</div>
149
    </div>
144
</section>
150
</section>
145
 
151
 
146
<script type="text/javascript">
152
<script type="text/javascript">
147
	$(function(){
153
    $(function () {
148
		$("#offerDescription").modal('hide');
154
        $("#offerDescription").modal('hide');
149
		$('#offerDescription').on('hide.bs.modal', function () {
155
        $('#offerDescription').on('hide.bs.modal', function () {
150
		  $(this).find(".modal-content").html("");
156
            $(this).find(".modal-content").html("");
151
		});
157
        });
152
		$("#offer-file-submit").on('click', function(){
158
        $("#offer-file-submit").on('click', function () {
153
			var fileSelector = $('#offer-file')[0];
159
            var fileSelector = $('#offer-file')[0];
154
			if (fileSelector != undefined && fileSelector.files[0] != undefined) {
160
            if (fileSelector != undefined && fileSelector.files[0] != undefined) {
155
				if (confirm("Confirm Upload?")) {
161
                if (confirm("Confirm Upload?")) {
156
					doAjaxUploadRequestHandler(context + "/offers/upload",
162
                    doAjaxUploadRequestHandler(context + "/offers/upload",
157
								"POST", fileSelector.files[0], function(
163
                            "POST", fileSelector.files[0], function (
158
										response) {
164
                                    response) {
159
									if (response) {
165
                                if (response) {
160
										alert("Offer added successfully");
166
                                    alert("Offer added successfully");
161
										loadOfferHistory('#main-content', moment(new Date()).format("YYYY-MM"));
167
                                    loadOfferHistory('#main-content', moment(new Date()).format("YYYY-MM"));
162
									}
168
                                }
163
								});
169
                            });
164
				}
170
                }
165
			} else {
171
            } else {
166
				alert("Please upload file");
172
                alert("Please upload file");
167
			}
173
            }
168
		});
174
        });
169
	});
175
    });
170
</script>
176
</script>
171
 
177
 
172
    
178
    
173
    
179
    
174
180