<?php 
  $header_file=APPPATH.'views/include/header.php';
  require($header_file);
  
  ?>
<style type="text/css">
  th {
    white-space: break-spaces;
    padding: 5px;
}
td{
  padding: 5px;
}
</style>
<style>
.dataTables_filter{
    visibility:hidden!important;
}
</style>
    <!-- BEGIN: Content-->
    <div class="app-content content">
      <div class="content-overlay"></div>
      <div class="content-wrapper" ng-app="anglist" ng-controller="anglistctlr">
        <div class="content-header row">
          <div class="content-header-left col-md-12 col-12 mb-2 breadcrumb-new">
            <h3 class="content-header-title mb-0 d-inline-block">GRN (Goods Received Note) List</h3>
            <div class="row breadcrumbs-top d-inline-block">
              <div class="breadcrumb-wrapper col-12">
                <ol class="breadcrumb">
                  <li class="breadcrumb-item"><a href="#">Home</a>
                  </li>
                  <li class="breadcrumb-item"><a href="#">Purchase Order</a>
                  </li>
                  <li class="breadcrumb-item active">GRN (Goods Received Note) List
                  </li>
                </ol>
              </div>
            </div>
          </div>
        
        </div>
        <div class="content-body"><!-- Zero configuration table -->
<section id="configuration">
    <div class="row justify-content-md-right">
       
            <div class="card"  >
                <div class="card-header">
                    <!--<h4 class="card-title">GRN (Goods Received Note) List</h4>-->
                    <a class="heading-elements-toggle"><i class="la la-ellipsis-v font-medium-3"></i></a>
                    <div class="heading-elements">
                        <ul class="list-inline mb-0">
                            <li><a data-action="collapse"><i class="ft-minus"></i></a></li>
                            <li><a data-action="reload"><i class="ft-rotate-cw"></i></a></li>
                            <li><a data-action="expand"><i class="ft-maximize"></i></a></li>
                            <li><a data-action="close"><i class="ft-x"></i></a></li>
                        </ul>
                    </div>
                </div>
                <div class="card-content collapse show">
                    <div class="card-body card-dashboard" infinite-scroll="getResults()">
                       
                        <div class="table-responsive" >
                          <div class="col-md-2" style="float:right;">
                      <div class="form-group">
                                <input type="text" class="form-control" ng-model="search" placeholder="Search Here" >
                                <input type="hidden" name="branch" id="branch" class="form-control" value="CW3"/>
                             </div>
                        </div>
                            <table class="table table-striped table-bordered dataex-html5-export">
                                <thead>
                               
                                    <tr>
                                        <th>Purchase No</th>
                                        <th>Purchase Date</th>
                                        <th>GRN No</th>
                                        <th>GRN Date</th>
                                        <th>Invoice No</th>
                                        <th>Supplier Name</th>
                                        <th>Status</th>
                                        <th>View</th>
                                        <th>Atch</th>
                                    </tr>
                                </thead>
                                <tbody>
                                  <tr ng-repeat="res in results | filter : search">
                                    <td>{{res.purchase_no}}</td>
                                    <td>{{res.purchase_date}}</td>
                                    <td>{{res.grn_no}}</td>
                                    <td>{{res.grn_date}}</td>
                                    <td>{{res.invoice_no}}</td>
                                    <td>{{res.vendor_name}}</td>
                                    <td class="pending_data" ng-if="res.gnr_status == 'Pending' ">{{res.gnr_status}}</td>
                                    <td class="success_data" ng-if="res.gnr_status == 'Approved' ">{{res.gnr_status}}</td>
                                    <td class="hold_data" ng-if="res.gnr_status == 'Holded' ">{{res.gnr_status}}</td>
                                    <td class="uk-text-nowrap">
                                      
                                      <a href="<?php echo site_url('Purchase/cw3grn_view/{{res.mid}}/'.$sub_mod_id.''); ?>" id="view" name="view" class="btn btn-sm btn-primary"><i class="la la-eye "> </i></a>
                                    </td>
                                    <td ng-if="!res.invoice_upload"><img src="<?php echo base_url(); ?>app-assets/images/wrong.png" alt="" class="img_main"/></td>
                                    <td ng-if="res.invoice_upload"><img src="<?php echo base_url(); ?>app-assets/images/right.png" alt="" class="img_main"/></td>
                                  </tr>
                                </tbody>
                        </table>
                        <div ng-show='loading' class='loading'>Loading...</div>
                        </div>
                    </div>
                </div>
            </div>
        
    </div>
</section>
<!--/ Zero configuration table -->



<!--/ Language - Comma decimal place table -->

        </div>
      </div>
    </div>
    <!-- END: Content-->

   <?php //require('include/theme_customizer.php');?>
 <?php 
  $footer_file=APPPATH.'views/include/footer.php';
  require($footer_file);
  ?>
<script>
  $('.param_check').each(function() { $(this).on( {'click contextmenu': function() {
    //contextmenu
    var i = $(this).data('value');
    var anchor = $("a");
    var anchorTarget = $(this).parent().find('.parmetre').val();
    var submodid = $(this).parent().find('.submod_id').val();
    var link = $(this).attr('href');
    $(this).attr("href", link + submodid +'/'+anchorTarget);

    location.reload();
  }
  })
  })
</script>  
  <script type="text/javascript">
             var fetch = angular.module('anglist', ['infinite-scroll']);
            
            fetch.controller('anglistctlr', ['$scope', '$http', function ($scope, $http) {
            
              // Variables
              var branch1 = angular.element(document.getElementById("branch"));
          $scope.branch = branch1.val();
              $scope.row = 0;
              $scope.rowperpage = 12;
              $scope.results = [];
              $scope.busy = false;
              $scope.loading = false;
            
              // Fetch data
              $scope.getResults = function(){
            
              if ($scope.busy) return;
            
                $scope.busy = true;
            
                // Fetch data
                $http({
                  method: 'post',
                  url: '<?php echo base_url() ?>index.php/Purchase/angbranch_grn',
                  data: {row:$scope.row,rowperpage:$scope.rowperpage,branch:$scope.branch}
                }).then(function successCallback(response) {
            
                  if(response.data !='' ){
                     // New row value 
                     $scope.row+=$scope.rowperpage;
            
                     $scope.loading = true;
                     setTimeout(function() {
                        $scope.$apply(function(){
            
                          // Assign response to results Array 
                          angular.forEach(response.data,function(item) {
                             $scope.results.push(item);
                          });
                          $scope.busy = false;
                          $scope.loading = false;
                        });
            
                     },500);
                  }
                });
              }
            
              // Call function
              $scope.getResults();
            
            }]);
            </script>
  </body>
  <!-- END: Body-->

<!-- Mirrored from pixinvent.com/modern-admin-clean-bootstrap-4-dashboard-html-template/html/ltr/vertical-modern-menu-template/form-layout-basic.html by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Apr 2020 09:38:02 GMT -->
</html>