<?php 
  $header_file=APPPATH.'views/include/header.php';
  require($header_file);
  $sidenav_file=APPPATH.'views/include/sidenav.php';
  require($sidenav_file); ?>
<!-- BEGIN: Content-->
    <div class="app-content content">
      <div class="content-overlay"></div>
      <div class="content-wrapper">
        <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">Purchase Order Closed 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">Purchase Order Closed List
                  </li>
                </ol>
              </div>
            </div>
          </div>
         
        </div>
        <div class="content-body"><section class="card">
  <div id="invoice-template" class="card-body p-4">
    <!-- Invoice Company Details 
    <div id="invoice-company-details" class="row">
      <div class="col-sm-6 col-12 text-center text-sm-left">
        <div class="media row">
          <div class="col-12 col-sm-3 col-xl-2">
            <img src="../../../app-assets/images/logo/logo-80x80.png" alt="company logo" class="mb-1 mb-sm-0" />
          </div>
          <div class="col-12 col-sm-9 col-xl-10">
            <div class="media-body">
              <ul class="ml-2 px-0 list-unstyled">
                <li class="text-bold-800">Modern Creative Studio</li>
                <li>4025 Oak Avenue,</li>
                <li>Melbourne,</li>
                <li>Florida 32940,</li>
                <li>USA</li>
              </ul>
            </div>
          </div>
        </div>
      </div>
      <div class="col-sm-6 col-12 text-center text-sm-right">
        <h2>INVOICE</h2>
        <p class="pb-sm-3"># INV-001001</p>
        <ul class="px-0 list-unstyled">
          <li>Balance Due</li>
          <li class="lead text-bold-800">$12,000.00</li>
        </ul>
      </div>
    </div>-->
    <!-- Invoice Company Details -->

    <!-- Invoice Customer Details 
    <div id="invoice-customer-details" class="row pt-2">
      <div class="col-12 text-center text-sm-left">
        <p class="text-muted">Bill To</p>
      </div>
      <div class="col-sm-6 col-12 text-center text-sm-left">
        <ul class="px-0 list-unstyled">
          <li class="text-bold-800">Mr. Bret Lezama</li>
          <li>4879 Westfall Avenue,</li>
          <li>Albuquerque,</li>
          <li>New Mexico-87102.</li>
        </ul>
      </div>
      <div class="col-sm-6 col-12 text-center text-sm-right">
        <p><span class="text-muted">Invoice Date :</span> 06/05/2019</p>
        <p><span class="text-muted">Terms :</span> Due on Receipt</p>
        <p><span class="text-muted">Due Date :</span> 10/05/2019</p>
      </div>
    </div>-->
    <!-- Invoice Customer Details -->

    <!-- Invoice Items Details -->
    <div id="invoice-items-details" class="pt-2">
      <div class="row">
        <div class="table-responsive col-12">
        <?php
          foreach($grn_data as $grn)
        ?>
          <table class="table table-bordered table-responsive-lg">
          
            <thead>
              <tr>
                <th>PO  No</th>
                <th>PO Date</th>
                <th>Supplier Name</th>
              </tr>
              <tr>
                <th><?php echo $grn->purchase_no; ?></th>
                <th><?php echo  $grn->purchase_date; ?></th>
                <th><?php echo  $grn->venders_name; ?></th>
              </tr>
            </thead>
        </table>
            <table class="table table-bordered table-responsive-lg">
            <thead>
              <tr>
                <th>GRN No</th>
                <th>GRN Date</th>
                <th>GRN Amount</th>
                <th>View</th>
              </tr>
            </thead>
            <tbody>
              <?php
              
                $count = 1;
                foreach($grn_data as $grns){
                  ?>
                  <tr>
                  <td><?php echo $grns->grn_no; ?></td>
                  <td><?php echo $grns->grn_date; ?></td>
                  <td><?php echo $grns->sum_amount; ?></td>
                  <td class="uk-text-nowrap">
                         
                    <a class="grid-form-dialog-btn btn btn-primary btn-sm" href="#medlist"  onclick="javascript:load_marks(<?php echo $grns->mid; ?>)" >View</a> 
                   
          
                  </td>
                </tr>
                  
              <?php $count++; } ?>  
             
            </tbody>
          </table>
        </div>
      </div>
  
    </div>

  </div>
  
</section>

<!-- // Basic form layout section end -->
        </div>
      </div>
    </div>
    <?php //require('include/theme_customizer.php');?>

   <?php 
  $footer_file=APPPATH.'views/include/footer.php';
  require($footer_file);
  ?>

<script>
function load_marks(mid)
{
  $.ajax({
      type: "POST",
      url: "<?php echo site_url('Purchase/grn_single_recipt');?>",
      data: "mid="+mid,
      success: function (response) {
        // alert(response);
        $(".grid-form-dialog").html(response);
        }
     });
  }
</script>
<div class="grid-form-dialog" id="" title="View List">
<?php include('single_view.php'); ?>
</div>
