121 lines
4.8 KiB
PHP
121 lines
4.8 KiB
PHP
|
||
<div class="modal-dialog modal-lm">
|
||
<div class="modal-content">
|
||
|
||
<div class="modal-header">
|
||
<h4 class="modal-title" id="myModalLabel2"><?php echo $heading; ?></h4>
|
||
<button type="button" id="close-form" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
|
||
</button>
|
||
</div>
|
||
|
||
<form data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Asset/add_or_edit_ThirdPartyForm" >
|
||
<div class="modal-body">
|
||
<div class="x_content">
|
||
<br />
|
||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||
<input type="hidden" name="id" value="<?php if(isset($third_party_data)) { echo $third_party_data->id; } ?>">
|
||
<input type="hidden" name="type" value="<?php if(isset($third_party_data)) { echo $third_party_data->type; } else { echo $type;} ?>">
|
||
<input type="hidden" name="business_id" value="<?php echo user()->business_id; ?>">
|
||
|
||
<div class="form-group row">
|
||
<label class="col-form-label col-md-3 col-sm-3 ">Name<a style="color:red;">*</a></label>
|
||
<div class="col-md-9 col-sm-9 ">
|
||
<input type="text" class="form-control" name="name" value="<?php if(isset($third_party_data)) { echo $third_party_data->name; } ?>" required >
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group row">
|
||
<label class="col-form-label col-md-3 col-sm-3 ">Phone</label>
|
||
<div class="col-md-9 col-sm-9 ">
|
||
<input type="text" pattern="[6-9]{1}[0-9]{9}" minlength="10" maxlength="10" title="Phone number with 6-9 and remaing 9 digit with 0-9" class="form-control" name="phone" id="phone" inputmode="numeric" value="<?php if(isset($third_party_data)) { echo $third_party_data->phone; } ?>" onkeypress="return matchnum(event)">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group row">
|
||
<label class="col-form-label col-md-3 col-sm-3 ">Email</label>
|
||
<div class="col-md-9 col-sm-9 ">
|
||
<input type="email" class="form-control" name="email" value="<?php if(isset($third_party_data)) { echo $third_party_data->email; } ?>" pattern="[^\s@]+@[^\s@]+\.[^\s@]+">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group row">
|
||
<label class="col-form-label col-md-3 col-sm-3 ">GST<a style="color:red;">*</a></label>
|
||
<div class="col-md-9 col-sm-9 ">
|
||
<input type="text" class="form-control" name="gst" value="<?php if(isset($third_party_data)) { echo $third_party_data->gst; } ?>" required>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group row">
|
||
<label class="col-form-label col-md-3 col-sm-3 ">Address</label>
|
||
<div class="col-md-9 col-sm-9 ">
|
||
<input type="text" class="form-control" name="address" value="<?php if(isset($third_party_data)) { echo $third_party_data->address; } ?>" >
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group row">
|
||
<label class="col-form-label col-md-3 col-sm-3 ">City</label>
|
||
<div class="col-md-9 col-sm-9 ">
|
||
<input type="text" class="form-control" name="city" value="<?php if(isset($third_party_data)) { echo $third_party_data->city; } ?>" >
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group row">
|
||
<label class="col-form-label col-md-3 col-sm-3 ">State</label>
|
||
<div class="col-md-9 col-sm-9 ">
|
||
<!-- <input type="text" class="form-control" name="state" value="<?php if(isset($third_party_data)) { echo $third_party_data->state; } ?>"> -->
|
||
|
||
<select class="form-control" name="state" >
|
||
<option value="<?php if(isset($third_party_data)) { echo $third_party_data->state_id; } ?>" > <?php if(isset($third_party_data)) { echo $third_party_data->state_name; } ?></option>
|
||
<?php foreach ($states as $key => $value) { ?>
|
||
<option value="<?php echo $value->id; ?>"><?php echo $value->name; ?></option>
|
||
<?php } ?>
|
||
</select>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group row">
|
||
<label class="col-form-label col-md-3 col-sm-3 " >Pincode</label>
|
||
<div class="col-md-9 col-sm-9 ">
|
||
<input type="text" class="form-control" name="pincode" value="<?php if(isset($third_party_data)) { echo $third_party_data->pincode; } ?>">
|
||
</div>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-secondary" data-dismiss="modal" id="close-form">Close</button>
|
||
<button type="submit" class="btn btn-primary"><?php echo $submit_button_title; ?></button>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
<script>
|
||
function matchnum(event) {
|
||
var charcode;
|
||
|
||
charcode = event.which || event.keyCode;
|
||
|
||
if (charcode >= 48 && charcode <= 57) return true; //only numbers
|
||
return false;
|
||
|
||
}
|
||
</script>
|
||
<script>
|
||
document.querySelector('form').addEventListener('submit', function(event) {
|
||
var form = event.target;
|
||
var submitBtn = form.querySelector('button[type="submit"]');
|
||
|
||
if (!form.checkValidity()) {
|
||
form.reportValidity(); // Display validation error messages
|
||
event.preventDefault(); // Prevent form submission if it's not valid
|
||
submitBtn.disabled = false;
|
||
} else {
|
||
submitBtn.disabled = true;
|
||
}
|
||
});
|
||
</script>
|
||
|