<!-- Modal -->
<link rel="stylesheet" href="css/themes/redmond/jquery-ui-1.10.3.custom.css" />
<link href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.6.3/css/bootstrap-select.min.css" />
<div class="container">
    <div class="modal fade" id="myModal_search" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog modal-dialog1" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">Add New Customer</h4>
                </div>
                <div class="modal-body">


                    <div class="modal-body" >

                        <div id="msg_box_customer"  class="span12 text-center"  ></div>
                        <div class="form-group " hidden>
                            <label class="col-sm-2 control-label" for="firstname_hidden">Customer</label>
                            <div class="col-sm-10">
                             
                                   
                                 <?php
                                    include './connection_sql.php';
                                    echo"<select id = \"customer_customer\"   onchange=\"find_customer();\" class =\"selectpicker form-control input-sm\" data-show-subtext=\"true\" data-live-search=\"true\">";
                                    echo "<option data-subtext= \"\"></option>";
                                    $sql = "select * from vendor where CAT ='C'  order BY id desc limit 0";
                                    foreach ($conn->query($sql) as $row) {
                                        echo "<option data-subtext='" . $row["CODE"] . "'   >" . $row["NAME"] . "&nbsp;-&nbsp; " . $row["ADD1"] . " &nbsp;-&nbsp; " . $row["TELE1"] . "</option>";
                                    }
                                    echo"</select>";
                                    ?>   
                          
                               
                            </div> 
 
                        </div> 
                     <!--<br><br>-->
                    <div class="form-group row" >
                           
                           <div class="col-lg-8">
                              <label class="col-form-label" style="margin-bottom: -8.5px">Name </label>
                              <input class="form-control" id="customer_name" name="customer_name" type="text" placeholder="Name" oninput="this.value = this.value.toUpperCase()">
                           </div>
                            <div class="col-lg-4">
                              <label class="col-form-label" style="margin-bottom: -8.5px">Mobile</label>
                              <input class="form-control"   name="customer_tel" id="customer_tel" type="number" placeholder="Mobile No" onkeyup="find_customer();" onchange="find_customer();">
                           </div> 
                           <div class="col-lg-12">
                              <label  class="col-form-label" style="margin-bottom: -8.5px">Address</label>
                              <textarea id="customer_address"style="text-transform: capitalize;"  name="customer_address" class="form-control"   rows="2" placeholder="  " oninput="this.value = this.value.toUpperCase()"></textarea>
                           </div>
                           
                       <?php
                            $sql_para = "SELECT VATTYPE FROM invpara where flag='".$_SESSION['company']."'";  
                            $result_para = $conn->query($sql_para);
                            $row_para = $result_para->fetch();
                            
                            $vattype=$row_para['VATTYPE'];
                             
                            if($vattype==1){?>
                                <div class="col-lg-4" id="show_vendor_vat_no" >
                                   <label class="col-form-label" style="margin-bottom: -8.5px">VAT No</label>
                                   <input class="form-control"   type="text" placeholder="Vat No" id="customer_vat_no" name="customer_vat_no">
                                </div>
                                <div class="col-lg-4" id="show_vendor_svat_no" >
                                   <label class="col-form-label" style="margin-bottom: -8.5px">SVAT No</label>
                                   <input class="form-control"    type="text" placeholder="Svat No" id="customer_svat_no" name="customer_svat_no">
                                </div>
                           <?php }else{?>
                                <div class="col-lg-4" id="show_vendor_vat_no" style='display:none'>
                                   <label class="col-form-label" style="margin-bottom: -8.5px">VAT No</label>
                                   <input class="form-control"   type="text" placeholder="Vat No" id="customer_vat_no" name="customer_vat_no">
                                </div>
                                <div class="col-lg-4" id="show_vendor_svat_no" style='display:none'>
                                   <label class="col-form-label" style="margin-bottom: -8.5px">SVAT No</label>
                                   <input class="form-control"    type="text" placeholder="Svat No" id="customer_svat_no" name="customer_svat_no">
                                </div>
                           <?php }
                       ?>
                          
                        
                      

                      </div>
                        
                        


                    </div>
                    
                </div>

                 <div class="modal-footer" >
                          <a type="button"  id="show_save" class="btn btn-success" onclick="vendor_save()">Save</a> 
                          <button type="button" class="btn btn-light" data-dismiss="modal">Cancel</button>
                        </div>
            </div>
        </div>
    </div>
</div>


<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.6.3/js/bootstrap-select.min.js"></script>
