Subversion Repositories SmartDukaan

Rev

Rev 29914 | Rev 30729 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<style>
    .table-striped > tbody > tr:nth-child(odd) > td {
        background: white;
        background-color: white;
    }

    .table-striped > tbody > tr:nth-child(even) > td {
        background: white;
        background-color: white;
    }

    .table-striped > tbody > tr:hover > td,
    .table-striped > tbody > tr:hover {
        background-color: #e98c8f;
        color: white;
    }

    .btn:hover {
        color: grey;
        text-decoration: none;
    }

    .btn-primary:hover {
        color: grey;
        text-decoration: none;
    }

    .sale-details {
        cursor: pointer;
    }
</style>

<section class="wrapper">
    <div class="row">
        <div class="col-lg-12">
            <h3 class="page-header"><i class="icon_document_alt"></i>OFFERS</h3>
            <ol class="breadcrumb">
                <li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
                <li><i class="icon_document_alt"></i>LISTINGS</li>
            </ol>
        </div>
    </div>

    <table style="Width:100%">

        <td align="left" style="Width:20%">
        </td>


        <td style="Width:80%">

            <div id="offer-search">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="col-md-3 col-sm-3 col-xs-12 form-group pull-right top_search">
                            <div class="input-group">
                                <input type="file" class="form-control" id="offer-file"
                                       placeholder="Uploat Target Offers" />
                                <span class="input-group-btn">
                                                <button class="btn btn-primary submit" id="offer-file-submit" type="button">Add Offers Using Targets</button>
                                        </span>
                            </div>
                        </div>
                        <div class="col-md-3 col-sm-3 col-xs-12 form-group pull-right top_search">
                            <div class="input-group">
                                <input type="month" class="form-control" id="yearmonth"
                                       placeholder="YYYY-MM" />
                                <span class="input-group-btn">
                                                <button class="btn btn-primary submit" id="yearmonth-submit" type="button">Go!</button>
                                        </span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </td>
    </table>
    <div id="offer-listings-table">
        <div class="row">
            <div class="col-lg-12">
                <table class="table table-striped table-advance table-hover">
                    <tbody>
                    <tr>
                        <th>Id</th>
                        <th>Name</th>
                        <th>Target Type</th>
                        <th>Payout Type</th>
                        <th>Scheme Type</th>
                        <th>Brand %</th>
                        <th>Sellin %</th>
                        <th>Partner Criteria</th>
                        <th>Item Criteria</th>
                        <th>Start</th>
                        <th>End</th>
                        <th>Created</th>
                        <th>Actions</th>
                    </tr>
                    #if(!$offers.isEmpty())
                    #foreach( $offer in $offers )
                    <tr class="offer-details" data-offerid="$offer.getId()">
                        <td><a class="mk_offer_detail" href="javascript:void(0)">$offer.getId()</td>
                        <td><a class="mk_partner_view" href="javascript:void(0)">$offer.getName()</a></td>
                        <td>$offer.getTargetType()</td>
                        <td>$offer.getPayoutType()</td>
                        <td>$offer.getSchemeType()</td>
                        <td>$offer.getBrandShareTerms()</td>
                        <td>$offer.getSellinPercentage()</td>
                        <td>$offer.getPartnerCriteriaString()</td>
                        <td>$offer.getItemCriteriaString()</td>
                        <td>$offer.getStartDate().format($dateFormatter)</td>
                        <td>$offer.getEndDate().format($dateFormatter)</td>
                        <td>$offer.getCreatedOn().format($dateTimeFormatter)</td>
                        <td>
                                <ul>
                                        <li>
                                                #if($offer.isActive())
                                        <a class="mk_offer_inactive" href="javascript:void(0)">Mark Inactive</a>
                                    #else
                                                                        <a class="mk_offer_active" href="javascript:void(0)">Mark Active</a>
                                                                        #end
                                                                </li>
                                        <li><a class="download_offer" href="javascript:void(0)">Download Report</a></li>
                                </ul>
                        </td>
                    </tr>
                    #end
                    #else
                    <tr>
                        <td colspan="13" style="text-align:center;">NO MATCHING DATA FOUND FOR CRITERIA</td>
                    </tr>
                    #end
                    </tbody>
                </table>
            </div>
        </div>
    </div>

        <div  class="modal" id="offerDescription">
                <div class="modal-dialog modal-lg">
                    <div class="modal-content" >
                    </div>
            </div>
        </div>
</section>

<script type="text/javascript">
        $(function(){
                $("#offerDescription").modal('hide');
                $('#offerDescription').on('hide.bs.modal', function () {
                  $(this).find(".modal-content").html("");
                });
                $("#offer-file-submit").on('click', function(){
                        var fileSelector = $('#offer-file')[0];
                        if (fileSelector != undefined && fileSelector.files[0] != undefined) {
                                if (confirm("Confirm Upload?")) {
                                        doAjaxUploadRequestHandler(context + "/offers/upload",
                                                                "POST", fileSelector.files[0], function(
                                                                                response) {
                                                                        if (response) {
                                                                                alert("Offer added successfully");
                                                                                loadOfferHistory('#main-content', moment(new Date()).format("YYYY-MM"));
                                                                        }
                                                                });
                                }
                        } else {
                                alert("Please upload file");
                        }
                });
        });
</script>