<?php
$permission  = explode(',',$_SESSION['permission_id']);
if(!in_array(10,$permission) && !in_array(1,$permission) ){

?>
<script>
window.location="starter.php";
</script>
<?php
}
?>
<style >
	tfoot {
    display: table-header-group !important;
	}
	.dataTable {
        /*font-size: 11px;*/
	}
</style>

<div id="add-form-cont" class="panel-collapse collapse panel" aria-expanded="false" style="height: 0px; position: relative; top:-3px; width:98%; margin:0px auto;">
	<div class="panel-body">
		<form class="form-horizontal" method="post" id="add_form" enctype="multipart/form-data">
			<div>
			<input type="hidden" id="access_token" name="access_token"  value="">

				<div class="col-sm-12">

					<div class="form-group">
						<div class="col-sm-6">
							<div class="input-group">
								<label class="input-group-addon"> اسم المخزن </label>
								<input type="text" placeholder=" اسم المخزن " class="form-control" name="objname" id="objname" required="required">
							</div>
						</div>
						<div class="col-sm-6">
							<div class="input-group">
								<label class="input-group-addon"> الوصف </label>
								<select name="stock_type" id="stock_type" class="form-control" required="required">
										<option value="" selected="selected">نوع المخزن</option>
										<option value="0" >خزن</option>
										<option value="1" >انتاج</option>
								</select>
							</div>
						</div>


					</div>

					<div class="form-group" >
						<div class="form-group has-feedback has-feedback-left form-group-material col-sm-12">
							<label class="control-label">الملاحظات</label>
							<textarea type="text" id="stock_note" name="stock_note" class="form-control" placeholder="الملاحظات" > </textarea> 
							<div class="form-control-feedback">
								<i class="icon-notebook text-muted"></i>
							</div>
						</div>
					</div>

				</div>
			</div>

			<div class="text-right">
				<button type="submit" id="submit_add_btn" class="btn btn-primary btn-labeled btn-labeled-left">
					حفظ <b><i class="icon-floppy-disk"></i></b>
				</button>
				<a href="#add-form-cont" id="add_form_cancel" class="btn btn-labeled btn-labeled-left bg-danger heading-btn" data-toggle="collapse">
					اغلاق  <b><i class="icon-cross"></i></b>
				</a>
			</div>
		</form>
	</div>
</div>

<input type="hidden" name="product_id" id="product_id" value="">
<input type="hidden" name="on_hand_qty" id="on_hand_qty" value="">

<div id="edit_form_cont" class="modal fade" style="display: none;">
	<div class="modal-dialog modal-lg">
		<form class="form-horizontal"  name="edit_form" method="post" id="edit_form" enctype="multipart/form-data">
			

			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"><i class="icon-cross"></i></button>
					<h4 class="modal-title multi_lang">  نقل الى مخزن اخر </h4>
					<h4 class="modal-title text-success"><span class="multi_lang">الكمية المتوفرة</span>  : <span class="on_hand_qty text-black text-danger"></span> </h4>
				</div>

				<div class="modal-body">
						
						<div>


							<div class="col-sm-12">
								<div class="form-group">
									

									<div class="col-sm-4">
										<div class="input-group">
											<label class="input-group-addon multi_lang">  من مخزن </label>
											<select name="stock_id" id="stock_id" class="form-control stock_class multi_lang" required="required">
													
											</select>
										</div>
									</div>

									<div class="col-sm-4">
										<div class="input-group">
											<label class="input-group-addon multi_lang"> الى مخزن </label>
											<select name="to_stock_id" id="to_stock_id" class="form-control multi_lang" required="required">
													
											</select>
										</div>
									</div>

									<div class="col-sm-4">
										<div class="input-group">
											<label class="input-group-addon multi_lang">  الكمية </label>
											<input type="number" name="moved_qty" id="moved_qty" class="form-control multi_lang" required="required">
													
										
										</div>
									</div>

								</div>

								

							</div>
						</div>
				</div>
				<div class="modal-footer">
					<button type="submit" id="btn_transfer" class="btn btn-labeled btn-labeled-left heading-btn btn-primary"> <span class="multi_lang">حفظ</span> <b><i class="icon-floppy-disk"></i></b>
					</button>
					<button type="button" class="btn btn-warning" data-dismiss="modal"> <span class="multi_lang">الغاء</span>
					</button>
				</div>
			</div>
		</form>
	</div>
</div>

