	<?php $this->load->view("common/header"); ?>
	<!-- end: HEAD -->
       
		<!-- start: CSS REQUIRED FOR THIS PAGE ONLY -->
		<link rel="stylesheet" type="text/css" href="<?php echo asset_url(); ?>plugins/select2/select2.css" />
		<link rel="stylesheet" href="<?php echo asset_url(); ?>plugins/DataTables/media/css/DT_bootstrap.css" />
		<link href="<?php echo asset_url(); ?>plugins/bootstrap-modal/css/bootstrap-modal-bs3patch.css" rel="stylesheet" type="text/css"/>
		<link href="<?php echo asset_url(); ?>plugins/bootstrap-modal/css/bootstrap-modal.css" rel="stylesheet" type="text/css"/>
		<link rel="stylesheet" href="<?php echo asset_url(); ?>plugins/bootstrap-fileupload/bootstrap-fileupload.min.css">
		<link rel="stylesheet" href="<?php echo asset_url(); ?>plugins/select2/select2.css">


		<link rel="stylesheet" href="<?php echo asset_url(); ?>plugins/select2/select2.css">
		<link rel="stylesheet" href="<?php echo asset_url(); ?>plugins/datepicker/css/datepicker.css">
		<link rel="stylesheet" href="<?php echo asset_url(); ?>plugins/bootstrap-timepicker/css/bootstrap-timepicker.min.css">
		<link rel="stylesheet" href="<?php echo asset_url(); ?>plugins/bootstrap-daterangepicker/daterangepicker-bs3.css">
		<link rel="stylesheet" href="<?php echo asset_url(); ?>plugins/bootstrap-colorpicker/css/bootstrap-colorpicker.css">
		<link rel="stylesheet" href="<?php echo asset_url(); ?>plugins/jQuery-Tags-Input/jquery.tagsinput.css">
		<link rel="stylesheet" href="<?php echo asset_url(); ?>plugins/bootstrap-fileupload/bootstrap-fileupload.min.css">
		<link rel="stylesheet" href="<?php echo asset_url(); ?>plugins/summernote/build/summernote.css">

		<style type="text/css">
			.table > thead:first-child > tr:first-child > th, .table > thead:first-child > tr:first-child > td, .table-striped thead tr.primary:nth-child(2n+1) th {
			    background-color: #428bca;
			    border-color: #357ebd;
			    border-top: 1px solid #357ebd;
			    color: white;
			    text-align: center;
			}

#s2id_srh_customer_id{
	border: 0 none;
padding: 0;
}

.dataTables_processing{position:absolute;top:50%;left:50%;width:100%;height:40px;margin-left:-50%;margin-top:-25px;padding-top:0px;text-align:center;font-size:2em;background-color:white;background:-webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255,255,255,0)), color-stop(25%, rgba(255,255,255,0.9)), color-stop(75%, rgba(255,255,255,0.9)), color-stop(100%, rgba(255,255,255,0)));background:-webkit-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-o-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);
				}
.ml12 {
  font-weight: 200;
  font-size: 1.8em;
  text-transform: uppercase;
  letter-spacing: 0.5em;
}

.ml12 .letter {
  display: inline-block;
  line-height: 1em;
}
.container_x_overflow{
 width: 100%;
    overflow-x: auto;
    white-space: nowrap;	
}
		</style>
		<!-- 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="clip-list-2"></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="<?php echo base_url('service'); ?>">
										  Stock Reconciliation
									</a>
								</li>
                               
								<li class="active">
									Stock Reconciliation with Department Report
								</li>
								<li class="search-box">
									<form class="sidebar-search">
										<div class="form-group">
											<input type="text" placeholder="Start Searching...">
											<button class="submit">
												<i class="clip-search-3"></i>
											</button>
										</div>
									</form>
								</li>
							</ol>
							<div class="page-header">
								<h1>Stock Reconciliation with Department Report</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 panel-default">
								<div class="panel-heading">
									<i class="fa fa-external-link-square"></i>
									Stock Reconciliation with Department Report
                                    <div class="panel-tools" style="top:2px;">
												<button class="btn btn-blue dropdown-toggle" data-toggle="dropdown">
													<i class="clip-list-5"></i> Add New
												</button>
												<ul class="dropdown-menu dropdown-light pull-right">
														<li>
															<a id="" data-toggle="modal" href="<?php echo base_url('service/manage/0'); ?>">
																<i class="fa fa-plus"></i> Add Service
															</a>
														</li>
														
													</ul>
												</div>
								</div>
								</div>
							  <div class="panel-body">
                              
                                     <!--start search-->    
                 <div class="col-sm-12">
                 
                  <div class="col-md-1 pull-right" style="margin-top:21px;">
                                                        <div class="form-group">
                  <input class="btn btn-primary" value="Search" name="search" id="search" type="submit" onClick="search_by_custum_value()">
                  </div>
                  </div>  
                 <div class="col-sm-3 pull-right" <?php echo 'style="display:none"'; ?>>

                                                      	<div class="form-group">

															<label>Warehouse * </label>
                                                        <select id="warehouse_id" class="form-control" name="warehouse_id">
