Subversion Repositories SmartDukaan

Rev

Rev 35497 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<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>CREATE</li>
                <li><input type="button" value="Create Offer" class="btn btn-primary create-offer"/></li>
            </ol>
        </div>
    </div>
    <div class="row" style="background:white;background-color:white;padding:10px;">
        <div id="create-scheme-form">
            <div class="col-lg-12">
                <div class="col-lg-3">
                    <div class="form-group col-lg-12">
                        <label for="name">Offer Name</label>
                        <input class="form-control" id="offer_name" placeholder="Offer Name" name="name" required>
                    </div>
                    <div class="form-group col-lg-12">
                        <label for="offer_reference">Reference</label>
                        <input class="form-control" id="offer_reference" placeholder="Reference (e.g. Xiaomi-May-2026)" name="reference" required>
                    </div>
                    <div class="form-group col-lg-6">
                        <label for="offerDuration">Duration</label>
                        <input placeholder="Set Duration" name="dateRange" id="offerDuration" name="dateRange"
                               type="text" value="" class="form-control input-sm">
                    </div>
                    <div class="form-group col-lg-6">
                        <label class="checkbox-inline"><input type="checkbox" name="base_criteria"/>Base
                            Criteria</label>
                    </div>
                    <div class="row col-lg-12">
                        <div class="form-group col-lg-6">
                            <label for="name">Sellin = Sellout%</label>
                            <input class="form-control" id="sellinPercentage" placeholder="Sellin Percentage"
                                   name="name" value="0">
                        </div>
                        <div class="form-group col-lg-6">
                            <label for="name">Brand Share%</label>
                            <input class="form-control" id="brandShare" placeholder="" name="name" value="0">
                        </div>
                    </div>
                </div>
                <div class="col-lg-6">
                    <div class="form-group">
                        <div class="col-lg-6">
                            <label>Offer based on</label>
                            <select name="schemeType" class="form-control">
                                <option value="SELLIN">SELLIN</option>
                                <option value="SELLINBOOSTER">SELLIN BOOSTER</option>
                                <option value="ACTIVATION">ACTIVATION</option>
                                <!--<option value="SELLOUT">SELLOUT</option>-->
                            </select>
                        </div>
                        <div class="col-lg-6 form-group activation-brands">
                            <label>Activation Brands</label>
                            <select data-placeholder="Choose brands" multiple="multiple"
                                    class="criteria-brands chosen-select form-control">
                                #foreach($brand in $brands)
                                    <option value="$brand">$brand</option>
                                #end
                            </select>
                        </div>
                    </div>
                    <div class="col-lg-6">
                        <div class="form-group">
                            <label>Target Type</label>
                            <div>
                                <div class="radio-inline"><label><input type="radio" name="targetType" value="VALUE"
                                                                        checked/>VALUE</label></div>
                                <div class="radio-inline"><label><input type="radio" name="targetType"
                                                                        value="QUANTITY"/>QUANTITY</label>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-6">
                        <div class="form-group">
                            <label>Payout Type</label>
                            <div>
                                <div class="radio-inline"><label><input type="radio" name="payoutType" value="VALUE"
                                                                        checked/>VALUE</label></div>
                                <div class="radio-inline"><label><input type="radio" name="payoutType"
                                                                        value="QUANTITY"/>QUANTITY</label>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div clas="form-group col-lg-6">
                        <label class="checkbox-inline"><input type="checkbox" name="discount">Is Discount</label>
                    </div>
                </div>
                <div class="col-lg-3">
                    <div class="col-lg-12">
                        <div class="form-group">
                            <label for="name">Offer Notes Semi-Colon(;) seperated</label>
                            <textarea class="form-control" id="offer_notes" placeholder="Offer Notes"
                                      name="note"></textarea>
                        </div>
                    </div>
                    <div class="col-lg-12">
                        <div class="form-group">
                            <label for="name">Terms Semi-Colon(;) seperated</label>
                            <div id="toolbar-container"></div>
                            <div style="height:40%" class="form-control" id="offer_terms" placeholder="Offer Notes"
                                 name="terms"></div>
                        </div>
                    </div>
                </div>
                <div class="col-lg-12">
                    <!--Partner Criteria Start -->
                    <div class="row">
                        <div class="col-lg-3">
                            <div class="form-group">
                                <label>Partner Types</label>
                                <select data-placeholder="Partner Type" multiple
                                        class="criteria-partner-type chosen-select">
                                    <option value="BRONZE">BRONZE</option>
                                    <option value="SILVER">SILVER</option>
                                    <option value="GOLD">GOLD</option>
                                    <option value="DIAMOND">DIAMOND</option>
                                    <option value="PLATINUM">PLATINUM</option>
                                    <option value="NEW">RISING STAR</option>
                                </select>
                            </div>
                        </div>
                        <div class="col-lg-3">
                            <div class="form-group">
                                <label>Warehouse Regions</label>
                                <select multiple class="criteria-warehouseregion chosen-select">
                                    #foreach ($whRegionEntry in $warehouseRegion.entrySet())
                                        <option value="$whRegionEntry.getKey()">$whRegionEntry.getValue()</option>
                                    #end
                                </select>
                            </div>
                        </div>
                        <div class="col-lg-6 partner">
                            <label>Choose Partners</label>
                            <label class="checkbox-inline">
                                <input type="checkbox" class="excludeFofoId" value=""><b>Exclude</b>
                            </label>
                            <select multiple="multiple" name="partner" id="partners"
                                    data-placeholder="Choose Franchisee" class="chosen-select">
                                #foreach ($customRetailer in $customRetailersMap.entrySet())
                                    <option value="$customRetailer.getKey()">$customRetailer.getValue().getDisplayName()</option>
                                #end
                            </select>
                        </div>
                    </div>
                    <!--Item Criteria Start -->
                    <div class="row itemCriteria item-criteria">
                        <div class="col-lg-3 itemCategory">
                            <div><label>Category</label></div>
                            <label class="checkbox-inline"><input type="checkbox" name="smartphone"/>Smart
                                Phones</label>
                            <label class="checkbox-inline"><input type="checkbox" name="featuredphone"/>Featured Phones</label>
                            <label class="checkbox-inline"><input type="checkbox" name="led"/>LEDs</label>
                            <label class="checkbox-inline"><input type="checkbox" name="tablet"/>Tabs</label>
                            <label class="checkbox-inline"><input type="checkbox" name="smartwatch"/>SmartWatch</label>
                            <label class="checkbox-inline"><input type="checkbox" name="openboxlaptops"/>Open Box
                                Laptops</label>
                        </div>
                        <div class="col-lg-2 row">
                            <div><label>Price Range</label></div>
                            <div class="col-xs-6 row">
                                <input placeholder="Start" type="text" class="form-control startValue" value="0"/>
                            </div>
                            <div class="col-xs-6">
                                <input placeholder="End" type="text" class="form-control endValue" value="0">
                            </div>
                        </div>
                        <div class="col-lg-2">
                            <div class="row col-lg-12 form-group">
                                <div><label>Brand</label></div>
                                <select data-placeholder="Choose brands" multiple="multiple"
                                        class="criteria-brands chosen-select">
                                    #foreach($brand in $brands)
                                        <option value="$brand">$brand</option>
                                    #end
                                </select>
                            </div>
                        </div>
                        <div class="col-lg-4">
                            <div><label>Model</label></div>
                            <div class="row col-lg-12 form-group">
                                <label class="checkbox-inline">
                                    <input type="checkbox" class="exclude" value=""><b>Exclude</b>
                                </label>
                                <select class="criteria-catalogids form-control" multiple="multiple"></select>
                            </div>
                        </div>
                    </div>
                    <!--Item Criteria End -->
                    <!-- Slabs Start -->
                    <div class="slab-payout">
                        <div class="row">
                            <p>
                            <div class="col-lg-1"><label>Slabs</label></div>
                            <button type="button" class="btn btn-primary slab-copy">Copy</button>
                            <button type="button" class="btn btn-primary slab-remove">Remove</button>
                            </p>
                        </div>
                        <div class="row targetslabscontainer">
                            <div class="col-lg-6 targetslabs">
                                <div class="form-group input-group targetContainer">
                                    <span class="input-group-addon">Rs.</span>
                                    <input type="text" style="width:100px" class="form-control payoutTarget" value="0"/>
                                    <span class="input-group-addon">Onward</span>
                                    <input type="text" class="form-control targetDescription"
                                           placeholder="Description"/>
                                </div>
                                #foreach($counter1 in [1..18])
                                    <div class="col-lg-12 itemcriteriapayout item-criteria"
                                         style="border:1px solid #cecece;border-radius:3px;padding-top:6px;padding-bottom:6px;margin-bottom:12px">
                                        <!--Item Criteria filter Start-->
                                        <div class="row">
                                            <div class="col-lg-12 itemCategory">
                                                <label>Category</label>
                                                <label class="checkbox-inline"><input type="checkbox"
                                                                                      name="smartphone"/>Smart
                                                    Phones</label>
                                                <label class="checkbox-inline"><input type="checkbox"
                                                                                      name="featuredphone"/>Featured
                                                    Phones</label>
                                                <label class="checkbox-inline"><input type="checkbox"
                                                                                      name="led"/>LEDs</label>
                                                <label class="checkbox-inline"><input type="checkbox"
                                                                                      name="tablet"/>Tabs</label>
                                                <label class="checkbox-inline"><input type="checkbox"
                                                                                      name="smartwatch"/>Smart Watch</label>

                                                <label class="checkbox-inline"><input type="checkbox"
                                                                                      name="openboxlaptops"/>Open Box
                                                    Laptops</label>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-lg-12"><label>Price Range</label></div>
                                            <div class="col-lg-6 form-group">
                                                <input placeholder="Start" type="text" class="form-control startValue"
                                                       value="0"/>
                                            </div>
                                            <div class="col-lg-6 form-group">
                                                <input placeholder="End" type="text" class="form-control endValue"
                                                       value="0">
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-lg-12 form-group">
                                                <div><label>Brand</label></div>
                                                <select data-placeholder="Choose brands" multiple="multiple"
                                                        class="criteria-brands chosen-select">
                                                    #foreach($brand in $brands)
                                                        <option value="$brand">$brand</option>
                                                    #end
                                                </select>
                                            </div>
                                            <div class="col-lg-12 form-group">
                                                <div class="row col-lg-12 form-group">
                                                    <label class="checkbox-inline">
                                                        <input type="checkbox" class="exclude" value=""><b>Exclude</b>
                                                    </label>
                                                    <select class="criteria-catalogids form-control"
                                                            multiple="multiple">
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="col-lg-12 form-group">
                                                    <label>Start Date</label>
                                                    <input type="date" class="startDate"/>
                                                    <label>End Date</label>
                                                    <input type="date" class="endDate"/>
                                            </div>
                                            <!--Item Criteria filter End -->
                                            <div class="col-lg-12">
                                                <form>
                                                    <h4>Amount Type
                                                        <label class="radio-inline"><input type="radio"
                                                                                           name="amountType$counter1"
                                                                                           value="PERCENTAGE" checked>Percent</label>
                                                        <label class="radio-inline"><input type="radio"
                                                                                           name="amountType$counter1"
                                                                                           value="FIXED">Fixed Per
                                                            Pc</label>
                                                        <label class="radio-inline"><input type="radio"
                                                                                           name="amountType$counter1"
                                                                                           value="SLAB_FIXED">Fixed</label>
                                                    </h4>
                                                </form>
                                            </div>
                                            <div class="col-lg-12"><label>Payout Slabs</label></div>
                                            <div class="col-lg-12 slab-container"></div>
                                        </div>
                                    </div>
                                #end
                            </div>
                        </div>
                    </div>
                    <!-- Slabs end -->
                </div>
            </div>
        </div>
        <!--Div to form-->
    </div>