<div id="add_damage_form_cont" class="modal fade" style="display: none;">
	<div class="modal-dialog modal-lg">
		<form class="form-horizontal"  name="add_damage_form" method="post" id="add_damage_form" enctype="multipart/form-data">
			

			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"><i class="icon-cross"></i></button>
					<h4 class="modal-title multi_lang">  اضافة الكمية التالفة </h4>
					<h4 class="modal-title text-success"><span class="multi_lang">الكمية المتوفرة</span>  : <span class="on_hand_qty text-black text-danger"></span> </h4>
				</div>

				<div class="modal-body">
						<input type="hidden" name="id_damage" id="id_damage" value="">
						<input type="hidden" name="on_hand_qty_damage" id="on_hand_qty_damage" value="">

						<div>


							<div class="col-sm-12">
								<div class="form-group">
									
									<div class="col-sm-4">
										<div class="input-group">
											<label class="input-group-addon multi_lang">  المخزن </label>
											<select name="stock_id_damage" id="stock_id_damage" class="form-control stock_class multi_lang" required="required">
													
											</select>
										</div>
									</div>

									<div class="col-sm-4">
										<div class="input-group">
											<label class="input-group-addon multi_lang"> الكمية التالفة </label>
											<input type="number" name="damage_qty" id="damage_qty" class="form-control multi_lang" required="required" placeholder=" الكمية التالفة" >

										</div>
									</div>

									<div class="col-sm-4">
										<div class="input-group">
											<label class="input-group-addon multi_lang"> السبب </label>
											<input type="text" name="damage_resons" id="damage_resons" class="form-control multi_lang"  placeholder=" السبب" >

										</div>
									</div>

								</div>

								

							</div>
						</div>
				</div>
				<div class="modal-footer">
					<button type="submit" id="btn_damage" class="btn btn-labeled btn-labeled-left heading-btn btn-primary"> <span class="multi_lang">حفظ</span> <b><i class="icon-floppy-disk"></i></b>
					</button>
					<button type="button" class="btn btn-warning" data-dismiss="modal"> <span class="multi_lang">الغاء</span>
					</button>
				</div>
			</div>
		</form>
	</div>
</div>


<div id="add_expire_form_cont" class="modal fade" style="display: none;">
	<div class="modal-dialog modal-lg">
		<form class="form-horizontal"  name="add_expire_form" method="post" id="add_expire_form" enctype="multipart/form-data">
			

			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"><i class="icon-cross"></i></button>
					<h4 class="modal-title multi_lang">  اضافة كمية منتهية الصلاحية </h4>
					<h4 class="modal-title text-success"><span class="multi_lang">الكمية المتوفرة</span>  : <span class="on_hand_qty text-black text-danger"></span> </h4>
				</div>

				<div class="modal-body">
						<input type="hidden" name="id_expire" id="id_expire" value="">
						<input type="hidden" name="on_hand_qty_expire" id="on_hand_qty_expire" value="">

						<div>


							<div class="col-sm-12">
								<div class="form-group">
									
									<div class="col-sm-4">
										<div class="input-group">
											<label class="input-group-addon multi_lang">  المخزن </label>
											<select name="stock_id_expire" id="stock_id_expire" class="form-control stock_class multi_lang" required="required">
													
											</select>
										</div>
									</div>

									<div class="col-sm-4">
										<div class="input-group">
											<label class="input-group-addon multi_lang"> الكمية المنتهية الصلاحية </label>
											<input type="number" name="expire_qty" id="expire_qty" class="form-control multi_lang" required="required" placeholder=" الكمية المنتهية الصلاحية" >

										</div>
									</div>

									<div class="col-sm-4">
										<div class="input-group">
											<label class="input-group-addon multi_lang"> السبب </label>
											<input type="text" name="expire_resons" id="expire_resons" class="form-control multi_lang"  placeholder=" السبب" >

										</div>
									</div>

								</div>

								

							</div>
						</div>
				</div>
				<div class="modal-footer">
					<button type="submit" id="btn_expire" class="btn btn-labeled btn-labeled-left heading-btn btn-primary"> <span class="multi_lang">حفظ</span> <b><i class="icon-floppy-disk"></i></b>
					</button>
					<button type="button" class="btn btn-warning" data-dismiss="modal"> <span class="multi_lang">الغاء</span>
					</button>
				</div>
			</div>
		</form>
	</div>
</div>