<?php if ($this->session->userdata('ss_group_id')==1){ ?>
                                                                   <option value="">-- Select Warehouse --</option>
<?php }?>
																  <?php 

																 $ss_warehouse_id=$this->session->userdata('ss_warehouse_id'); 

                                                              foreach ($warehouse_list as $row)

                                                              {

																  $sel='';

																  if($service_details->warehouse_id==$row->id)
																  {
																	  $sel=' selected="selected"';
																  }else if($ss_warehouse_id==$row->id){
																	  $sel=' selected="selected"';
																  }

                                                              ?>  

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

																		<?php echo $row->name; ?>

                                                                        </option>

                                                              <?php }?>

																	</select>

														</div>

														</div>
                                                        
                                                        
<div class="col-sm-3 pull-right">
<div class="form-group">

<?php

//print_r($physical_verifcation_header_list);
?>
<label>Physical Verifcation * </label>
<select id="pvh_id" class="form-control" name="pvh_id">

<?php 

$ss_warehouse_id=$this->session->userdata('ss_warehouse_id'); 
//print_r($physical_verifcation_header_list);

foreach ($physical_verifcation_header_list as $row)

{

$sel='';

if($service_details->warehouse_id==$row->id)
{
//$sel=' selected="selected"';
}else if($ss_warehouse_id==$row->id){
//$sel=' selected="selected"';
}

?>  

<option <?php echo $sel;?> value="<?php echo $row->pvh_id; ?>">

<?php echo $row->pvh_refno; ?> | <?php echo $row->cat_name; ?> | <?php echo $row->pvh_note; ?> | <?php echo site_date($row->pvh_datetime); ?>

</option>

<?php }?>

</select>

</div>

</div>

  <div class="col-sm-3">
                                                      	<div class="form-group">
                                                        
                                                            
															<label for="s2id_autogen1">Search with IMEI Number : <input id="with_emi_no" name="with_emi_no" type="checkbox" value="1">      </label>
                                                      

															
														</div>
													</div>
													
													
													 <div class="col-sm-3">
                                                      	<div class="form-group">
                                                        
                                                            
															<label for="s2id_autogen1">Show All : <input id="show_all" name="show_all" type="checkbox" value="1">      </label>
															
															<br/>
																<label for="s2id_autogen1">Only Show Diff.  <input id="only_show_def" name="only_show_def" type="checkbox" value="1">      </label>
                                                      

															
														</div>
													</div>
                                                    
    <!-- <div class="col-md-3 pull-right">
<div class="form-group">
<label>Item Avalable Showroom/Customer </label><?php //print_r($suppliers);?>
<select id="service_item_avalable" class="form-control" name="service_item_avalable">
<option value="">-- Select --</option>
<option  value="Showroom" <?php if(isset($service_details->service_item_avalable)&& $service_details->service_item_avalable=='Showroom'){echo 'selected';}  ?>>Showroom</option>
<option value="Customer" <?php if(isset($service_details->service_item_avalable)&& $service_details->service_item_avalable=='Customer'){echo 'selected';}  ?>>Customer</option>
<option value="Repair" <?php if(isset($service_details->service_item_avalable)&& $service_details->service_item_avalable=='Repair'){echo 'selected';}  ?>>Repair</option>
</select>
</div>
</div> -->                                                  
                                                       
                 </div> 
                 <!--end search-->   
							    <div id="error"></div>
                                <div class="container_x_overflow">
								  <table class="table table-bordered table-condensed table-hover table-striped dataTable" id="warehouse_table">
									  <thead>
							            <tr>
                                         <th>No.</th>
                                         <th class="col-sm-1">Warehouse</th>
                                         <th class="col-sm-1">Department</th>
                                    <th class="col-sm-1">Brand</th>
                                     <th class="col-sm-1">Type</th>
                                      <th>Item Code </th>
                                    <th class="col-sm-2">Item Name</th>
                                    <th>System Qty</th>
                                    <th>Physical Qty</th>
                                 <!--    <th>Send to <br>
S. Center.</th>
                                    <th>Reserved <br>
