<?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>
<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='view_vendor_details.php'">Back </button>
<div class="clearfix"></div>
</div>
</div>
</div>
<form name="chkForm" id="chkForm" action="insert_vendor.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">Vendor Master</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-3 col-xs-12">
<div class="form-group">
<label>Vendor Name </label>
<input type="text" class="form-control"  name="vendor_name" required/>
</div>
</div>
<div class="col-sm-3 col-xs-12">
<div class="form-group">
<label>Vendor Source</label>
<input type="text" class="form-control"  name="vendor_source" />
</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>GST NO</label>
<input type="text" class="form-control"  name="gst_no" pattern="^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z]{1}[1-9A-Z]{1}Z[0-9A-Z]{1}$"/>
</div>
</div>
<div class="col-sm-6 col-xs-12">
<div class="form-group">
<label> Address</label>
<textarea class="form-control" name="address" required></textarea>
</div>
</div>
<div class="col-sm-3 col-xs-12">
<div class="form-group">
<label>Contractor Name</label>
<input type="text" class="form-control"  name="contractor_name"/>
</div>
</div>
<div class="col-sm-3 col-xs-12">
<div class="form-group">
<label>Contact Number</label>
<input type="text" class="form-control"  name="contact_no"/>
</div>
</div>
<div class="clearfix"></div>
<div class="row">
<div class="col-sm-12">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title"> <a class="btn btn-primary add-more" onClick="callAddContact3();" >+ Add Product</a>&nbsp;&nbsp &nbsp;&nbsp;<a class="btn btn-primary add-more" style="cursor:pointer; margin-left:20px" onClick="delRow1();" title="Click to remove"> <span class="glyphicon glyphicon-remove"></span>&nbsp;Del </a> </h3>
</div>
<div class="panel-body">
<div class="row">
<table class="table table-striped table-bordered table-hover" id="cntTable3">
<thead>
<tr>
<td width="100px" height="28"valign="middle" nowrap="nowrap" ><div align="left" style="padding-left:5px;"><strong>Sr.No.</strong></div></td>
<td  height="28"valign="middle" nowrap="nowrap" ><div align="left" style="padding-left:5px;"><strong>Product Name</strong></div></td>
<td  height="28"valign="middle" nowrap="nowrap" ><div align="left" style="padding-left:5px;"><strong>Product Specification</strong></div></td>
<td  height="28"valign="middle" nowrap="nowrap" ><div align="left" style="padding-left:5px;"><strong>Unit</strong></div></td>
<td  height="28"valign="middle" nowrap="nowrap" ><div align="left" style="padding-left:5px;"><strong>Price</strong></div></td>
</tr>
</thead>
<tbody>
</tbody>
</table>
<input id="allcontypes" name="allcontypes" value="Decision Maker~^~Influencer~^~Recommender~^~User~^~Purchase Officer" type="hidden">
<input name="cntlnos" id="cntlnos" value="" type="hidden">
<input name="cntcount3" id="cntcount3" value="" type="hidden">
<input name="cntdelids" id="cntdelids" value="" type="hidden">
</div>
</div>
</div>
</div>
</div>
<script type="text/Javascript">
	function callAddContact3()
	{
	
   var tbl = document.getElementById('cntTable3');
	 var lastRow = tbl.rows.length;
	 // if there's no header row in the table, then iteration = lastRow + 1
	 var iteration = lastRow;
	 var row = tbl.insertRow(lastRow);
	 var node1;
	 var lineno = lastRow;
	 // cell 0
	 var cellLeft = row.insertCell(0);
	 cellLeft.className = "center";
		var node = document.createElement('span');
		node.className = "glyphicon glyphicon-remove";
		node.title="Delete line";
		var link = document.createElement("a");
		link.className = "btn bg-btn-delete";
		link.style.padding = "0px 2px";
		link.href="javascript:callRemoveContact("+lineno+");";
		link.appendChild(node);
		//cellLeft.appendChild(link);
	 
	 node = document.createElement("input");
	 node.type = 'hidden';
	 node.name = 'cid'+lineno;
	 node.value = '';
	 node.id = 'cid'+lineno;
	 cellLeft.appendChild(node);
	 node = document.createElement("input");
	 node.type = 'text';
	 node.style.width = "50px";
	
	 node.name = 'clinenum'+lineno;
	 node.value = lineno;
	 node.id = 'clinenum'+lineno;
	 cellLeft.appendChild(node);
	 
	 
	 

 var cell1 = row.insertCell(1); 
    var node = document.createElement('input');
    node.className = 'form-control';
	 node.name = 'product_name'+lineno;
	 node.placeholder='Product Name';
	 node.value = "";
	 node.id = '';
	 cell1.appendChild(node);
	 
	  var cell2 = row.insertCell(2); 
    var node = document.createElement('textarea');
    node.className = 'form-control';
	 node.name = 'product_details'+lineno;
	 node.placeholder='Specification';
	 node.value = "";
	 node.id = '';
	 cell2.appendChild(node);
	 
	 
	
	
	 var cell3 = row.insertCell(3); 
    var nodegend = document.createElement('select');
    nodegend.className = 'form-control';
	 nodegend.name = 'unit'+lineno;
 var opt = nodegend.options;
 opt[opt.length] = new Option('Select','');
 <?php $query21 = "select * from unit_master";
       $result21 = mysqli_query($conn,$query21);
       $total = mysqli_num_rows($result21);
        while($row=mysqli_fetch_array($result21))
           {
$unit = $row['unit'];
 ?>
opt[opt.length] = new Option('<? echo $unit ?>','<? echo $unit ?>');
<? } ?>
cell3.appendChild(nodegend);
	
		
	 var cell4 = row.insertCell(4); 
    var node = document.createElement('input');
    node.className = 'form-control';
	 node.name = 'price'+lineno;
	 node.placeholder='price';
	 node.value = "";
	 node.id = '';
	 cell4.appendChild(node);
	
	
	
		
	document.getElementById('cntcount3').value = lineno;
	document.getElementById('sigthseeing').style.visibility='visible';
	
}function delRow1()
{

    var tableName = document.getElementById('cntTable3');

    var prev = tableName.rows.length;

    if(prev > 1)

{
    

/////////////////////////////////////////////////////////////////////////////////////
   
	 // if there's no header row in the table, then iteration = lastRow + 1
	
	 var row = document.getElementById('cntTable3').deleteRow(prev-1);
	 
	 }
	 var node1;
	  var iteration = lastRow;
	 var lastRow = tableName.rows.length;
	 var lineno = lastRow;
document.getElementById('cntcount3').value = lineno-1;




}
</script>
<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>
</div>


</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>