365 lines
14 KiB
PHP
365 lines
14 KiB
PHP
<?php
|
||
|
||
$SupplierID = '';
|
||
$SupplierName = '';
|
||
$Address = '';
|
||
$ContactNumber = '';
|
||
$AlternateContactNumber = '';
|
||
$EmailAddress = '';
|
||
$TIN = '';
|
||
$PAN = '';
|
||
$GSTNO = '';
|
||
$GSTRange = '';
|
||
$CollectrateAddress = '';
|
||
$UANumber = '';
|
||
$PaymentTerms = '';
|
||
$PaymentDays = '';
|
||
$PayableAT = '';
|
||
|
||
|
||
|
||
if(!empty($supplier))
|
||
{
|
||
foreach ($supplier as $uf)
|
||
{
|
||
$SupplierID = $uf->SupplierID;
|
||
$SupplierName = $uf->SupplierName;
|
||
$Address = $uf->Address;
|
||
$ContactNumber = $uf->ContactNumber;
|
||
$AlternateContactNumber = $uf->AlternateContactNumber;
|
||
$EmailAddress = $uf->EmailAddress;
|
||
$Exiseregistration = $uf->Exiseregistration;
|
||
$TIN = $uf->TIN;
|
||
$PAN = $uf->PAN;
|
||
$GSTNO = $uf->GSTNO;
|
||
$GSTRange = $uf->GSTRange;
|
||
$CollectrateAddress = $uf->CollectrateAddress;
|
||
$UANumber = $uf->UANumber;
|
||
$PaymentTerms = $uf->PaymentTerms;
|
||
$PaymentDays = $uf->PaymentDays;
|
||
$PayableAT = $uf->PayableAT;
|
||
|
||
|
||
}
|
||
}
|
||
|
||
|
||
?>
|
||
<script>
|
||
function demo(){
|
||
alert("Update this records");
|
||
|
||
}
|
||
|
||
</script>
|
||
<div class="content-wrapper">
|
||
<!-- Content Header (Page header) -->
|
||
<section class="content-header">
|
||
<h1>
|
||
<center>Supplier Details</center>
|
||
|
||
</h1>
|
||
</section>
|
||
|
||
<section class="content">
|
||
<div style="text-align:left;">
|
||
<a href="<?php echo base_url() ?>supplierListing" class="btn btn-primary" value="Back"/>Back</a>
|
||
</div>
|
||
<br/>
|
||
<div class="row">
|
||
<!-- left column -->
|
||
<div class="col-md-12">
|
||
<!-- general form elements -->
|
||
|
||
|
||
|
||
<div class="box box-primary">
|
||
<div class="box-header">
|
||
<center><h3 class="box-title">Edit Supplier Details</h3></center>
|
||
</div><!-- /.box-header -->
|
||
<!-- form start -->
|
||
|
||
<form role="form" action="<?php echo base_url() ?>editsupplier" method="post" id="editsupplier" role="form">
|
||
<div class="box-body">
|
||
<div class="row">
|
||
<div class="col-md-6 col-xs-6">
|
||
<div class="form-group">
|
||
<label for="PAN">PAN</label>
|
||
<input type="text" class="form-control required" id="PAN" name="PAN" maxlength="15"value="<?php echo $PAN; ?>">
|
||
</div>
|
||
</div>
|
||
<div class="col-md-6 col-xs-6">
|
||
<div class="form-group">
|
||
<label for="SupplierName">Supplier Name</label>
|
||
<input type="text" class="form-control required" id="SupplierName" name="SupplierName" maxlength="128"value="<?php echo $SupplierName; ?>">
|
||
|
||
<input type="hidden" value="<?php echo $SupplierID; ?>" name="SupplierID" id="SupplierID" readonly>
|
||
</div>
|
||
|
||
</div>
|
||
<div class="col-md-6 col-xs-6">
|
||
<div class="form-group">
|
||
<label for="Address">Address</label>
|
||
<input type="text" class="form-control required" id="Address" name="Address" maxlength="250" value="<?php echo $Address; ?>"></textarea>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div class="col-md-6 col-xs-6">
|
||
<div class="form-group">
|
||
<label for="ContactNumber">Contact Number</label>
|
||
<input type="text" class="form-control required digits" id="ContactNumber" onchange="validatenumbers()" name="ContactNumber" minlegth="10"maxlength="10" value="<?php echo $ContactNumber?>">
|
||
</div>
|
||
</div>
|
||
<div class="col-md-6 col-xs-6">
|
||
<div class="form-group">
|
||
<label for="AlternateContactNumber">Alternate Contact Number</label>
|
||
<input type="tel" class="form-control required digits" pattern="[0-9]{11}"id="AlternateContactNumber" name="AlternateContactNumber" minlength="10"
|
||
|
||
maxlength="10" value="<?php echo $AlternateContactNumber?>">
|
||
</div>
|
||
</div>
|
||
|
||
|
||
|
||
<div class="col-md-6 col-xs-6">
|
||
<div class="form-group">
|
||
<label for="EmailAddress">Email Address</label>
|
||
<input type="email" class="form-control email required" id="EmailAddress" onchange="validateEmail()" name="EmailAddress" maxlength="128" value="<?php echo $EmailAddress?>">
|
||
</div>
|
||
</div>
|
||
<div class="col-md-6 col-xs-6">
|
||
<div class="form-group">
|
||
<label for="Exiseregistration">Exise Registration</label>
|
||
<input type="text" class="form-control required" id="Exiseregistration" name="Exiseregistration" maxlength="50" value="<?php echo $Exiseregistration; ?>">
|
||
</div>
|
||
</div>
|
||
<div class="col-md-6 col-xs-6">
|
||
<div class="form-group">
|
||
<label for="TIN">TIN</label>
|
||
<input type="text" class="form-control required" id="TIN" name="TIN" maxlength="50" value="<?php echo $TIN; ?>">
|
||
</div>
|
||
</div>
|
||
|
||
|
||
|
||
<div class="col-md-6 col-xs-6">
|
||
<div class="form">
|
||
<label for="GSTNo">GST No</label>
|
||
<input type="text" class="form-control " id="GSTNo" name="GSTNo" value="<?php echo $GSTNO; ?>"maxlength="10">
|
||
</div>
|
||
</div>
|
||
|
||
|
||
|
||
<div class="col-md-6 col-xs-6">
|
||
<div class="form">
|
||
<label for="GSTRange">Range</label>
|
||
<input type="text" class="form-control " id="GSTRange" value="<?php echo $GSTRange;?>"name="GSTRange" "maxlength="10">
|
||
</div>
|
||
</div>
|
||
<div class="col-md-6 col-xs-6">
|
||
<div class="form">
|
||
<label for="CollectrateAddress">Colletrate Address</label>
|
||
<input type="text" class="form-control " id="CollectrateAddress"value="<?php echo $CollectrateAddress;?>" name="CollectrateAddress" maxlength="255">
|
||
</div>
|
||
</div>
|
||
<div class="col-md-6 col-xs-6">
|
||
<div class="form">
|
||
<label for="UANumber">UA Number</label>
|
||
<input type="text" class="form-control " id="UANumber"value="<?php echo $UANumber;?>" name="UANumber" maxlength="10">
|
||
</div>
|
||
</div>
|
||
|
||
<br/>
|
||
<div class="row">
|
||
<div class="col-md-offset-5 col-md-3 col-xs-offset-5 col-xs-3">
|
||
<h4><u>Payment terms </u></h4>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="col-md-6 col-xs-6">
|
||
<label for="payablefrom">Payable From</label>
|
||
<select class="form-control required" id="PaymentTerms" name="PaymentTerms">
|
||
<option value="<?php echo $PaymentTerms; ?>"><?php echo $PaymentTerms;?></option>
|
||
<?php
|
||
if(!empty($payment))
|
||
{
|
||
foreach ($payment as $rl)
|
||
{
|
||
?>
|
||
<option value="<?php echo $rl->ConfigValue ?>"><?php echo $rl->ConfigValue ?></option>
|
||
<?php
|
||
}
|
||
}
|
||
?>
|
||
</select>
|
||
</div>
|
||
|
||
<div class="col-md-3 col-xs-6">
|
||
<div class="form">
|
||
<label for="PaymentDays" >Payment Date</label><br/>
|
||
<span> Before</span>
|
||
<input type="radio" <?php echo($PaymentDays?'checked="checked"':''); ?> name="PaymentDays" value="before"/>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-6 col-xs-6">
|
||
<div class="form">
|
||
|
||
<span> After</span>
|
||
<input type="radio" <?php echo($PaymentDays?'checked="checked"':''); ?> name="PaymentDays" value="after"/>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="col-md-6 col-xs-6">
|
||
<div class="form">
|
||
<label for="PayableAT">Payable AT</label>
|
||
<input type="text" class="form-control required" value="<?php echo $PayableAT;?>"id="PayableAT" name="PayableAT" maxlength="10">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div><!-- /.box-body -->
|
||
|
||
<div class="box-footer" style="text-align:right">
|
||
<input type="submit" class="btn btn-primary" onclick="demo()" value="Submit" />
|
||
<input type="reset" class="btn btn-primary" value="Cancel" />
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<?php
|
||
$this->load->helper('form');
|
||
$error = $this->session->flashdata('error');
|
||
if($error)
|
||
{
|
||
?>
|
||
<div class="alert alert-danger alert-dismissable">
|
||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||
<?php echo $this->session->flashdata('error'); ?>
|
||
</div>
|
||
<?php } ?>
|
||
<?php
|
||
$success = $this->session->flashdata('success');
|
||
if($success)
|
||
{
|
||
?>
|
||
<div class="alert alert-success alert-dismissable">
|
||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||
<?php echo $this->session->flashdata('success'); ?>
|
||
</div>
|
||
<?php } ?>
|
||
|
||
<div class="row">
|
||
<div class="col-md-12">
|
||
<?php echo validation_errors('<div class="alert alert-danger alert-dismissable">', ' <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>'); ?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
|
||
<script>
|
||
|
||
|
||
//Call to ajax existing PAN
|
||
$('#PAN').change(function() {
|
||
|
||
var id = $('#PAN').val();
|
||
|
||
$.ajax({
|
||
data:{id:id},
|
||
|
||
type:"POST",
|
||
url:"<?php echo base_url();?>supplier/checkPAN",
|
||
success:function(data) {
|
||
if(data)
|
||
{
|
||
alert( data+""+" already supplier existing change Status");
|
||
window.location = 'supplier/supplierListing';
|
||
|
||
//$('#PAN').val(data);
|
||
}
|
||
|
||
|
||
}
|
||
|
||
});
|
||
|
||
});
|
||
//Email Validate
|
||
function validateEmail() {
|
||
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
|
||
|
||
var email = $('#EmailAddress').val();
|
||
if(email != "")
|
||
{
|
||
if (reg.test(email) == false)
|
||
{
|
||
alert('Please Enter Valid Email Address');
|
||
return (false);
|
||
}
|
||
else
|
||
{
|
||
return true;
|
||
}
|
||
}
|
||
}
|
||
//PAN Validate
|
||
function validatePAN() {
|
||
var reg = /^(?=.*[A-Z]).{5,}(?=.*[0-9]).{4,}(?=.*[A-Z]).{1,}$/;
|
||
|
||
var PAN = $('#PAN').val();
|
||
if(PAN != "")
|
||
{
|
||
if (reg.test(PAN) == false)
|
||
{
|
||
alert('Please Enter Valid PAN Number');
|
||
return (false);
|
||
}
|
||
else
|
||
{
|
||
return true;
|
||
}
|
||
}
|
||
}
|
||
//Validate Supplier Name
|
||
function validatesuppliername() {
|
||
var reg = /^[A-Za-z ]{3,30}$/;
|
||
|
||
var suppliername = $('#SupplierName').val();
|
||
if(suppliername != "")
|
||
{
|
||
if (reg.test(suppliername) == false)
|
||
{
|
||
alert('Please Enter Valid Supplier Name');
|
||
return (false);
|
||
}
|
||
else
|
||
{
|
||
return true;
|
||
}
|
||
}
|
||
}
|
||
function validatenumbers() {
|
||
var reg = /^[0-9]{10,11}$/
|
||
|
||
var number = $('#number').val();
|
||
if(number != "")
|
||
{
|
||
if (reg.test(number) == false)
|
||
{
|
||
alert('Please Enter Valid Number');
|
||
return (false);
|
||
}
|
||
else
|
||
{
|
||
return true;
|
||
}
|
||
}
|
||
}
|
||
|
||
</script>
|