	<?php $this->load->view("common/header"); ?>
	<!-- end: HEAD -->
       
		<!-- start: CSS REQUIRED FOR THIS PAGE ONLY -->


		
        
		<!-- end: CSS REQUIRED FOR THIS PAGE ONLY -->
	<!-- end: HEAD -->
	<!-- start: BODY -->
	<body>
		<!-- start: HEADER -->
		<div class="navbar navbar-inverse navbar-fixed-top">
			<!-- start: TOP NAVIGATION CONTAINER -->
			<div class="container">
				<div class="navbar-header">
					<!-- start: RESPONSIVE MENU TOGGLER -->
					<button data-target=".navbar-collapse" data-toggle="collapse" class="navbar-toggle" type="button">
						<span class="fa fa-list"></span>
					</button>
					<!-- end: RESPONSIVE MENU TOGGLER -->
					<!-- start: LOGO -->
					<?php $this->load->view("common/logo"); ?>
					<!-- end: LOGO -->
				</div>
				<div class="navbar-tools">
					<!-- start: TOP NAVIGATION MENU -->
				<?php $this->load->view("common/notifications.php"); ?>
					<!-- end: TOP NAVIGATION MENU -->
				</div>
			</div>
			<!-- end: TOP NAVIGATION CONTAINER -->
		</div>
		<!-- end: HEADER -->
		<!-- start: MAIN CONTAINER -->
		<div class="main-container">
			<div class="navbar-content">
				<!-- start: SIDEBAR -->
				<?php $this->load->view("common/navigation"); ?>
				<!-- end: SIDEBAR -->
			</div>
			<!-- start: PAGE -->
			<div class="main-content">
				<!-- end: SPANEL CONFIGURATION MODAL FORM -->
				<div class="container">
					<!-- start: PAGE HEADER -->
					<div class="row">
						<div class="col-sm-12">
							<!-- start: PAGE TITLE & BREADCRUMB -->
							<ol class="breadcrumb">
								<li>
									<a href="<?php echo base_url('dashboard'); ?>">
										 Dashboard 
									</a>
								</li>
                                <li>
									<a href="#">
										 DO 
									</a>
								</li>
                                                                
								<li class="active">
									DO Manage
							  </li>
								<li class="search-box">
									<form class="sidebar-search">
										<div class="form-group">
											<input type="text" placeholder="Start Searching...">
											<button class="submit">

												<i class="fa fa-search"></i>
											</button>
										</div>
									</form>
								</li>
							</ol>
							<div class="page-header">
								<h1>DO</h1>
							</div>

                            <p>Please use the table below to navigate or filter the results. </p>
						</div>
					</div>
					<!-- end: PAGE HEADER -->
					<!-- start: PAGE CONTENT 
                    <!-- start grid -->
                   <!-- <div class="row">
						<div class="col-md-12">-->
							<!-- start: DYNAMIC TABLE PANEL -->
							
							  <div class="panel-body">
							    <div id="error"></div>
                                <!-- class="col-md-12"-->
                              <div >
											<div class="panel panel-default">
												<div style="font-weight: 700;" class="panel-heading">DO Manage</div>
													<div class="panel-body">
                                                    
                                                    
                                                    
                                                    
 <form role="form" class="form-horizontal" id="create_grn_do_form" action="#"> 
 
 
 <!--Left start-->
<div class="col-sm-3" style="margin-right:4%; display:none"> 
	<div class="form-group">
		<h5>Warehouse *</h5>
		<?php
$hide_warehouse='';
if ($this->session->userdata('ss_group_id')==1 || $this->session->userdata('ss_group_id')==2)
{ 
$hide_warehouse='';
}else{
$hide_warehouse='style="display:none;"';
}

?>														

<select id="" class="form-control" name="">

<?php 
$ss_warehouse_id=$this->session->userdata('ss_warehouse_id'); 
foreach ($warehouse_list as $row)
{
$sel='';
if($ss_warehouse_id==$row->id)
{
$sel=' selected="selected"';
}
?>  

<option value="<?php echo $row->id; ?>" <?php echo $sel; ?>>
<?php echo $row->name; ?>
</option>
<?php }?>

</select>                                          

	</div> 
</div>

<div class="col-sm-3" style="margin-right:4%"> 
	<div class="form-group">
		<h5>EMI No. *</h5>
		<input type="text" class="form-control" name="product_id" id="product_id">
	</div> 
</div>
 <!--Left end-->
 
  <!--Right start-->
  <div class="col-sm-3" style="margin-right:4%"> 
	<div class="form-group">
		<h5>GRN. *</h5>
		<input type="text" class="form-control" name="product_id" id="product_id">
	</div> 
</div>

<div class="col-sm-3" style="margin-right:4%"> 
	<div class="form-group">
		<h5>Supplier. *</h5>
		<input type="text" class="form-control" name="product_id" id="product_id">
	</div> 
</div>

<div class="col-sm-3" style="margin-right:4%"> 
	<div class="form-group">
		<h5>Note. *</h5>
		<input type="text" class="form-control" name="product_id" id="product_id">
	</div> 
</div>

