<div class="clearfix"></div>

  <div class="content-wrapper">

    <div class="container-fluid">

     <div class="row pt-2 pb-2">

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

		    <h4 class="page-title">Create Walkin Customer Order</h4>

	   </div>

     </div>

     <div class="row">

			<div class="col-lg-6">

			   <?php if($this->session->flashdata("msg")){echo $this->session->flashdata("msg"); }?>

               <div class="card">

                    	  <div class="card-header">Add/Edit Categories</div>

                    <div class="card-body">

                           <form action="<?php echo base_url().'admin/order_submit';?>" method="post">
                           		<div class="form-group">
                                	<label>Customer</label>
                                    <input type="hidden" name="uid" id="uid" />
                                    <input type="text" class="form-control" placeholder="Type Name,Mobile,Email" name="customer" id="csearch" />
                                </div>
                                <div id="customer_div">
                                    
                                </div>
                                <div class="form-group">
                                	<label>Search Product</label>
                                    <input type="hidden" name="pid" id="pid" />
                                    <input type="hidden" name="pimg" id="pimg" />
                                    <input type="hidden" name="wrt" id="wrt" />
                                    <input type="text" class="form-control" name="product" id="psearch" />
                                </div>
                                <div id="prod_div">
                                
                                </div>
                                <div class="form-group">
                                	<label>Address</label>
                                    <textarea class="form-control" name="address" rows="2"></textarea>
                                </div>
                                <div class="row">
                                    <div class="form-group col-md-8">
                                		<label>City</label>
                                        <input type="text" class="form-control" name="city" />
                                    </div>
                                    <div class="form-group col-md-4">
                                		<label>Pincode</label>
                                        <input type="text" class="form-control" name="pincode" />
                                        <input type="hidden" name="subtotal" id="subtotal_input" />
                                        <input type="hidden" name="total" id="total_input" />
                                    </div>
                                </div>
                                <div class="order_total">
                                	<table class="table table-condensed table-striped">
                                    	<tbody>
                                        	<tr><th>Subtotal</th><th align="right" id="subtotal"></th></tr>
                                        	<tr><th valign="middle">Discount</th><th align="right" id="discount">
                                            	
                                    <input type="text" class="form-control pull-right"  style="width:100px;" name="discount" id="discount_input" /></th></tr>
                                        	<tr><th>Total</th><th align="right" id="total"></th></tr>
                                        </tbody>
                                    </table>
                                </div><br/>
                                <button type="submit" class="btn btn-primary">Generate UID</button>
                           </form>

                    </div>

                    

               </div>                  

            </div>

            <div class="col-lg-6">

               <div class="card">

                    <div class="card-header">Listed Products</div>

                    <div class="card-body">

                          

                    </div>

                    

               </div>                  

            </div>

            

        </div><!--End Row-->

	  

	  <!--End Row-->



    </div>

    <!-- End container-fluid-->

    

    </div><!--End content-wrapper-->

   <!--Start Back To Top Button-->

    <a href="javaScript:void();" class="back-to-top"><i class="fa fa-angle-double-up"></i> </a>

    <!--End Back To Top Button-->

	

	<!--Start footer-->

	<footer class="footer">

      <div class="container">

        <div class="text-center">

          Copyright © 2022

        </div>

      </div>

    </footer>

	<!--End footer-->

   

  </div><!--End wrapper-->





  <!-- Bootstrap core JavaScript-->

	<script>
	$(document).ready(function(){
		$("#discount_input").keyup(function(){
			var d=$(this).val();
			var subt=$("#subtotal_input").val();
			var tot=subt-d;
			$("#total_input").val(tot);
			$("#total").text(tot);
		});
		$("#csearch").keyup(function(){
			var cust=$(this).val();
			$.ajax({
				 type: "POST",
				 url: '<?php echo base_url();?>admin/ajax_search_customer',
				 data: {cust:cust},
				 success: function(res){
					 //alert(res);
					$("#customer_div").html(res);
				 }
			});
		});
		$("#psearch").keyup(function(){
			var pro=$(this).val();
			$.ajax({
				 type: "POST",
				 url: '<?php echo base_url();?>admin/ajax_search_product',
				 data: {pro:pro},
				 success: function(res){
					$("#prod_div").html(res);
				 }
			});
		});
	});
	</script>

	<!-- simplebar js -->

     <script src="<?php echo base_url();?>adminassets/plugins/bootstrap-datatable/js/jquery.dataTables.min.js"></script>

  <script src="<?php echo base_url();?>adminassets/plugins/bootstrap-datatable/js/dataTables.bootstrap4.min.js"></script>



    

	

  <script src="<?php echo base_url();?>adminassets/js/sidebar-menu.js"></script>

  <!-- Custom scripts -->

  <script src="<?php echo base_url();?>adminassets/js/app-script.js"></script>

  

  <!-- Vector map JavaScript -->

  <!-- Index js -->

  <script src="<?php echo base_url();?>adminassets/js/index.js"></script>

  

 

</body>

</html>

