Subversion Repositories SmartDukaan

Rev

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

<script type="text/javascript">
        $('input[name="extendScheme"]').daterangepicker($.extend(getSingleDatePicker(),{"drops": "up", "startDate":moment("$scheme.getFormattedEndDateTime()", "DD/MM/YYYY")}), dateRangeCallback);
        
                 $(".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-4">
        <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>moment()
                #end
                </td>
                #if($isAdmin)
                <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>Item Id</th>
                                        <th>Description</th>
                                        #if($isAdmin)
                                        <th>Delete Item</th>
                                        #end
                                </tr>
                                #if($scheme.getItemStringMap().size()>0)
                        #foreach( $itemIdDescriptionEntry in $scheme.getItemStringMap().entrySet())
                                <tr data="$itemId">
                                        <td>$itemIdDescriptionEntry.key</td>
                                        <td>$itemIdDescriptionEntry.value</td>
                                        #if($isAdmin)
                                        <td><button class="btn btn-primary delete-schemes" data-schemeid="$scheme.getId()" data-itemid="$itemIdDescriptionEntry.key">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)
                        <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="extendScheme" name="extendScheme" type="text" class="form-control">
                                                                                         <span class="input-group-btn"> <button class="btn btn-primary extendScheme" 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" name="extendScheme" type="text" class="form-control expireTime">
                                                        <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="itemids" 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>