Subversion Repositories SmartDukaan

Rev

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

<script type="text/javascript">
        $(document).ready(function () {
                getEntityAheadOptions($("#typeaheaditem"), function (selectedEntity) {
                        itemCatalogId = selectedEntity.catalogId_i;
                });
        });
</script>




<section class="wrapper">
        <div class="row">
                <div class="col-lg-12">
                        <h3 class="page-header"><i class="icon_document_alt"></i>FOCUSED MODEL</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>Model</li> 
                                </ol>
                </div>
        </div>
                <form>
                        <div class="row">
                                <div class="col-lg-2">
                                        <label class="control-label" for="excelfile">Activated IMEIs upload:</label>
                                </div>
                            <div class="col-lg-3">
                                <div class="input-group">
                                        <input class="form-control" type="file" id="imeiactivations" name="uploadfile">
                                        <span class="input-group-btn">
                                                <button class="btn btn-default imeiactivationsupload">
                                                            Uplaod
                                                        </button>
                                                </span>
                                        </div>
                                </div>
                </div>
            </form>
        
                <form id="focused-model-form">
                <div id="model-detail" style="background:white;background-color:white;padding:10px;">
                        
                        <div>
                                <div class = "row">
                                <div class="col-lg-4 form-group">
                                          <input placeholder="Search Item" type="text" class="form-control typeahead" id="typeaheaditem" name="Item" data-provide="typeahead" autocomplete="off">
                                        </div>
                                        
                                        <div class="col-lg-2 form-group">
                                                <input placeholder="Recommended" id="recommended" name="recommended" type="number" value="" class="form-control input-sm">
                                        </div>
                                        
                                        <div class="col-lg-2 form-group">
                                                <input placeholder="Minimum Quantity" id="minimumQuantity" name="minimumQuantity" type="number" value="" class="form-control input-sm">
                                        </div>
                                        
                                        
                                        <div class="col-lg-2 form-group">
                                                <input placeholder="Observable Recommended" id="obvrecommended" name="obvrecommended" type="number" value="" class="form-control input-sm">
                                        </div>
                                        
                                        <div class="col-lg-2 form-group">
                                                <input placeholder="Observable Minimum Quantity" id="obvminimumQuantity" name="obvminimumQuantity" type="number" value="" class="form-control input-sm">
                                        </div>
                                        
                                        </div>
                                        
                                        <div class = "row">
                                                <div class="col-lg-2">
                                                <select class="form-control input-sm" id = "regionType" name = "regionType">
                                                        <option value="" disabled selected>Region Type</option>
                                                        #foreach($region in $regions)
                                                                <option value="$region.getId()">$region.getName()</option>
                                                        #end
                                                </select>
                                                </div>


                                                <div class="col-lg-2">
                                                        <input class="btn btn-primary add-model" type="button" value="Add">
                                                </div>


                                                <div class="col-lg-3">
                                                        <input class="btn btn-primary send-po-notification" type="button" value="Send Notification">
                                                </div>

                                        </div>


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

   <div class="col-lg-12 form-group">
          <input type="text" id="searchInput" placeholder="Search..." class="form-control pull-right" style="width:150px;">
        </div>
        <div id="focused-model-table">
                <div class="row">
                <div class="col-lg-12">
                                <table class="table table-striped table-advance table-hover" id="myTable" >
                    <thead>
                        <tr>
                                                        <th>Item Name</th>
                            <th>Recommended Quantity </th>
                            <th>Minimum Quantity</th>
                            <th>Observable Recommended Quantity</th>
                            <th>Observable Minimum Quantity</th>
                            <th>Region</th>
                            <th>Created</th>
                            <th>Remove</th>
                        </tr>
                    </thead>
                                <tbody>
                                        #if(!$focusedModels.isEmpty())
                                         #foreach( $request in $focusedModels )
                                           <tr class="focused-item-info" data="$request.getId()">
                                                 <td>$itemMap.get($request.getCatalogId()).getBrand() 
                                                 $itemMap.get($request.getCatalogId()).getModelName()
                                                 $itemMap.get($request.getCatalogId()).getModelNumber()
                                                 ($itemMap.get($request.getCatalogId()).getCatalogItemId())
                                                 </td>
                                                 <td>$request.getRecommendedQty()</td>
                                                 <td>$request.getMinimumQty()</td>
                                                 
                                                 <td>$request.getObsRecommendedQty()</td>
                                                 <td>$request.getObsMinimumQty()</td>
                                                 
                                                  <td>$regionMap.get($request.getRegionId()).getName()</td>
                                                 
                                                  <td>$request.getCreatedTimestamp().format($dateTimeFormatter)</td>
                                                  
                                                   <td><button class="btn btn-primary remove-model"  data-requestid="$request.getId()" type="button" >Remove</button></td>
                                           </tr>        
                                      #end
                                        #else
                                           <tr>
                                                  <td colspan="12" style="text-align:center;">NO MATCHING DATA FOUND FOR CRITERIA</td>
                                           </tr>
                                   #end
                                </tbody>
                        </table>
                </div>
            </div>
    </div>
    
        #if(!$focusedModels.isEmpty())
        <div class="row" id="focused-model-paginated">
                        <div class="col-lg-9">
                        <p>Showing <span class="start">$start</span> to <span class="end">$end</span> of <span class="size">$size</span> items</p>
                        </div>
                        <div class="col-lg-4" style="text-align:right;float:right">
                                <div class="btn-group" style="width:40%">
                                        <button class="btn btn-primary previous" disabled="disabled" style="width:100%">Previous</button>
                                </div>
                                <div class="btn-group" style="width:40%">
                                        #if($end >= $size)
                                                <button class="btn btn-primary next" style="width:100%" disabled="disabled">Next</button>
                                        #else
                                                <button class="btn btn-primary next" style="width:100%">Next</button>
                                        #end
                                </div>
                </div>
            </div>
    #end
    </div>
</section>

<div id="focused-model-container" style="background:white;background-color:white;">
</div>
<script>
    // Function to perform the table row filtering
    function filterTable() {
        var input, filter, table, tr, td, i, txtValue;
        input = document.getElementById("searchInput");
        filter = input.value.toUpperCase();
        table = document.getElementById("myTable");
        tr = table.getElementsByTagName("tr");

        for (i = 0; i < tr.length; i++) {
            td = tr[i].getElementsByTagName("td")[0]; // Change index based on the column you want to search
            if (td) {
                txtValue = td.textContent || td.innerText;
                if (txtValue.toUpperCase().indexOf(filter) > -1) {
                    tr[i].style.display = "";
                } else {
                    tr[i].style.display = "none";
                }
            }
        }
    }

    // Attach an event listener to the search input
    document.getElementById("searchInput").addEventListener("input", filterTable);
</script>