<div class="col-sm-3" style="margin-right:4%"> 
	<div class="form-group">
		<h5>Date*</h5>
		<input id="srh_from_date" name="srh_from_date" type='text' class="form-control date-picker" value="" data-bv-field="date"/>
	</div> 
</div>

<div class="col-sm-3" style="margin-right:4%"> 
	<div class="form-group">
		<h5>New Emi No.</h5>
		<input type="text" class="form-control" name="product_id" id="product_id">
	</div> 
</div>
 <!--Right start-->
 
 
 
 
 
 
 
 
 
 
 
<!-- 
 <input name="product_id" type="text" id="product_id"> -->                                                 
														
                                                        
                                                        
                                                    
                                                    <div class="col-sm-12 pull-right modal-footer">
                                                     
															
															<!-- <input type="submit" name="add_category" value="Search" class="btn btn-primary" onClick="searchDetails()">          -->
                                                            
                                          
            <input type="submit" name="add_category" value="Add<?php //echo $btnText; ?>" class="btn btn-primary">
                       
														
													</div>
   
   
    
         </form>                                         
                                                   

                                                   
                                                    
												</div>
											</div>  
<div class="panel panel-default">

												<div style="font-weight: 700;" class="panel-heading">DO List</div>
													<div class="panel-body">
														
                                                        
                                                                               
                                
                                        <table class="table table-bordered table-condensed table-hover table-striped dataTable" id="unit_table">
									  <thead>
							              <tr>
                                    <th class="col-md-2 text-left">Code</th>
                                    <th>Name</th>
									<th class="col-md-2">Actions</th>
                                    </tr>
							          </thead>
							          <tfoot>
											   <tr>
                                    <th>Code</th>
                                    <th>Name</th>
									<th>Actions</th>
                                    </tr>
								           
						          </table>
								</div>
							</div>
              
                                       
                        
							<!-- end: DYNAMIC TABLE PANEL -->
						<!--</div>
					</div>-->

                    <!-- end grid -->
                    
					
			</div>
			<!-- end: PAGE -->
		</div>
        </div>
		<!-- end: MAIN CONTAINER -->
		<!-- start: FOOTER -->
		
		<!-- end: FOOTER -->
		<!-- start: RIGHT SIDEBAR -->
		<!-- end: RIGHT SIDEBAR -->
		

		<!-- start ajax model -->
		<div id="ajax-modal" class="modal fade" data-backdrop="static" data-keyboard="false" tabindex="-1" style="display: none;"></div>
		<!-- end ajax model -->

		<!-- start: MAIN JAVASCRIPTS -->
		<?php $this->load->view("common/footer_common"); ?>
     
  <a id="modal_pop_up_serial_no" data-toggle="modal" href="#"></a> 
  <input name="product_id" id="product_id" type="hidden" value="0">
  
  <script src="<?php echo base_url(); ?>thems/js/form-validation-grn_do.js"></script>
<script>
	
				
/*jQuery(document).ready(function() {
	FormElements.init();
		$("#srh_customer_id").select2();
		$('.ml12').fadeOut();

});*/

function insertFixedAssetsData(){
	
var fields=$('#create_grn_do_form').serialize();
//alert('create_grn_do_form');
$.post( "<?php echo base_url('fixed_assets/save_fixed_assets'); ?>",fields)
	  .done(function( data ) {
		
	  var obj = jQuery.parseJSON(data);
	 if (obj.status==0) 
	{
		displayNotice('page','Error!')  ;
		/*$('div#error').html('<div class="alert alert-block alert-danger fade in"><button type="button" class="close" data-dismiss="alert">×</button><h4 class="alert-heading"><i class="fa fa-times-circle"></i> Error!</h4>'+obj.validation+'</div>');*/
		$('body').modalmanager('removeLoading');
		$('body').attr('class','');
	} else {
	  $('div#ajax-modal').modal('hide');
	  loadGrid();// load customer data
	  if(obj.type=='E'){
		 displayNotice('page','Fixed Assets has been updated successfully!');
	  }
	  if(obj.type=='A'){
		displayNotice('page','Fixed Assets has been added successfully!')  ;
	  }	
	  
	  setTimeout(
  function() 
  {
	  location.reload(true);
    //do something special
  }, 1000);
  
	  
	}
	  

	  });
return false;
}

jQuery(document).ready(function() {
	FormValidator.init();
	//TableData.init();
	loadGrid();
});


function loadGrid() {

			$('#unit_table').DataTable({
				dom: 'Blfrtip',
				lengthMenu: [[10, 25,100, 500,1000, -1 ], [10, 25,100, 500,1000, "All"]],
				buttons: [
						   { extend: 'print', text: '<i class="fa fa-print fa-2x"></i>',footer: true},
							{ extend: 'excel', text: '<i class="fa fa-file-excel-o fa-2x"></i>',footer: true},
							 { extend: 'pdf', text: '<i class="fa fa-file-pdf-o fa-2x"></i>',footer: true}
							
						],
				"ajax": "<?php echo base_url('unit/list_unit') ?>",
				"bDestroy": true,
				"iDisplayLength": 10,
				 "order": [[ 0, "desc" ]]
			});

		}
			
</script>

     
	</body>
	<!-- end: BODY -->
</html>