Subversion Repositories SmartDukaan

Rev

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

<script type="text/javascript">
    $('input[name="extendSchemeById"]').daterangepicker($.extend(getSingleDatePicker(), {
        "drops": "up",
    }));
    $('input[name="expireSchemeById"]').daterangepicker($.extend(getSingleDatePicker(moment("$scheme.getEndDateTime()")), {
        "drops": "up",
    }));

    $(".add-scheme").click(function () {
        $("#newItemToSchemeModal").modal({backdrop: false});
    });
    $("#newItemToSchemeModal").on('hidden.bs.modal', function () {
        $("#addSchemeForm").trigger("reset");
    });
</script>
<h3 style="padding-left:3%;padding-top:2%;font-weight:bold;">Scheme Id : $scheme.getId()</h3>

<div class="row" style="padding-left:3%;">
    <div class="col-lg-12">
        <table>
            <tr>
                <td>
                    #if($scheme.getActiveTimestamp())
                        <span>Activated On : $scheme.getFormattedActiveTimestamp()</span>
                        <p></p>
                    #end
                    #if($scheme.getExpireTimestamp())
                        <span>Expired On : $scheme.getFormattedExpireTimestamp()</span>
                        <p></p>
                    #end
                </td>
                #if($isAdmin && $fullAccess)
                    <td>
                        <button class="btn btn-sm btn-primary add-scheme" data="$scheme.getId()"
                                style="width:100%;background-color:#007aff;color:white;padding-right: 10px"
                                data-toggle="modal" data-target="#newItemToSchemeModal">Add Item
                        </button>
                    </td>
                #end
            <tr>
        </table>
        <table class="table table-striped table-advance table-hover">
            <tbody>
            <tr>
                <th>Model ID</th>
                <th>Model Name</th>
                #if($isAdmin && $fullAccess)
                    <th>Action</th>
                #end
            </tr>
                #if($scheme.getCatalogStringMap().size()>0)
                    #foreach( $catalogIdDescriptionEntry in $scheme.getCatalogStringMap().entrySet())
                    <tr data-catalogid="$catalogIdDescriptionEntry.getKey()">
                        <td>$catalogIdDescriptionEntry.getKey()</td>
                        <td>$catalogIdDescriptionEntry.getValue()</td>
                        #if($isAdmin && $fullAccess)
                        <td>
                            <button class="btn btn-primary delete-schemes" data-schemeid="$scheme.getId()"
                                    data-catalogid="$catalogIdDescriptionEntry.getKey()">Delete
                            </button>
                        #end
                    </tr>
                    #end
                #else
                <tr>
                    <td colspan="12" style="text-align:center;">NO ITEM FOUND FOR SCHEME</td>
                </tr>
                #end
            </tbody>
        </table>
        <p></p>
        #if($isAdmin && $fullAccess)
            <span>Created By : $scheme.getCreatedBy()</span>
            <p></p>
            #if((!$scheme.getActiveTimestamp()) && (!$scheme.getExpireTimestamp()))
                <div class="btn-group" style="width:40%">
                    <button class="btn active-scheme" data="$scheme.getId()"
                            style="width:100%;background-color:#e98c8f;color:white;">Active
                    </button>
                </div>
            #else
                #if(($scheme.getActiveTimestamp()) && (!$scheme.getExpireTimestamp()))
                    <table>
                        <td>
                            <div class="scheme-extend">
                                <div class="row">
                                    <div class="col-lg-12">
                                        <div class="input-group" style="width:80%">
                                            <input type="hidden" value="$scheme.getId()" id="schemeId">
                                            <input placeholder="Extend Date Time" id="extendSchemeById" type="text"
                                                   class="form-control" name="extendSchemeById">
                                            <span class="input-group-btn"> <button
                                                    class="btn btn-primary extendSchemeById"
                                                    id="extendScheme-button"
                                                    type="button">Extend</button></span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </td>
                        <td>
                            <div class="input-group" style="width:80%">
                                <input type="hidden" value="$scheme.getId()" id="schemeId">
                                <input placeholder="Expire Time" type="text"
                                       class="form-control expireTime" id="exprireScheme" name="expireSchemeById">
                                <span class="input-group-btn">
                                                                <button class="btn btn-primary expire-scheme" data="$scheme.getId()">Expire</button>
                                                        </span>
                            </div>
                        </td>
                    </table>
                    <br><br>
                #end
            #end
        #end
    </div>
    <div id="newItemToSchemeModal" class="modal" role="dialog">
        <div class="modal-dialog">

            <!-- Modal content-->
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                    <h4 class="modal-title"><b>Add Item To Scheme</b></h4>
                </div>
                <div class="modal-body">
                    <form id="addSchemeForm">
                        <div class="form-group row">
                            <div class="col-lg-4" style="display: none;">
                                <label for="schemeId">SchemeId</label>
                                <input type="number" class="form-control" value="$scheme.getId()" id="schemeids"
                                       readonly>
                            </div>
                            <div class="col-lg-4">
                                <label for="ItemId"><b>ItemId</b></label>
                                <input type="text" class="form-control" id="catalogids" placeholder="Item Id"/>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary add-item">Add-Item</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
                </div>
            </div>

        </div>
    </div>
</div>