<?php 
	$header_file=APPPATH.'views/include/header.php';
	require($header_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">BOM 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="#">BOM</a>
                  </li>
                  <li class="breadcrumb-item active">BOM List
                  </li>
                </ol>
              </div>
            </div>
          </div>
        
        </div>
        <div class="content-body"><!-- Zero configuration table -->
<section id="configuration">
    <div class="row">
        <div class="col-md-12">
            <div class="card">
                <!--<div class="card-header">
                    <h4 class="card-title">BOM 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">
                        <div class="table-responsive">
							<table class="table table-striped table-bordered dataex-html5-export">
                                <thead>
                                    <tr>
                                        <th>Sl No</th>
                                        <th>Date</th>
										<th>BOM No</th>
										<th>Chef</th>
										<th>View</th>
									</tr>
                                </thead>
                                <tbody>
								 <?php
									$count =1;
									foreach($bom_list as $b_list)
									{
								?>
                                    <tr>
                                      <td><?php echo $count; ?></td>
									<td><?php echo date('d-m-Y',strtotime($b_list->orderdate)); ?></td>
									<td><?php echo $b_list->bill_id; ?></td>
									<td><?php echo $b_list->chef; ?></td>
									<?php if($b_list->store_status == 'Pending') { ?>
									<td class="uk-text-nowrap">
										<a href="#" bill-id="<?php echo $b_list->billno; ?>" class="btn btn-sm btn-info issue_status">Issue</a>
									</td>
									<?php } else { ?>
										<td class="uk-text-nowrap">
											<button class="btn btn-sm btn-warning disabled">Issue</button>
										</td>
									<?php } ?>
								</tr>
                                    
                                   <?php
								  $count++;
								}
							  
							?>
							    </tbody>
                            </table>
								
								
                        </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>
	$(document).on("click",".issue_status",function(){
		var bill_id=$(this).attr('bill-id');
			$.ajax({
			type: "POST",
			dataType:'json',
			data : { bill_id : bill_id},
			url: "<?php echo base_url();?>index.php/Production/change_issue_status",
			success: function(dataz) { 
				var data = $.trim(dataz);
				
				setInterval(function(){
						window.location.reload(true);
					}, 400);
			}
		});
	});
</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>