Merge branch 'feature/uat' of bitbucket.org:venbainformationtechnology/donation into feature/uat
This commit is contained in:
commit
37f3dc0091
@ -26,34 +26,25 @@
|
||||
<!-- <img src="<?= base_url() . "public/assets/images/plugins/loading.gif" ?>" alt="loader1" style="display:none; height:30px; width:auto;" id="loaderImg"> -->
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="DonorType" class="col-form-label">Donor Type<span class="text-danger"> *</span></label>
|
||||
<select class="form-control" id="DonorType" name="DonorType" required>
|
||||
<option value="" <?php if(!isset($customer['donor_type'])) { echo 'selected';} ?>>Select Donor Type</option>
|
||||
<option value="option1" <?php if(isset($customer['donor_type']) && $customer['donor_type'] == 'option1') { echo 'selected';} ?> >Individual</option>
|
||||
<option value="option2" <?php if(isset($customer['donor_type']) && $customer['donor_type'] == 'option2') { echo 'selected'; } ?> >Organization</option>
|
||||
</select>
|
||||
</select>
|
||||
<div class="invalid-feedback">Please provide.</div>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="DonorType" class="col-form-label">Donor Type<span class="text-danger"> *</span></label>
|
||||
<select class="form-control" id="DonorType" name="DonorType" required>
|
||||
<option value="" disabled>Select Donor Type</option>
|
||||
<option value="option1" <?= isset($customer['donor_type']) && $customer['donor_type'] === 'option1' ? 'selected' : '' ?>>Individual</option>
|
||||
<option value="option2" <?= isset($customer['donor_type']) && $customer['donor_type'] === 'option2' ? 'selected' : '' ?>>Organization</option>
|
||||
|
||||
</select>
|
||||
<div class="invalid-feedback">Please provide.</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4" id="org_reg">
|
||||
<label for="csname" class="col-form-label">Organization Name<span class="text-danger"> *</span></label>
|
||||
<input type="text" class="form-control" id="org_name_field" name="org_name" value="<?= isset($customer['org_name']) ? $customer['org_name'] : '' ?>" placeholder="Organization Name"/>
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4" id="org_pan_no">
|
||||
<label for="csname" class="col-form-label"><span class="contactPerson">Organization PAN Number</label>
|
||||
<input type="text" class="form-control" id="pan_no_org"name="o_pan_no" value="<?= isset($customer['pan_no']) ? $customer['pan_no'] : '' ?>" placeholder="PAN Number" />
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4" id="org_name">
|
||||
<label for="csname" class="col-form-label">Organization Reg Details<span class="text-danger"> *</span></label>
|
||||
<input type="text" class="form-control" id="org_reg_details" name="org_reg_Details" value="<?= isset($customer['org_reg_details']) ? $customer['org_reg_details'] : '' ?>" placeholder="Organization Reg details"/>
|
||||
<input type="text" class="form-control" id="org_reg_details" name="org_reg_Details" value="<?= isset($customer['org_reg_Details']) ? $customer['org_reg_Details'] : '' ?>" placeholder="Organization Reg details"/>
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
</div>
|
||||
|
||||
@ -61,10 +52,15 @@
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="cfname" class="col-form-label"><span class="contactPerson">Contact Person </span>Name<span class="text-danger"> *</span></label>
|
||||
<label for="cfname" class="col-form-label"><span class="contactPerson">Contact Person </span>First Name<span class="text-danger"> *</span></label>
|
||||
<input type="text" class="form-control" id="cfname" name="cfname" value="<?= isset($customer['first_name']) ? $customer['first_name'] : '' ?>" placeholder="First Name" required />
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="csname" class="col-form-label"><span class="contactPerson">Contact Person </span>Last Name<span class="text-danger"> *</span></label>
|
||||
<input type="text" class="form-control" name="csname" value="<?= isset($customer['last_name']) ? $customer['last_name'] : '' ?>" placeholder="Last Name" required />
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="cmobile" class="col-form-label"><span class="contactPerson">Contact Person </span>Mobile<span class="text-danger"> *</span></label>
|
||||
@ -72,33 +68,32 @@
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text">+91</div>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="cmobile" value="<?= isset($customer['mobile_no']) ? $customer['mobile_no'] : '' ?>" placeholder="Mobile Number (Enter only numbers)" required maxlength="10" onkeypress="return restriction(event)" />
|
||||
<input name="mobile[]"class="form-control" pattern="[0-9]{10}" value="<?= isset($customer['mobile_no']) ? $customer['mobile_no'] : '' ?>" type="tel" data-parsley-type="number" data-parsley-length="[10,10]" class="form-control" placeholder="Enter Contact Mobile" id="mobile" required>
|
||||
|
||||
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="cmail" class="col-form-label"><span class="contactPerson">Contact Person </span>Email<span class="text-danger"> *</span></label>
|
||||
<input type="text" class="form-control" id="cmail" name="cmail" value="<?= isset($customer['email']) ? $customer['email'] : '' ?>" placeholder="Email" onkeyup="validateEmail(this.value)" required />
|
||||
<span id="emailValidationMessage"></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="cmail" class="col-form-label"><span class="contactPerson">Contact Person </span>Email</label>
|
||||
<input type="text" class="form-control" id="cmail" name="cmail" value="<?= isset($customer['email']) ? $customer['email'] : '' ?>" placeholder="Email" onkeyup="validateEmail(this.value)" />
|
||||
<span id="emailValidationMessage"></span>
|
||||
</div>
|
||||
|
||||
<!-- <div class="form-group col-md-4">
|
||||
<label for="dob" class="col-form-label">Date Of Birth</label>
|
||||
<input type="date" class="form-control" name="dob" value="" placeholder="Date Of Birth" />
|
||||
</div> -->
|
||||
|
||||
<div class="form-group col-md-4" id="non_org_pan_no">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="csname" class="col-form-label"><span class="contactPerson">Organization </span>PAN Number</label>
|
||||
<input type="text" class="form-control" id="pan_no"name="pan_no" value="<?= isset($customer['pan_no']) ? $customer['pan_no'] : '' ?>" placeholder="PAN Number" />
|
||||
<input type="text" class="form-control" id="pan_no"name="pan_no" required value="<?= isset($customer['pan_no']) ? $customer['pan_no'] : '' ?>" placeholder="PAN Number" />
|
||||
</div>
|
||||
<div class="form-group col-md-4" id="adhar_no_individual">
|
||||
<label for="csname" class="col-form-label"><span class="contactPerson"> </span>Aadhar Number</label>
|
||||
<label for="csname" class="col-form-label"><span class="contactPerson"> </span>Adhar Number</label>
|
||||
<input type="text" class="form-control" id="adhar_no" name="adhar_no" value="<?= isset($customer['adhar_no']) ? $customer['adhar_no'] : '' ?>" placeholder="Adhar Number" />
|
||||
</div>
|
||||
|
||||
@ -115,13 +110,13 @@
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="baddress1" class="col-form-label">Address<span class="text-danger"> *</span></label>
|
||||
<label for="baddress1" class="col-form-label">Address</label>
|
||||
<textarea type="text" class="form-control" id="baddress1" name="address" placeholder="Address (eg : 1234 Main St)" style="width:202%" required><?= isset($customer['address']) ? $customer['address'] : '' ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="bcountry" class="col-form-label">Country<span class="text-danger"> *</span></label>
|
||||
<label for="bcountry" class="col-form-label">Country</label>
|
||||
<select class="form-control" id="bcountry" name="country"required>
|
||||
<option value="<?= isset($customer['country']) ? $customer['country'] : '';?>"><?= isset($customer['country']) ? $customer['country'] : 'Choose your Country';?></option>
|
||||
<?php foreach ($country_details as $value) { ?>
|
||||
@ -135,17 +130,17 @@
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<div id="billinput" style="display: block">
|
||||
<label for="bistate" class="col-form-label">State<span class="text-danger"> *</span></label>
|
||||
<label for="bistate" class="col-form-label">State</label>
|
||||
<input type="text" class="form-control" id="bistate" name="state_text"required placeholder="State" value="<?= isset($customer['state']) ? $customer['state'] : ''?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="bcity" class="col-form-label">City<span class="text-danger"> *</span></label>
|
||||
<label for="bcity" class="col-form-label">City</label>
|
||||
<input type="text" class="form-control" id="bcity" name="city" required value="<?= isset($customer['city']) ? $customer['city'] : '' ?>" placeholder="City" />
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="bzip" class="col-form-label">Postal Code<span class="text-danger"> *</span></label>
|
||||
<label for="bzip" class="col-form-label">Postal Code</label>
|
||||
<input type="text" class="form-control" id="bzip" name="zip" required value="<?= isset($customer['postal_code']) ? $customer['postal_code'] : '' ?>" placeholder="Postal Code" pattern="\d*" maxlength="10" />
|
||||
</div>
|
||||
</div>
|
||||
@ -166,7 +161,7 @@
|
||||
|
||||
<button class="btn btn-success waves-effect waves-light mr-1" id="submitBtn" type="submit"><?= isset($customer['donor_id']) ? 'Update' : 'Submit' ?></button>
|
||||
<button type="reset" class="btn btn-primary waves-effect mr-1">Reset</button>
|
||||
<a onclick="history.back()" class="btn btn-secondary waves-effect">Cancel</a>
|
||||
<a href="<?= base_url() . "customer_list"; ?>" class="btn btn-secondary waves-effect">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@ -177,26 +172,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// hide all fields for account login
|
||||
$(function() {
|
||||
role = "<?php echo get_user_role() ?>";
|
||||
console.log(role);
|
||||
if(role == "auditor")
|
||||
{
|
||||
// for input
|
||||
var formElements = document.querySelectorAll('#myForm input, #myForm textarea');
|
||||
formElements.forEach(function(element) {
|
||||
element.setAttribute('readonly', true);
|
||||
});
|
||||
// for select
|
||||
var formElements = document.querySelectorAll('#myForm select, #myForm button');
|
||||
formElements.forEach(function(element) {
|
||||
element.setAttribute('disabled', true);
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
document.getElementById('myForm').addEventListener('submit', function(event) {
|
||||
var form = event.target;
|
||||
@ -241,82 +217,66 @@ $(function() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$(document).ready(function() {
|
||||
// Initial setup based on donor type
|
||||
updateDonorTypeFields();
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
$('#org_name').hide();
|
||||
$('.contactPerson').hide();
|
||||
$('#org_reg').hide();
|
||||
let orgName = $('#org_name_field').val()
|
||||
|
||||
if($('#DonorType').val() && $('#DonorType').val() == 'option2'){
|
||||
$('#org_reg').show();
|
||||
$('#org_name').show();
|
||||
$('.contactPerson').show();
|
||||
$('#org_reg_details').prop('required', true)
|
||||
$('#org_name_field').prop('required', true);
|
||||
$('#org_pan_no').show();
|
||||
$('#non_org_pan_no').hide();
|
||||
}
|
||||
else{
|
||||
$('#org_name').hide();
|
||||
$('.contactPerson').hide();
|
||||
$('#org_reg_details').prop('required', false)
|
||||
$('#org_name_field').prop('required', false);
|
||||
$('#org_pan_no').hide();
|
||||
$('#non_org_pan_no').show()
|
||||
}
|
||||
|
||||
|
||||
$('#DonorType').on('change', function(){
|
||||
|
||||
let DonorType = $(this).val();
|
||||
|
||||
if(DonorType === 'option2'){
|
||||
$('#org_name').show();
|
||||
$('#org_reg').show();
|
||||
$('.contactPerson').show();
|
||||
$('#adhar_no_individual').hide();
|
||||
$('#org_name_field').prop('required', true);
|
||||
$('#org_reg_details').prop('required',true);
|
||||
$('#org_pan_no').show();
|
||||
$('#pan_no_org').prop('required', true); // Add this line to make PAN field required
|
||||
$('#non_org_pan_no').hide();
|
||||
}
|
||||
else{
|
||||
$('#adhar_no_individual').show();
|
||||
$('#org_name').hide();
|
||||
$('#org_reg').hide();
|
||||
$('.contactPerson').hide();
|
||||
$('#org_name_field').prop('required', false);
|
||||
$('#org_reg_details').prop('required',false);
|
||||
$('#pan_no_org').prop('required', false); // Add this line to make PAN field required
|
||||
$('#org_pan_no').hide();
|
||||
$('#non_org_pan_no').show();
|
||||
}
|
||||
})
|
||||
|
||||
// Handle changes in donor type
|
||||
$('#DonorType').on('change', function(){
|
||||
updateDonorTypeFields();
|
||||
});
|
||||
|
||||
|
||||
// Validate Aadhar number on input
|
||||
$('#adhar_no').on('input', function(){
|
||||
let adharNumber = $(this).val();
|
||||
validateAdharNumber($(this).val());
|
||||
});
|
||||
|
||||
// Validate PAN number on input
|
||||
$('#pan_no').on('input', function(){
|
||||
validatePANNumber($(this).val());
|
||||
});
|
||||
|
||||
function updateDonorTypeFields() {
|
||||
let DonorType = $('#DonorType').val();
|
||||
|
||||
// Organization type selected
|
||||
if (DonorType === 'option2') {
|
||||
$('#org_name').show();
|
||||
$('#org_reg').show();
|
||||
$('.contactPerson').show();
|
||||
$('#adhar_no_individual').hide();
|
||||
$('#org_name_field').prop('required', true);
|
||||
$('#org_reg_details').prop('required', true);
|
||||
$('#pan_no').prop('required', true);
|
||||
}
|
||||
// Individual type selected
|
||||
else {
|
||||
$('#adhar_no_individual').show();
|
||||
$('#org_name').hide();
|
||||
$('#org_reg').hide();
|
||||
$('.contactPerson').hide();
|
||||
$('#pan_no').prop('required', false);
|
||||
}
|
||||
}
|
||||
|
||||
function validateAdharNumber(adharNumber) {
|
||||
let adharPattern = /^\d{12}$/;
|
||||
|
||||
if(!adharPattern.test(adharNumber)){
|
||||
if (!adharPattern.test(adharNumber)) {
|
||||
$('#adhar_no').addClass('is-invalid');
|
||||
} else {
|
||||
$('#adhar_no').removeClass('is-invalid');
|
||||
}
|
||||
});
|
||||
$('#pan_no').on('input', function(){
|
||||
let panNumber = $(this).val();
|
||||
}
|
||||
|
||||
function validatePANNumber(panNumber) {
|
||||
let panPattern = /^[A-Z]{5}[0-9]{4}[A-Z]$/;
|
||||
|
||||
if(!panPattern.test(panNumber)){
|
||||
if (!panPattern.test(panNumber)) {
|
||||
$('#pan_no').addClass('is-invalid');
|
||||
} else {
|
||||
$('#pan_no').removeClass('is-invalid');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@ -37,8 +37,8 @@
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="title" class="col-form-label">Name<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="name" name="name[]" required data-toggle="select2" multiple>
|
||||
<option value="">--Select--</option>
|
||||
<select class="form-control" placeholder="PAN Number" id="name" name="name[]" required data-toggle="select2" multiple >
|
||||
<option value="0" disabled>--Select--</option>
|
||||
<?php foreach ($list as $val) : ?>
|
||||
<option value="<?= $val->id ?>" <?php if ($val->is_active == 1) echo "selected"; ?> > <?= $val->name ?> </option>
|
||||
<?php endforeach; ?>
|
||||
@ -53,7 +53,8 @@
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button class="btn btn-success waves-effect waves-light mr-1" id="submitBtn" type="submit">Submit</button>
|
||||
<button onclick="history.back()" class="btn btn-secondary waves-effect">Cancel</button>
|
||||
<a class="btn btn-secondary waves-effect" href="donations_accepted">Cancel</a>
|
||||
<!-- <button onclick="history.back()" class="btn btn-secondary waves-effect">Cancel</button> -->
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@ -321,14 +321,14 @@ $(document).ready(function(){
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="csname" class="col-form-label">Organization Name<span class="text-danger"> *</span></label>
|
||||
<input type="text" class="form-control" id="org_name_field" name="org_name" value="" placeholder="Organization Name"/>
|
||||
<input type="text" class="form-control" id="org_name_field" name="org_name" value="" placeholder="Organization Name" required>
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="csname" class="col-form-label"><span class="contactPerson">Organization PAN Number</label>
|
||||
<label for="csname" class="col-form-label"><span class="contactPerson">Organization PAN Number<span class="text-danger"> *</span></label>
|
||||
<input type="text" class="form-control" id="pan_no_org" name="pan_no" value="" placeholder="PAN Number" />
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user