<div id="production_form_cont" class="modal fade" style="display: none;">
	<div class="modal-dialog modal-lg">
		<form class="form-horizontal"  name="production_form" method="post" id="production_form" enctype="multipart/form-data">
			

			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"><i class="icon-cross"></i></button>
					<h4 class="modal-title multi_lang">  اضافة الكمية او الطول المستخدم في الانتاج </h4>
					<h4 class="modal-title text-success"><span class="multi_lang">الكمية المتوفرة</span>  : <span class="on_hand_qty text-black text-danger"></span> </h4>
				</div>

				<div class="modal-body">
						<input type="hidden" name="id_production" id="id_production" value="">
						<input type="hidden" name="on_hand_qty_used" id="on_hand_qty_used" value="">

						<div>


							<div class="col-sm-12">
								<div class="form-group">
									
									<div class="col-sm-6">
										<div class="input-group">
											<label class="input-group-addon multi_lang">  المخزن </label>
											<select name="stock_id_used" id="stock_id_used" class="form-control stock_class multi_lang" required="required">
													
											</select>
										</div>
									</div>

									<div class="col-sm-6">
										<div class="input-group">
											<label class="input-group-addon multi_lang"> الكمية المستخدمة (الطول) </label>
											<input type="text" name="used_length" id="used_length" class="form-control multi_lang" required="required" placeholder=" الكمية المستخدمة" >

										</div>
									</div>

									<!-- <div class="col-sm-4">
										<div class="input-group">
											<label class="input-group-addon multi_lang"> السبب </label>
											<input type="text" name="used_resons" id="used_resons" class="form-control multi_lang"  placeholder=" السبب" >

										</div>
									</div> -->

								</div>

								

							</div>
						</div>
				</div>
				<div class="modal-footer">
					<button type="submit" id="btn_used" class="btn btn-labeled btn-labeled-left heading-btn btn-primary"> <span class="multi_lang">حفظ</span> <b><i class="icon-floppy-disk"></i></b>
					</button>
					<button type="button" class="btn btn-warning" data-dismiss="modal"> <span class="multi_lang">الغاء</span>
					</button>
				</div>
			</div>
		</form>
	</div>
</div>