</section>
<script>
    $(function () {
        $('input[name="dateRange"]').daterangepicker(getRangedDatePicker());
        $('#partners').chosen({
            search_contains: true
        });
        $("select.criteria-brands").chosen({no_results_text: "Oops, nothing found!"});
        $("select.criteria-partner-type").chosen({no_results_text: "Oops, nothing found!"});
        $("select.criteria-warehouseregion").chosen({no_results_text: "Oops, nothing found!"});
        $('input[name=payoutType]').on('change', function () {
            changePayoutType.call(this);
            $('.criteria-catalogids').multiselect({
                includeSelectAllOption: true,
                maxHeight: 400,
                buttonWidth: '240px',
                numberDisplayed: 1,
                nonSelectedText: 'Items',
                nSelectedText: ' - Items Selected',
                allSelectedText: 'All Items Selected',
                enableFiltering: true,
                enableCaseInsensitiveFiltering: true,
            });
            payoutSlabTemplate = $('div.targetslabs').get(0).outerHTML;
            var brandTemplate = $('div.targetslabs').find("select.criteria-brands").get(0).outerHTML;
            $('div.targetslabs').find("select.criteria-brands").chosen({no_results_text: "Oops, nothing found!"});
            $('input[name=payoutType]').off('change').on('change', changePayoutType);
            //console.log(payoutSlabTemplate);
        });
        $('input[name=targetType]').on('change', changeTargetType);
        $('input[name=payoutType]:checked').change();
    });
</script>