S. Center.</th> -->
                                    <th>Dif. Qty</th>
                                    <th>Missing Serial No/ EMI</th>
                                    
                                    </tr>
							          </thead>
							         								           
						          </table>
                                  </div>
								</div>
							</div>
							<!-- end: DYNAMIC TABLE PANEL -->
						</div>
					</div>

                    <!-- end grid -->
                    
					
			</div>
			<!-- end: PAGE -->
		</div>
		<!-- end: MAIN CONTAINER -->
		<!-- start: FOOTER -->
		<div class="footer clearfix">
			<div class="footer-inner">
				<?php date("Y");?> Developed by: Sallelanka Solutions (pvt) Ltd.
			</div>
			<div class="footer-items">
				<span class="go-top"><i class="clip-chevron-up"></i></span>
			</div>
		</div>
		<!-- end: FOOTER -->
		<!-- start: RIGHT SIDEBAR -->
		<!-- end: RIGHT SIDEBAR -->
		<div id="event-management" class="modal fade" tabindex="-1" data-width="760" style="display: none;">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
							&times;
						</button>
						<h4 class="modal-title">Event Management</h4>
					</div>
					<div class="modal-body"></div>
					<div class="modal-footer">
						<button type="button" data-dismiss="modal" class="btn btn-light-grey">
							Close
						</button>
						<button type="button" class="btn btn-danger remove-event no-display">
							<i class='fa fa-trash-o'></i> Delete Event
						</button>
						<button type='submit' class='btn btn-success save-event'>
							<i class='fa fa-check'></i> Save
						</button>
					</div>
				</div>
			</div>
		</div>

		<!-- 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"); ?>
		<!-- end: MAIN JAVASCRIPTS -->
		<script type="text/javascript" src="<?php echo base_url('thems/') ?>/js/jquery.dataTables.min.js"></script>
		<script type="text/javascript" src="<?php echo base_url('thems/') ?>/js/dataTables.bootstrap.min.js"></script>
        
        
            <script type="text/javascript" language="javascript" src="<?php echo asset_url(); ?>js/dataTables.buttons.min.js">
	</script>
	<script type="text/javascript" language="javascript" src="<?php echo asset_url(); ?>js/buttons.print.min.js">
	</script>
	<script type="text/javascript" language="javascript" src="<?php echo asset_url(); ?>js/buttons.flash.min.js">
	</script>
	<script type="text/javascript" language="javascript" src="<?php echo asset_url(); ?>js/jszip.min.js">
	</script>
	<script type="text/javascript" language="javascript" src="<?php echo asset_url(); ?>js/pdfmake.min.js">
	</script>
	<script type="text/javascript" language="javascript" src="<?php echo asset_url(); ?>js/vfs_fonts.js">
	</script>
	<script type="text/javascript" language="javascript" src="<?php echo asset_url(); ?>js/buttons.html5.min.js">
	</script>
	<script type="text/javascript" language="javascript" src="<?php echo asset_url(); ?>js/buttons.print.min.js"></script>
    
    
        <script>
			jQuery(document).ready(function() {
				//TableData.init();
			//	loadGrid();
			});

function search_by_custum_value(){
	//alert();
	loadGrid();
}

			function loadGrid() {
				var warehouse_id=$("#warehouse_id").val();
				var pvh_id=$("#pvh_id").val();
				var with_emi_no=$( "#with_emi_no:checked" ).val()
					var show_all=$( "#show_all:checked" ).val();
						var only_show_def=$( "#only_show_def:checked" ).val()
				var service_item_avalable=$("#service_item_avalable").val();
					    $('#warehouse_table').DataTable({
							dom: 'Blfrtip',
							"bProcessing": true,
        					 "serverSide": true,
							lengthMenu: [[10, 25, 50, -1 ], [10, 25, 50, "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('service/list_service') ?>",
							"ajax": {
								 'type': 'POST',
					"url": "<?php echo base_url('physical_verifcation/stock_reconcilation_report_get_details_v2') ?>",
					"data": { warehouse_id:warehouse_id,
					service_item_avalable:service_item_avalable,
					pvh_id:pvh_id,
					with_emi_no:with_emi_no,
					show_all:show_all,
					only_show_def:only_show_def
					 },
					
					},
					        "bDestroy": true,
					        "iDisplayLength": 10,
							"order": [[ 0, "desc" ]]
					    });

					}
					
function click_service_view_btn(req_id){	
	var $modal = $('#ajax-modal');
	 $('body').modalmanager('loading');
			setTimeout(function () {
				$modal.load('<?php echo base_url("service/service_details?req_id="); ?>'+req_id, '', function () {
					$modal.modal();
					$(".search-select").select2({
				            placeholder: "Select a State",
				            allowClear: true
				        });
				});
			}, 1000);
}


function fbs_click(id) {
	u=location.href;
	t=document.title;
	window.open('service/service_print/'+id,'sharer','toolbar=0,status=0,width=626,height=700, left=10, top=10,scrollbars=yes');return false;
	

}


		</script>

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