<?php include 'header.php'; 
$querylogin = "select * from  mst_users where user_name = '". $_SESSION["LOGIN_NAME"]."' AND password = '".$_SESSION["EMPLOYEE_PASSWORD"]."'";
$resultlogin = mysqli_query($conn,$querylogin);
while($row=mysqli_fetch_array($resultlogin))
{
$user_name = $row['user_name'];
$sales_person_id = $row['user_id'];
} 
?>
<style>
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type=number] {
  -moz-appearance: textfield;
}


</style>
<script>
  $(document).on('change',".gstinnumber", function(){    
    var inputvalues = $(this).val();
    var gstinformat = new RegExp('^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z]{1}[1-9A-Z]{1}Z[0-9A-Z]{1}$');

    if (gstinformat.test(inputvalues)) {
     return true;
    } else {
        alert('Please Enter Valid GSTIN Number');
        $(".gstinnumber").val('');
        $(".gstinnumber").focus();
    }

});
</script>

<script>
    // jQuery ".Class" SELECTOR.
    $(document).ready(function() {
        $('.groupOfTexbox').keypress(function (event) {
            return isNumber(event, this)
        });
    });
    // THE SCRIPT THAT CHECKS IF THE KEY PRESSED IS A NUMERIC OR DECIMAL VALUE.
    function isNumber(evt, element) {

        var charCode = (evt.which) ? evt.which : event.keyCode

        if (
            (charCode != 45 || $(element).val().indexOf('-') != -1) &&      // Check minus and only once.
            (charCode != 46 || $(element).val().indexOf('.') != -1) &&      // Check dot and only once.
            (charCode < 48 || charCode > 57))
            return false;

        return true;
    }   </script>
 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js">

    </script>

    <script>

        function validatePanNumber(pan) {

            let pannumber = $(pan).val();

            var regex = /[a-zA-z]{5}\d{4}[a-zA-Z]{1}/;

            if (pannumber.match(regex)) {

                alert(" Valid PAN number");

            }

            else {

                alert(" Invalid PAN number");

                $(pan).val("");

            }

        }
function validate()
{
  var text = document.getElementById("pno").value;
  var regx = /^[6-9]\d{9}$/ ;
  if(regx.test(text))
    alert("valid");
  else
    alert("Invalid Telephone Number");
}
 

    </script>	<?php
$maxid = "SELECT * FROM state_master WHERE stateid=(SELECT max(stateid) FROM state_master)";
$maxid1 = mysqli_query($conn,$maxid);
while($row=mysqli_fetch_array($maxid1))
{
$maxstateid = $row['stateid'];
}


?>
<script type="text/javascript">
var citiesByState = {<?php $qry9 = "select * from state_master";
$re9 = mysqli_query($conn,$qry9);
while($row=mysqli_fetch_array($re9))
{
$state = $row['state'];
$stateid = $row['stateid'];


$maxid2 = "SELECT * FROM city_master WHERE stateid='$stateid' ORDER BY id DESC LIMIT 1 ";
$maxid2a = mysqli_query($conn,$maxid2);
while($row=mysqli_fetch_array($maxid2a))
{
$maxid = $row['id'];
}
?>
<?php echo $state?>: [<?php $qry99 = "select * from city_master where stateid='$stateid' ";
$re99 = mysqli_query($conn,$qry99);
while($row=mysqli_fetch_array($re99))
		{  
		$city = $row['city'];
		$id = $row['id'];
?>"<?php echo $city?>"<?php if($maxid!=$id){?>,<?php }}?>]<?php if($maxstateid!=$stateid){?>,<?php }?><?php }?>

}

var citiesBygst = {<?php $qry96 = "select * from state_master";
$re96 = mysqli_query($conn,$qry96);
while($row=mysqli_fetch_array($re96))
{
$state = $row['state'];
$stateid9 = $row['stateid'];
$state_code = $row['state_code'];
?>
<?php echo $state?>: ["<?php echo $state_code?>"]<?php if($maxstateid!=$stateid9){?>,<?php }?>
<?php } ?>
}
function makeSubmenu(value) {
if(value.length==0) document.getElementById("citySelect").innerHTML = "<option></option>";
else {
var citiesOptions = "";
for(cityId in citiesByState[value]) {
citiesOptions+="<option>"+citiesByState[value][cityId]+"</option>";

}


document.getElementById("citySelect").innerHTML = citiesOptions;

var citiesOptions1 = "";
for(cityId in citiesBygst[value]) {
//citiesOptions+="<option>"+citiesByState[value][cityId]+"</option>";

}
citiesOptions1=citiesBygst[value][cityId];

document.getElementById("codegst").value = citiesOptions1;

}

}


