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

?>
<script>
window.location="starter.php";
</script>
<?php
}
?>
<style >
	
	.filter_btn {
        padding: 5px;
        margin: 10px;
	}

	
	.top-scrollerx {
		position: fixed;
	    bottom: 100px;
	    font-size: 1em;
	    display: none;
	    z-index: 999;
	    text-align: center;
	    cursor: pointer;
	    height: 50px;
	    width: 50px;
	    border-radius: 50%;
	    background: rgb(37 171 219);
	    color: #fff;
	    line-height: 40px;

	}

	html[dir="rtl"] .top-scrollerx{
	    left: 10px;
	}

	html[dir="ltr"] .top-scrollerx{
	    right: 10px;
	}

 	.top-scrollerx:hover {
    	background: rgb(219 37 157);
	}

	.btn-move:active:after {
	  padding: 0;
	  margin: 0;
	  opacity: 1;
	  transition: 0s
	}
</style>



<div id="add_form_cont" class="modal fade" style="display: none;">
	<div class="modal-dialog modal-full">
		<form class="form-horizontal"  name="add_form" method="post" id="add_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">Cart</h4>
				</div>

				<div class="modal-body">

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

						<div class="form-group">

							<div class="form-group has-feedback has-feedback-left col-sm-12">
								
								<input type="hidden" class="form-control multi_lang stop_enter"  name="customer_id_fk" id="customer_id_fk" value="<?php echo $_SESSION['user_id']; ?>" >

								
								
							</div>

							


							<input type="hidden" name="invoice_type" id="invoice_type" value="4">
							<input type="hidden" name="invoice_transaction" id="invoice_transaction" value="Invoice">
							
							

							

							

							
						</div>

						<div class="form-group">
							<div class="table-responsive1">
								<table  class="table col-sm-12 table-bordered .table-sm">
									<thead>
										<tr class="alpha-success ">
											<th>#</th>
											<th class="multi_lang">المادة</th>
											<th class="multi_lang">الكمية</th>
											<th class="multi_lang">سعر الوحدة</th>
											<th class="multi_lang">تخفيضات</th>
											<th class="multi_lang">الكلفة الاجمالية</th>
											<th class="multi_lang">ملاحظة</th>
											<th></th>
										</tr>
									</thead>
									<tbody id="add_table" >
										
										
									</tbody>
									<tfoot>
										
										

										<tr class="alpha-primary">
											<th colspan="2" class="multi_lang">GRAND TOTAL</th>
											
											<th></th>
											<th></th>
											<th></th>
											<th >
												<input id="grand_total" name="grand_total" type="text" value="0" class="form-control text-center text-black text-size-large " readonly="readonly" style="height: 25px;">
											</th>
											<th></th>
											
											<th><i  class="icon-cash "></i></th>
										</tr>

										
									</tfoot>
								</table>
							</div>

						</div>

						

					</div>
				</div>
				<div class="modal-footer">
					<!-- <button type="submit" id="submit_add_btn" class="btn btn-labeled btn-labeled-left heading-btn btn-primary"> <span class="multi_lang">Save</span> <b><i class="icon-floppy-disk"></i></b>
					</button> -->
					<button type="button" class="btn btn-warning" data-dismiss="modal"> <span class="multi_lang">Cancel</span>
					</button>
				</div>
			</div>
		</form>
	</div>
</div>





		
		<!-- Individual column searching (text inputs) -->
		<div class="panel panel-flat">

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

					

					<div class="form-group has-feedback has-feedback-left col-sm-12">
						
						<select class="form-control multi_lang stop_enter" data-live-search="true" name="product_id" id="product_id" data-width="100%" required="required" tabindex="">

						</select>
						
					</div>

					<div class="form-group   col-sm-6">
							
							<span class=" text-black text-size-large pull-right" id="totals"></span>
						
					</div>
				
					<!-- <button class="btn btn-labeled btn-labeled-left heading-btn btn-primary pull-right" onclick="show_cart();">
						<span class="multi_lang">Show Cart</span><b><i class="icon-cart-add"></i></b>
					</button> -->
				</div>

						


				<div class="col-sm-12" id="branch_filter1">
					
				</div>	

				<div class="col-sm-12" id="stock_filter">
					
				</div>	

				<div class="col-sm-12" id="supplier_filter">
					
				</div>

				

			
			
		</div>
		<!-- /individual column searching (text inputs) -->

		<div id="products_card" class="row">
			<ul id="product_list" class="media-list">


			</ul>	
		</div>
		
<!-- for Scrolling -->
<div class="top-scrollerx js-top-scrollerx svg-icons">
   <span class="badge badge-danger cart-count pull-right">0</span>

   <i class="icon-cart-add icon-2x" style="top: -8px;"></i>
</div>

<script>
	
	// $('.js-top-scrollerx').fadeIn();

	$(window).scroll(function(){

	  if ($(this).scrollTop() > 10) {
	    
	    // $('.js-top-scrollerx').fadeIn();
	  } else {
	    // $('.js-top-scrollerx').fadeOut();
	  }
	});
	//Click event to scroll to top
	$('.js-top-scrollerx').click(function(){
	  $('html, body').animate({scrollTop : 0},1000);
	  show_cart();
	  return false;
	});

</script>
				


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