 <script>

 $(document).ready(function(){
 
        $("#IGRNO").select2();
		$("#PurchaseOrderNoview").select2();
        $("#InvoiceDate").datepicker({
            //minDate : d,
            maxDate : 'now',
            dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
        });
   });
	// For table 
	(function(l,q){var e=function(b,c){b.extend(!0,c.defaults,{dom:"<'row'<'col-sm-9'l><'col-sm-3'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-8'i><'col-sm-4'p>>",renderer:"bootstrap"});b.extend(c.ext.classes,{sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm"});c.ext.renderer.pageButton.bootstrap=function(g,e,r,s,i,m){var t=new c.Api(g),u=g.oClasses,j=g.oLanguage.oPaginate,d,f,n=0,p=function(c,e){var k,h,o,a,l=function(a){a.preventDefault();
b(a.currentTarget).hasClass("disabled")||t.page(a.data.action).draw(!1)};k=0;for(h=e.length;k<h;k++)if(a=e[k],b.isArray(a))p(c,a);else{f=d="";switch(a){case "ellipsis":d="&hellip;";f="disabled";break;case "first":d=j.sFirst;f=a+(0<i?"":" disabled");break;case "previous":d=j.sPrevious;f=a+(0<i?"":" disabled");break;case "next":d=j.sNext;f=a+(i<m-1?"":" disabled");break;case "last":d=j.sLast;f=a+(i<m-1?"":" disabled");break;default:d=a+1,f=i===a?"active":""}d&&(o=b("<li>",{"class":u.sPageButton+" "+
f,id:0===r&&"string"===typeof a?g.sTableId+"_"+a:null}).append(b("<a>",{href:"#","aria-controls":g.sTableId,"data-dt-idx":n,tabindex:g.iTabIndex}).html(d)).appendTo(c),g.oApi._fnBindAction(o,{action:a},l),n++)}},h;try{h=b(q.activeElement).data("dt-idx")}catch(l){}p(b(e).empty().html('<ul class="pagination"/>').children("ul"),s);h&&b(e).find("[data-dt-idx="+h+"]").focus()};c.TableTools&&(b.extend(!0,c.TableTools.classes,{container:"DTTT btn-group",buttons:{normal:"btn btn-default",disabled:"disabled"},
collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:"disabled"}},print:{info:"DTTT_print_info"},select:{row:"active"}}),b.extend(!0,c.TableTools.DEFAULTS.oTags,{collection:{container:"ul",button:"li",liner:"a"}}))};"function"===typeof define&&define.amd?define(["jquery","datatables"],e):"object"===typeof exports?e(require("jquery"),require("datatables")):jQuery&&e(jQuery,jQuery.fn.dataTable)})(window,document);
 </script>
 
 <style>
    .modal
	{
		padding-right:25% ! important;
	}
	.select2
	{
		width: 100% ! important;
	}
 </style>
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        <center>Siddharth Industries - Material Receipt And Inspection Report</center>        
      </h1>	  	  	 
    </section>    
    <section class="content"><br/>  
	<div class="row" style="padding-bottom:5%">
		<div class="col-md-12">
			  <div class="col-md-3">								 
						<label>Enter Inward Gate Register Number </label>	
						<div>								 									 
							 <?php
									$options = array("0"=>'Inward Gate Register Number');     
															
						
									echo form_dropdown('IGRNO', $options,set_value('IGRNO'),'id="IGRNO"' ,'class="form-control select2"' , 'required="true"' );

									?>	
						</div> 
					</div>
					<div class="col-md-3">	<br/>
						<a class="btn btn-primary" type="submit" data-toggle="modal" data-target="#Igrshow"  data-dismiss="modal" >IGR Details</a>
					</div> 
		</div>
	</div>		
        <div class="row"> 
		<div class="col-md-12">
            								
				<table id="Inwardgateregistertable"  class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
					<thead style="background-color:#ddf">
						<tr>
						<th>S.NO</th>
						  <th>IGR No</th>
						  <th>PO NO</th>					  
						   
						  <th>Item Code</th>
						  <th>Material</th>
						  <th>Ordered Quantity</th>
						  <th>Received Quantity</th>
						  <th>Accepted Quantity</th>
						  <th>Rejected Quantity</th>
						  <th>Remarks</th>						  
						</tr>
					</thead>
					<tbody>
					<tr>
					<td>1</td>
						<td><a data-toggle="modal" data-target="#materialreport"  data-dismiss="modal" >IGR0001</a></td>
						<td>PO0034</td>
						 
						<td>Sand12</td>
						<td>wast sand</td>
						<td>1000kgs</td>
						<td>1000kgs</td>
						<td>950kgs</td>
						<td>50kgs</td>
						<td>Damage In Bags</td>						
					</tr>
					<tr>
					<td>2</td>
						<td><a data-toggle="modal" data-target="#materialreport"  data-dismiss="modal" >IGR0002</a></td>
						<td>PO0035</td>
						 
						<td>Sand12</td>
						<td>wast sand</td>
						<td>1000kgs</td>
						<td>1000kgs</td>
						 <td>1000kgs</td>
						 <td>0</td>
						 <td>No remarks</td>
					</tr>
					</tbody>					
				</table>
			</div> 
		</div>
        </div>  
			 
			<div class="modal fade" id="materialreport" role="dialog">
				<div class="modal-dialog">
					<!-- Modal content-->
					<form>
						<div class="modal-content" style="width:900px;">
							<div class="modal-header" style="background-color: #3c8dbc;color:#fff;">
								<button type="button" class="close" data-dismiss="modal">&times;</button>
								<center><h4>Inward Gate Register Details After Inspection</h4></center> 
							</div>
							<div class="col-md-12"> 
								<div class="col-md-3">
							 	<label>IGR Number :</label>
								</div>	
								<div class="col-md-3">
									IGR0001
								</div>
								<div class="col-md-3">
								<label>	Purchase Order Number:</label>
								</div>
								<div class="col-md-3">
									PO0034
								</div>
							</div> 
							<div class="col-md-12"> 
								<div class="col-md-3">
							 	<label>Invoice Number :</label>
								</div>	
								<div class="col-md-3">
									Inv12353
								</div>
								<div class="col-md-3">
								<label>Invoice Date:</label>
								</div>
								<div class="col-md-3">
									6/9/2017
								</div>
							</div> 
							 <div class="col-md-12">								
								<div class="col-md-3">
								<label>Vechicle Number :</label> 
								</div>
								<div class="col-md-3">
									 TN G 34 3443
								</div>
								<div class="col-md-3">
								<label>Delivery Date :</label>
								</div>
								<div class="col-md-3">
									09/6/2017
								</div>
							</div>
							 
							<div class="col-md-12">								
								<div class="col-md-3">
								<label>Supplier and Address :</label> 
								</div>
								<div class="col-md-3">
									D.R Enterprises ,153/233,Uthukottai Taluk, Tiruvallur Dist,Chennai,Tamilnadu,Pin code : 602026.
								</div>
								<div class="col-md-3">
								<label>Comments Of Special Instructions :</label>
								</div>
								<div class="col-md-3">
									raw Sand , resin ordered 
								</div>
							</div>
							 
							<div>
							<!-- Table to show the line item of po -->
							<table class="table table-bordered">
								<thead>
									<tr>								 
										<th>SNo</th>
										<th>Item Code</th>
										<th>Item Description</th>
										<th>UOM</th>
										<th>Ordred Quantity</th>
										<th>Received Quantity</th>	
										<th>Accepted Quantity</th>
										<th>Rejected Quantity</th>
										<th>Remarks</th>										
									</tr>
								</thead>								
								<tbody id="tbleAppend">
									<tr>
										<td>1</td>
										<td>RM002</td>
										<td>Raw sand</td>
										<td>Kgs</td>
										<td>10000</td>
										<td>10000</td> 
										<td>10000</td> 
										<td>0</td> 
										<td>No remarks</td> 
									</tr> 	
								</tbody> 
								</table>
							<div class="col-md-12">
								<div class="col-md-4">
								<label>Store Incharge :</label> Muthu 
								</div>
								<div class="col-md-4">
								<label>Quality Incharge :</label> Raja
								</div>
								<div class="col-md-4">
								<label>Plant Incharge :</label> Visvanathan
								</div>
							</div>	
							</div> 
							<div class="modal-footer">
								<a class="btn btn-info" data-dismiss="modal"  value="Cancel">Cancel</a>
							</div>
						</div>
					</form>
				</div>
			</div>	
			<div class="modal fade" id="Igrshow" role="dialog">
				<div class="modal-dialog">
					<!-- Modal content-->
					<form>
						<div class="modal-content" style="width:900px;">
							<div class="modal-header" style="background-color: #3c8dbc;color:#fff;">
								<button type="button" class="close" data-dismiss="modal">&times;</button>
								<center><h4>Inward Gate Register Details</h4></center> 
							</div>
							<div class="col-md-12"> 
								<div class="col-md-3">
							 	<label>IGR Number :</label>
								</div>	
								<div class="col-md-3">
									IGR0001
								</div>
								<div class="col-md-3">
								<label>	Purchase Order Number:</label>
								</div>
								<div class="col-md-3">
									PO0034
								</div>
							</div> 
							<div class="col-md-12"> 
								<div class="col-md-3">
							 	<label>Invoice Number :</label>
								</div>	
								<div class="col-md-3">
									Inv12353
								</div>
								<div class="col-md-3">
								<label>Invoice Date:</label>
								</div>
								<div class="col-md-3">
									6/9/2017
								</div>
							</div> 
							 
							<div class="col-md-12">								
								<div class="col-md-3">
								<label>Supplier and Address :</label> 
								</div>
								<div class="col-md-3">
									D.R Enterprises ,153/233,Uthukottai Taluk, Tiruvallur Dist,Chennai,Tamilnadu,Pin code : 602026.
								</div>
								<div class="col-md-3">
								<label>Comments Of Special Instructions :</label>
								</div>
								<div class="col-md-3">
									raw Sand , resin ordered 
								</div>
							</div>
							<div class="col-md-12" style="padding:2%;"> 
								<div class="col-md-4">
								Store Incharge
								<?php
									 $data = array('name' => 'StoreIncharge','value' => set_value('StoreIncharge'),'id'=>'StoreIncharge',  'class' => 'form-control', 'required'=>'true' );
									echo form_input($data);
									?> 
								</div>
								<div class="col-md-4">
								Quality Incharge
								<?php
									 $data = array('name' => 'QualityIncharge','value' => set_value('QualityIncharge'),'id'=>'QualityIncharge',  'class' => 'form-control', 'required'=>'true' );
									echo form_input($data);
									?> 
								</div>
								<div class="col-md-4">
								Plant Incharge
								<?php
									 $data = array('name' => 'plantIncharge','value' => set_value('plantIncharge'),'id'=>'plantIncharge',  'class' => 'form-control', 'required'=>'true' );
									echo form_input($data);
									?>
								</div>								
							</div>
							<!-- Table to show the line item of po -->
							<table class="table table-bordered">
								<thead>
									<tr>								 
										<th>SNo</th>
										<th>Item Code</th>
										<th>Item Description</th>
										<th>UOM</th>
										<th>Ordred Quantity</th>
										<th>Received Quantity</th>
										<th>Accepted Quantity</th>		<!-- It should be editable for gate keeper -->
										<th>Rejected Quantity</th>		<!-- It should be editable for gate keeper -->
										<th>Remarks</th>	<!-- It should be editable for gate keeper -->
									</tr>
								</thead>								
								<tbody id="tbleAppend">
									<tr>
										<td>1</td>
										<td>RM002</td>
										<td>Raw sand</td>
										<td>Kgs</td>
										<td>10000</td>
										<td>10000</td>
										<td> </td>	<!-- This value will be  given by gate keeper once item received-->	
										<td> </td>	<!-- This value will be  given by gate keeper once item received-->	
										<td> </td>	<!-- This value will be  given by gate keeper once item received-->	
									</tr>										
								</tbody>
  							</table>
							 
							<div class="modal-footer">
							<a class="btn btn-info"  type="submit"  value="submit">Submit</a>
								<a class="btn btn-info" data-dismiss="modal"  value="Cancel">Cancel</a>
							</div>
						</div>
					</form>
				</div>
			</div>
		</section>
	</div>
 <script>
<!-- script for table , It works under the datatable plugin-->
 $(function () { 
    $('#Inwardgateregistertable').DataTable({
      "paging": true,
      "lengthChange": true,
      "searching": true,
      "ordering": true,
      "info": true,
      "autoWidth": true
	   
    }); 
  });
  </script>                          