</script>


  <div class="content-page">
    <div class="content">
      <div class="container">	
	  
	  
        <div class="row">
          <div class="col-sm-12">
            <div class="page-header-title">
              <button type="button" class="btn btn-dark  waves-effect waves-light" onclick="location.href='new_customer_step1.php'">Back </button>
             
              <div class="clearfix"></div>
            </div>
          </div>
        </div>
         <form name="chkForm" id="chkForm" action="insert_customer.php"  method="post">

		<main>
		<div class="row">
                        <div class="col-sm-12">
                            <div class="panel panel-primary">
                                <div class="panel-heading">
                                    <h3 class="panel-title">NEW Customers</h3></div>
									
									
									
									
                                <div class="panel-body">
                                    <div class="row">
                                      
													
													
                                                    <div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Customer Name </label>
                                                        <?php if($_REQUEST['c_id'] =='') { ?>
				
<input type="text" id="search-box"  name="c_id" class="form-control" required style="text-transform: capitalize;"/> 

<div id="suggesstion-box"></div>

														  <?php }else{ $customer_name = $_REQUEST['c_id'];?>	<input type="text" class="form-control"  name="c_id" value="<?php echo ucwords(strtolower($customer_name))?>" />	<?php } ?>
                                                    </div>
													</div>
													
													
											
													
													 <div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Billing Contact Person</label>
   							<input type="text" class="form-control"  name="billing_contact_person"/></div></div>
							
							<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Email ID</label>
   							<input type="text" class="form-control"  name="email_id"/></div></div>	
							
								<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Mobile Number</label>
   							<input type="text" class="groupOfTexbox form-control" maxlength="10"  pattern="^\d{10}$" name="cell_no" title="Please Enter 10 digit " /></div></div>
							
							  
							<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Telephone Number</label>
   							<input type="number" class="form-control"  name="tel_no" pattern="^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s\./0-9]*$"/></div></div>						
													
                                      
										
													
													
													<div class="col-sm-6 col-xs-12"><div class="form-group">
                                                        <label>Billing Address</label>
                                                       <textarea class="form-control" name="billing_address"></textarea>
                                                    </div>
                                                    </div>
													<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Country</label>
                                                       <select name="country" class="form-control select2">
<option value="" selected>Select Country</option>
<?php 
$qry97 = "select * from country ORDER BY country_id ASC";
$re97 = mysqli_query($conn,$qry97);
while($row=mysqli_fetch_array($re97))
{
$country = $row['country'];
?>
<option value="<?php echo $country?>"><?php echo $country?></option>
<?php }?>
</select>
                                                    </div>
                                                    </div>
													
														<div class="clearfix"></div>
													
													<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>State</label>
                                                       <select name="state" class="form-control" id="countrySelect" size="1" onchange="makeSubmenu(this.value)">
<option value="" disabled selected>Select State</option>
<?php 
$qry97 = "select * from state_master ORDER BY state ASC";
$re97 = mysqli_query($conn,$qry97);
while($row=mysqli_fetch_array($re97))
{
$state = $row['state'];
$stateid9 = $row['stateid'];
$display_name = $row['display_name'];?>
<option value="<?php echo $state?>"><?php echo $display_name?></option>
<?php }?>
</select>
                                                    </div>
                                                    </div> 
												
                                                    	<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Location</label>
                                                       <select  class="form-control"  name="city" id="citySelect" size="1" >
<option value="" disabled selected>Select City</option>
<option></option>
</select>  </div></div>

<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Pincode</label>
   							<input type="text" class="form-control"  name="pincode"/>
							
							<!--<input type="text" class="form-control"  name="pincode" pattern="[0-9]{6}" maxlength="6"/>--></div></div>	
													
			  
			 <div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Website</label>
   							<input type="text" class="form-control"  name="website" required/></div></div>	
							
							
							
							
 	
							
			
			                                      
	<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>State Code</label>
    <input type="text" id="codegst"  name="state_code" class="form-control" readonly="readonly"/>  </div></div>	
	

						
							
   
 
						
							
							
						
							
							
						 
  
							
							
								<div class="col-sm-3 col-xs-12"><div class="form-group">
    <label>GST NO</label>
  <input type="text" class="form-control gstinnumber" pattern="\d{2}[A-Z]{5}\d{4}[A-Z]{1}[A-Z\d]{1}[Z]{1}[A-Z\d]{1}" name="billing_GST_no"/></div></div>
    
   <div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>PAN NO</label>
   					<input type="text" class="form-control"  name="billing_PAN_no" id="txtPANNumber"  maxlength="10"  /></div></div>
							
							
							
							
							
							<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Vendor Code</label>
   							<input type="text" class="form-control"  name="vendor_code" required/></div></div>	
							
							
							
							
							
							
							
							
							
							
										
 <div class="clearfix"></div>
							
							<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Delivery Address</label>
   							<div class="checkbox">   
                 <input id="checkbox1" type="checkbox" name="same_as_billing" value="YES">
               <label for="checkbox1"> Same as Billing Address </label
                ></div></div></div>

				
														
 <div class="clearfix"></div>
				
				
				
				<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Buyer Details</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-12 col-xs-12">