<!-- Main content -->

	<!-- Search field -->
	<div class="panel panel-flat">
		<div class="panel-heading">
			<h5 class="panel-title">Invenotry</h5>
			<div class="heading-elements">
				<ul class="icons-list">
            		<li><a data-action="collapse"></a></li>
            		<li><a data-action="close"></a></li>
            	</ul>
        	</div>
		</div>

		<div class="panel-body">
			<form action="#" class="main-search">
				<div class="input-group content-group">
					<div class="has-feedback has-feedback-left">
						<input type="text" class="form-control input-xlg" placeholder="Search Invenotry" value="">
						<div class="form-control-feedback">
							<i class="icon-search4 text-muted text-size-base"></i>
						</div>
					</div>

					<div class="input-group-btn">
						<button type="submit" class="btn btn-primary btn-xlg">Search</button>
					</div>
				</div>

				<div class="row search-option-buttons">
					<div class="col-sm-6">
						<ul class="list-inline list-inline-condensed no-margin-bottom">
							<li class="dropdown">
								<a href="#" class="btn btn-link btn-sm dropdown-toggle" data-toggle="dropdown">
									<i class="icon-stack2 position-left"></i> All Branches <span class="caret"></span>
								</a>

								<ul class="dropdown-menu">
									<li><a href="#"><i class="icon-question7"></i> Getting started</a></li>
									<li><a href="#"><i class="icon-accessibility"></i> Registration</a></li>
									<li><a href="#"><i class="icon-reading"></i> General info</a></li>
									<li><a href="#"><i class="icon-gear"></i> Your settings</a></li>
									<li><a href="#"><i class="icon-graduation"></i> Copyrights</a></li>
									<li class="divider"></li>
									<li><a href="#"><i class="icon-mail-read"></i> Contacting authors</a></li>
								</ul>
							</li>


							<li class="dropdown">
								<a href="#" class="btn btn-link btn-sm dropdown-toggle" data-toggle="dropdown">
									<i class="icon-stack2 position-left"></i> All categories <span class="caret"></span>
								</a>

								<ul class="dropdown-menu">
									<li><a href="#"><i class="icon-question7"></i> Getting started</a></li>
									<li><a href="#"><i class="icon-accessibility"></i> Registration</a></li>
									<li><a href="#"><i class="icon-reading"></i> General info</a></li>
									<li><a href="#"><i class="icon-gear"></i> Your settings</a></li>
									<li><a href="#"><i class="icon-graduation"></i> Copyrights</a></li>
									<li class="divider"></li>
									<li><a href="#"><i class="icon-mail-read"></i> Contacting authors</a></li>
								</ul>
							</li>
							
						</ul>
					</div>

					
				</div>
			</form>
		</div>
	</div>
	<!-- /search field -->


	


	<!-- Search results -->
	<div class="content-group">
		<p class="text-muted text-size-small content-group">About 827,000 results (0.34 seconds)</p>

		<div class="search-results-list">
        	<div class="row">
				<div class="col-lg-2 col-md-3 col-sm-4 ">
					<div class="thumbnail">
						<div class="thumb thumb-rounded1">
							<img src="assets/images/placeholder.jpg" alt="">
							
						</div>
					
				    	<div class="caption text-center">
				    		<h6 class="text-semibold no-margin">James Alexander <small class="display-block">Lead developer</small></h6>
			    			<ul class="icons-list mt-15">
		                    	<li><a href="#" data-popup="tooltip" title="Google Drive"><i class="icon-google-drive"></i></a></li>
		                    	<li><a href="#" data-popup="tooltip" title="Twitter"><i class="icon-twitter"></i></a></li>
		                    	<li><a href="#" data-popup="tooltip" title="Github"><i class="icon-github"></i></a></li>
	                    	</ul>
				    	</div>
			    	</div>
				</div>

				<div class="col-lg-3 col-sm-4">
					<div class="thumbnail">
						<div class="thumb thumb-rounded">
							<img src="assets/images/placeholder.jpg" alt="">
							<div class="caption-overflow">
								<span>
									<a href="#" class="btn border-white text-white btn-flat btn-icon btn-rounded"><i class="icon-plus2"></i></a>
									<a href="#" class="btn border-white text-white btn-flat btn-icon btn-rounded ml-5"><i class="icon-link2"></i></a>
								</span>
							</div>
						</div>
					
				    	<div class="caption text-center">
				    		<h6 class="text-semibold no-margin">Nathan Jacobson <small class="display-block">Lead UX designer</small></h6>
			    			<ul class="icons-list mt-15">
		                    	<li><a href="#" data-popup="tooltip" title="Google Drive"><i class="icon-google-drive"></i></a></li>
		                    	<li><a href="#" data-popup="tooltip" title="Twitter"><i class="icon-twitter"></i></a></li>
		                    	<li><a href="#" data-popup="tooltip" title="Github"><i class="icon-github"></i></a></li>
	                    	</ul>
				    	</div>
			    	</div>
				</div>

				<div class="col-lg-3 col-sm-4">
					<div class="thumbnail">
						<div class="thumb thumb-rounded">
							<img src="assets/images/placeholder.jpg" alt="">
							<div class="caption-overflow">
								<span>
									<a href="#" class="btn border-white text-white btn-flat btn-icon btn-rounded"><i class="icon-plus2"></i></a>
									<a href="#" class="btn border-white text-white btn-flat btn-icon btn-rounded ml-5"><i class="icon-link2"></i></a>
								</span>
							</div>
						</div>
					
				    	<div class="caption text-center">
				    		<h6 class="text-semibold no-margin">Margo Baker <small class="display-block">Sales manager</small></h6>
			    			<ul class="icons-list mt-15">
		                    	<li><a href="#" data-popup="tooltip" title="Google Drive"><i class="icon-google-drive"></i></a></li>
		                    	<li><a href="#" data-popup="tooltip" title="Twitter"><i class="icon-twitter"></i></a></li>
		                    	<li><a href="#" data-popup="tooltip" title="Github"><i class="icon-github"></i></a></li>
	                    	</ul>
				    	</div>
			    	</div>
				</div>

				<div class="col-lg-3 col-sm-4">
					<div class="thumbnail">
						<div class="thumb thumb-rounded">
							<img src="assets/images/placeholder.jpg" alt="">
							<div class="caption-overflow">
								<span>
									<a href="#" class="btn border-white text-white btn-flat btn-icon btn-rounded"><i class="icon-plus2"></i></a>
									<a href="#" class="btn border-white text-white btn-flat btn-icon btn-rounded ml-5"><i class="icon-link2"></i></a>
								</span>
							</div>
						</div>
					
				    	<div class="caption text-center">
				    		<h6 class="text-semibold no-margin">Barbara Walden <small class="display-block">SEO specialist</small></h6>
			    			<ul class="icons-list mt-15">
		                    	<li><a href="#" data-popup="tooltip" title="Google Drive"><i class="icon-google-drive"></i></a></li>
		                    	<li><a href="#" data-popup="tooltip" title="Twitter"><i class="icon-twitter"></i></a></li>
		                    	<li><a href="#" data-popup="tooltip" title="Github"><i class="icon-github"></i></a></li>
	                    	</ul>
				    	</div>
			    	</div>
				</div>
			</div>

        	


			<div class="text-size-small text-uppercase text-semibold text-muted mb-10">Cards view</div>
			<div class="row">
				<div class="col-sm-3">
					<div class="panel panel-body">
						<div class="media">
							<a href="#" class="media-left">
								<img src="assets/images/placeholder.jpg" class="img-circle img-lg" alt="">
							</a>

							<div class="media-body">
								<h6 class="media-heading">James Alexander</h6>
								<span class="text-muted">Lead developer</span>
							</div>

							<div class="media-right media-middle">
								<ul class="icons-list">
			                    	<li class="dropdown">
				                    	<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-menu7"></i></a>
				                    	<ul class="dropdown-menu dropdown-menu-right">
											<li><a href="#"><i class="icon-comment-discussion pull-right"></i> Start chat</a></li>
											<li><a href="#"><i class="icon-phone2 pull-right"></i> Make a call</a></li>
											<li><a href="#"><i class="icon-mail5 pull-right"></i> Send mail</a></li>
											<li class="divider"></li>
											<li><a href="#"><i class="icon-statistics pull-right"></i> Statistics</a></li>
										</ul>
			                    	</li>
		                    	</ul>
							</div>
						</div>
					</div>
				</div>

				<div class="col-sm-3">
					<div class="panel panel-body">
						<div class="media">
							<a href="#" class="media-left">
								<img src="assets/images/placeholder.jpg" class="img-circle img-lg" alt="">
							</a>

							<div class="media-body">
								<h6 class="media-heading">Nathan Jacobson</h6>
								<span class="text-muted">Lead UX designer</span>
							</div>

							<div class="media-right media-middle">
								<ul class="icons-list">
			                    	<li class="dropdown">
				                    	<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-menu7"></i></a>
				                    	<ul class="dropdown-menu dropdown-menu-right">
											<li><a href="#"><i class="icon-comment-discussion pull-right"></i> Start chat</a></li>
											<li><a href="#"><i class="icon-phone2 pull-right"></i> Make a call</a></li>
											<li><a href="#"><i class="icon-mail5 pull-right"></i> Send mail</a></li>
											<li class="divider"></li>
											<li><a href="#"><i class="icon-statistics pull-right"></i> Statistics</a></li>
										</ul>
			                    	</li>
		                    	</ul>
							</div>
						</div>
					</div>
				</div>

				<div class="col-sm-4">
					<div class="panel panel-body">
						<div class="media">
							<a href="#" class="media-left">
								<img src="assets/images/placeholder.jpg" class="img-circle img-lg" alt="">
							</a>

							<div class="media-body">
								<h6 class="media-heading">Margo Baker</h6>
								<span class="text-muted">Sales manager</span>
							</div>

							<div class="media-right media-middle">
								<ul class="icons-list">
			                    	<li class="dropdown">
				                    	<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-menu7"></i></a>
				                    	<ul class="dropdown-menu dropdown-menu-right">
											<li><a href="#"><i class="icon-comment-discussion pull-right"></i> Start chat</a></li>
											<li><a href="#"><i class="icon-phone2 pull-right"></i> Make a call</a></li>
											<li><a href="#"><i class="icon-mail5 pull-right"></i> Send mail</a></li>
											<li class="divider"></li>
											<li><a href="#"><i class="icon-statistics pull-right"></i> Statistics</a></li>
										</ul>
			                    	</li>
		                    	</ul>
							</div>
						</div>
					</div>
				</div>
			</div>

			

        </div>
	</div>
	<!-- /search results -->
	
	
	<!-- Pagination -->
    <div class="text-center content-group pt-20">
        <ul class="pagination">
			<li class="disabled"><a href="#">&rarr;</a></li>
			<li class="active"><a href="#">1</a></li>
			<li><a href="#">2</a></li>
			<li><a href="#">3</a></li>
			<li><a href="#">4</a></li>
			<li><span>...</span></li>
			<li><a href="#">58</a></li>
			<li><a href="#">59</a></li>
			<li><a href="#">&larr;</a></li>
		</ul>
	</div>
	<!-- /pagination -->

<!-- /main content -->
			


<script type="text/javascript" src="controllers/stock_detail.js?random=<?php echo uniqid(); ?>"></script>