<div class="m-t-20">
<table class="table table-striped table-bordered dt-responsive nowrap">
<tr>
<td><strong>Buyer Name</strong></td>

<td><strong>Buyer GST No</strong></td>
<td><strong>Buyer PAN No</strong></td>
<td><strong>Buyer State</strong></td>
<td><strong>Buyer State Code</strong></td><td><strong>Buyer Address</strong></td>
</tr>

<tr>
<td>	<input type="text" class="form-control"  name="buyer_name"/></td>

<td>	<input type="text" class="form-control"  name="buyer_GST_no"/></td>
<td>	<input type="text" class="form-control"  name="buyer_PAN_no"/></td>
<td>	<input type="text" class="form-control"  name="buyer_state"/></td>
<td>	<input type="text" class="form-control"  name="buyer_state_code"/></td>
<td>	 <textarea class="form-control" name="buyer_address"></textarea></td>
</tr>

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

  								                  <div class="col-sm-12 col-xs-12">
                                           
                                            <div class="m-t-20">
                                                    <div class="form-group">
                                                        <div>
													
                                                            <button type="submit" class="btn btn-primary waves-effect waves-light" onclick="validate()">Submit</button>
							
                                                        </div>
                                                    </div>
                                               
                                            </div>
                                        </div>
                                        
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
        </main>
        </form>
		
		<!------------------->
	
        
      </div>
    </div>
<script  src="./script.js"></script>
 <script src="vendors/bower_components/jquery/dist/jquery.min.js"></script>
        <script src="vendors/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
        <script type="text/javascript" src="vendors/bower_components/moment/min/moment-with-locales.min.js"></script>
        <script src="vendors/bower_components/mjolnic-bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js"></script>
        <script src="vendors/bower_components/switchery/dist/switchery.min.js"></script>
        <script src="vendors/bower_components/select2/dist/js/select2.full.min.js"></script>
        <script src="vendors/bower_components/bootstrap-select/dist/js/bootstrap-select.min.js"></script>
        
        <!-- Bootstrap Tagsinput JavaScript -->
        <script src="vendors/bower_components/bootstrap-tagsinput/dist/bootstrap-tagsinput.min.js"></script>
        
        <!-- Bootstrap Touchspin JavaScript -->
        <script src="vendors/bower_components/bootstrap-touchspin/dist/jquery.bootstrap-touchspin.min.js"></script>
        
        <!-- Multiselect JavaScript -->
        <script src="vendors/bower_components/multiselect/js/jquery.multi-select.js"></script>
        
         
        <!-- Bootstrap Switch JavaScript -->
        <script src="vendors/bower_components/bootstrap-switch/dist/js/bootstrap-switch.min.js"></script>
        
        <!-- Bootstrap Datetimepicker JavaScript -->
        <script type="text/javascript" src="vendors/bower_components/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>

        
        <!-- Form Advance Init JavaScript -->
        <script src="dist/js/form-advance-data.js"></script>
        
        <!-- Slimscroll JavaScript -->
        <script src="dist/js/jquery.slimscroll.js"></script>
    
        <!-- Fancy Dropdown JS -->
        <script src="dist/js/dropdown-bootstrap-extended.js"></script>
        
        <!-- Owl JavaScript -->
        <script src="vendors/bower_components/owl.carousel/dist/owl.carousel.min.js"></script>
    
        <!-- Init JavaScript -->
        <script src="dist/js/init.js"></script>   <script src="assets/js/bootstrap.min.js"></script>
	<!-- Select2 JavaScript -->
		<script src="vendors/bower_components/select2/dist/js/select2.full.min.js"></script>
		
		<!-- Bootstrap Select JavaScript -->
		<script src="vendors/bower_components/bootstrap-select/dist/js/bootstrap-select.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/modernizr.min.js"></script>
<script src="assets/js/detect.js"></script>
<script src="assets/js/fastclick.js"></script>
<script src="assets/js/jquery.slimscroll.js"></script>
<script src="assets/js/jquery.blockUI.js"></script>
<script src="assets/js/waves.js"></script>
<script src="assets/js/wow.min.js"></script>
<script src="assets/js/jquery.nicescroll.js"></script>
<script src="assets/js/jquery.scrollTo.min.js"></script>
<script src="assets/js/app.js"></script>
</body>
<!-- Mirrored from themesdesign.in/xadmino/form-elements.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 03 Feb 2021 12:05:08 GMT -->
</html>