issues fixes : ps
This commit is contained in:
parent
4b725e3fd5
commit
60147b10bb
@ -106,7 +106,8 @@ public function assetList($category , $purchase_date_from = null , $purchase_dat
|
||||
// get depreciation value
|
||||
$category_percentage = $this->Asset_model->get_by_category_id($value->category);
|
||||
// percentage formula calculation
|
||||
$category_percentage = $category_percentage[0]['depreciation_percentage'] / 2;
|
||||
$depr_percent_value = (gettype($category_percentage) == 'array') ? (isset($category_percentage[0]['depreciation_percentage'])?$category_percentage[0]['depreciation_percentage']:0) : 0;
|
||||
$category_percentage = $depr_percent_value / 2;
|
||||
$depreciate_value = $cost * $category_percentage / 100;
|
||||
$cost = abs($depreciate_value - $cost);
|
||||
// echo $cost;die();
|
||||
@ -114,7 +115,8 @@ public function assetList($category , $purchase_date_from = null , $purchase_dat
|
||||
for ($i=0 ; $i < $interval->y ; $i++)
|
||||
{
|
||||
// $category_percentage = $this->Asset_model->get_by_category_id($value->category);
|
||||
$category_per = $category_percentage[0]['depreciation_percentage'];
|
||||
$depr_percent_value = (gettype($category_percentage) == 'array') ? (isset($category_percentage[0]['depreciation_percentage'])?$category_percentage[0]['depreciation_percentage']:0) : 0;
|
||||
$category_per = $depr_percent_value;
|
||||
$depreciate_value = $cost * $category_per / 100;
|
||||
$data['current_cost'] = abs($depreciate_value - $cost);
|
||||
$editCurrentValue = $this->MY_Model->edit_option($data, $value->id, $table);
|
||||
@ -127,7 +129,8 @@ public function assetList($category , $purchase_date_from = null , $purchase_dat
|
||||
// get depreciation value
|
||||
$category_percentage = $this->Asset_model->get_by_category_id($value->category);
|
||||
// percentage formula calculation
|
||||
$category_percentage = $category_percentage[0]['depreciation_percentage'];
|
||||
$depr_percent_value = (gettype($category_percentage) == 'array') ? (isset($category_percentage[0]['depreciation_percentage'])?$category_percentage[0]['depreciation_percentage']:0) : 0;
|
||||
$category_percentage = $depr_percent_value;
|
||||
$depreciate_value = $cost * $category_percentage / 100;
|
||||
$cost = abs($depreciate_value - $cost);
|
||||
|
||||
@ -135,8 +138,9 @@ public function assetList($category , $purchase_date_from = null , $purchase_dat
|
||||
// get depreciation value
|
||||
$category_percentage = $this->Asset_model->get_by_category_id($value->category);
|
||||
for ($i=0 ; $i < $interval->y ; $i++)
|
||||
{
|
||||
$category_per = $category_percentage[0]['depreciation_percentage'];
|
||||
{
|
||||
$depr_percent_value = (gettype($category_percentage) == 'array') ? (isset($category_percentage[0]['depreciation_percentage'])?$category_percentage[0]['depreciation_percentage']:0) : 0;
|
||||
$category_per = $depr_percent_value;
|
||||
$depreciate_value = $cost * $category_per / 100;
|
||||
// echo $depreciate_value; die();
|
||||
$data['current_cost'] = abs($depreciate_value- $cost);
|
||||
@ -156,7 +160,8 @@ public function assetList($category , $purchase_date_from = null , $purchase_dat
|
||||
// get depreciation value
|
||||
$category_percentage = $this->Asset_model->get_by_category_id($value->category);
|
||||
// percentage formula calculation
|
||||
$category_percentage = $category_percentage[0]['depreciation_percentage'] / 2;
|
||||
$depr_percent_value = (gettype($category_percentage) == 'array') ? (isset($category_percentage[0]['depreciation_percentage'])?$category_percentage[0]['depreciation_percentage']:0) : 0;
|
||||
$category_percentage = $depr_percent_value / 2;
|
||||
$depreciate_value = $cost * $category_percentage / 100;
|
||||
$data['current_cost'] = abs($cost - $depreciate_value);
|
||||
$editCurrentValue = $this->MY_Model->edit_option($data, $value->id, $table);
|
||||
@ -168,7 +173,8 @@ public function assetList($category , $purchase_date_from = null , $purchase_dat
|
||||
// get depreciation value
|
||||
$category_percentage = $this->Asset_model->get_by_category_id($value->category);
|
||||
// percentage formula calculation
|
||||
$depreciate_value = $cost * $category_percentage[0]['depreciation_percentage'] / 100;
|
||||
$depr_percent_value = (gettype($category_percentage) == 'array') ? (isset($category_percentage[0]['depreciation_percentage'])?$category_percentage[0]['depreciation_percentage']:0) : 0;
|
||||
$depreciate_value = $cost * $depr_percent_value / 100;
|
||||
$data['current_cost'] = abs($cost - $depreciate_value);
|
||||
$editCurrentValue = $this->MY_Model->edit_option($data, $value->id, $table);
|
||||
}
|
||||
@ -218,7 +224,8 @@ public function createAssets()
|
||||
$create_assets = $this->MY_Model->insert($data,$table);
|
||||
|
||||
// Qr code
|
||||
$qr_data['qrcode_img'] = (new QRCode)->render(base_url().'Asset/view_asset_details/'.md5($create_assets));
|
||||
// $qr_data['qrcode_img'] = (new QRCode)->render(base_url().'Asset/view_asset_details/'.md5($create_assets));
|
||||
$qr_data['qrcode_img'] = "";
|
||||
$editAssetData = $this->MY_Model->edit_option($qr_data, $create_assets, $table);
|
||||
$editCurrentValue = $this->MY_Model->edit_option($qr_data, $create_assets, $table);
|
||||
|
||||
@ -364,7 +371,7 @@ public function view_asset_details($id)
|
||||
$asset_insurance = $this->Asset_model->get_insurance_with_join($id,user()->business_id);
|
||||
$asset_images = $this->Asset_model->get_by_asset_id($id,'asset_images',user()->business_id);
|
||||
$asset_history = $this->Audit_model->get_history($id,'asset',user()->business_id);
|
||||
$data = array('asset_id'=>$assetData->id,'asset_value' => $asset_value ,'asset_usage' => $asset_usage ,'asset_amc' =>$asset_amc ,'asset_insurance'=>$asset_insurance, 'asset_images'=>$asset_images,'asset_history'=>$asset_history,'tab'=>$tab);
|
||||
$data = array('asset_id'=>$assetData->id,'asset_value' => $asset_value ,'asset_usage' => $asset_usage ,'asset_amc' =>$asset_amc ,'asset_insurance'=>$asset_insurance, 'asset_images'=>$asset_images,'asset_history'=>$asset_history,'tab'=>isset($tab)?$tab:"");
|
||||
$sub_asset_value_htmlPage = $this->load->view('asset_sub_value_list.php',$data,true);
|
||||
$this->layout->set('sub_asset_value_htmlPage', $sub_asset_value_htmlPage);
|
||||
$this->layout->set('editData', $assetData);
|
||||
|
||||
@ -35,5 +35,18 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
|
||||
@ -227,20 +227,16 @@ function checkFileFormat() {
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
let formSubmitted = false;
|
||||
|
||||
document.getElementById('myForm').addEventListener('submit', function(event) {
|
||||
if (formSubmitted) {
|
||||
event.preventDefault(); // Prevent the form from being submitted again
|
||||
return false;
|
||||
}
|
||||
|
||||
formSubmitted = true;
|
||||
document.getElementById('submitBtn').setAttribute('disabled', 'disabled');
|
||||
|
||||
// You might want to show a message or change button text to indicate submission
|
||||
|
||||
return true;
|
||||
});
|
||||
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>
|
||||
|
||||
@ -97,4 +97,18 @@
|
||||
format: 'DD-MM-YYYY'
|
||||
});
|
||||
|
||||
</script>
|
||||
</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>
|
||||
@ -33,4 +33,17 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
@ -102,4 +102,18 @@
|
||||
$('#myDatepicker7').datetimepicker({
|
||||
format: 'DD-MM-YYYY'
|
||||
});
|
||||
</script>
|
||||
</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>
|
||||
@ -26,7 +26,8 @@
|
||||
<div class="card-box table-responsive">
|
||||
<form class="" method="post" action="<?php echo base_url()?>Asset/filterAssets">
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>" >
|
||||
<input type="hidden" name="category" value="<?php echo $tableData[0]->category; ?>" >
|
||||
<?php $category_val = (gettype($tableData) == 'array') ? (isset($tableData[0]->category) ? $tableData[0]->category : "") : ""; ?>
|
||||
<input type="hidden" name="category" value="<?php echo $category_val; ?>" >
|
||||
<fieldset>
|
||||
<div class="col-md-5 col-sm-5 " for="first-name"> </div>
|
||||
<div class="col-md-3 col-sm-3 " for="first-name"><h2> Filter with purchase date </h2> </div>
|
||||
|
||||
@ -94,3 +94,17 @@
|
||||
});
|
||||
|
||||
</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>
|
||||
|
||||
@ -62,4 +62,18 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
@ -39,5 +39,18 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
|
||||
@ -32,5 +32,18 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
|
||||
@ -297,3 +297,17 @@ function checkFileFormat() {
|
||||
}
|
||||
}
|
||||
</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>
|
||||
@ -48,6 +48,20 @@ function validateKeyPress(event) {
|
||||
}
|
||||
}
|
||||
</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>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -30,6 +30,20 @@
|
||||
<button type="submit" class="btn btn-primary"><?php echo $submit_button_title; ?></button>
|
||||
</div>
|
||||
</form>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
<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}" title="Phone number with 6-9 and remaing 9 digit with 0-9" class="form-control" name="phone" value="<?php if(isset($third_party_data)) { echo $third_party_data->phone; } ?>" >
|
||||
<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>
|
||||
|
||||
@ -92,5 +92,29 @@
|
||||
</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>
|
||||
|
||||
|
||||
@ -172,9 +172,9 @@ class="form-control" required>
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Phone<a
|
||||
style="color:red;">*</a> </label>
|
||||
<div class="col-md-3 col-sm-3 ">
|
||||
<input id="phone" type="text" pattern="[6-9]{1}[0-9]{9}"
|
||||
<input id="phone" 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" name="phone"
|
||||
class="form-control" onkeyup="check_if_exists(this.id, this.value, this.name)">
|
||||
class="form-control" onkeyup="check_if_exists(this.id, this.value, this.name)" onkeypress="return matchnum(event)">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -341,4 +341,15 @@ function check_if_exists(id, value, name) {
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function matchnum(event) {
|
||||
var charcode;
|
||||
|
||||
charcode = event.which || event.keyCode;
|
||||
|
||||
if (charcode >= 48 && charcode <= 57) return true; //only numbers
|
||||
return false;
|
||||
|
||||
}
|
||||
</script>
|
||||
@ -115,6 +115,19 @@
|
||||
/* Allow labels to line wrap when menu is artificially narrowed */
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
#popup {
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
z-index: 9999;
|
||||
border: 2px solid #333;
|
||||
background-color: #fff;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@ -171,10 +184,10 @@ class="form-control">
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Phone<a
|
||||
style="color:red;">*</a> </label>
|
||||
<div class="col-md-3 col-sm-3">
|
||||
<input id="phone" type="text" pattern="[6-9]{1}[0-9]{9}"
|
||||
<input id="phone" 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" name="phone"
|
||||
value="<?php echo $businessData->phone; ?>" required="required"
|
||||
class="form-control" onkeyup="check_if_exists(this.id, this.value, this.name)" />
|
||||
class="form-control" onkeyup="check_if_exists(this.id, this.value, this.name)" onkeypress="return matchnum(event)" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -213,6 +226,10 @@ class="form-control" onkeyup="check_if_exists(this.id, this.value, this.name)" /
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="logo" name="logo" class="typeFile" type="file"
|
||||
value="<?php echo $businessData->logo; ?>">
|
||||
<?php if(!empty($businessData->logo)); ?><span class="help-block"><small id="click-me">Clik me to preview (<?= $businessData->logo; ?>)</small></span>
|
||||
</div>
|
||||
<div id="popup">
|
||||
<img src="<?php echo base_url('assets/uploads/logo/' . $businessData->logo); ?>" alt="Image">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -364,6 +381,29 @@ function check_if_exists(id, value, name) {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
// Function to show the popup and automatically close it after 5 seconds
|
||||
function showPopup() {
|
||||
document.getElementById('popup').style.display = 'block';
|
||||
setTimeout(function() {
|
||||
document.getElementById('popup').style.display = 'none';
|
||||
}, 3000); // Close after 3 seconds
|
||||
}
|
||||
|
||||
// Add event listener to the clickable text
|
||||
document.getElementById('click-me').addEventListener('click', showPopup);
|
||||
</script>
|
||||
<script>
|
||||
function matchnum(event) {
|
||||
var charcode;
|
||||
|
||||
charcode = event.which || event.keyCode;
|
||||
|
||||
if (charcode >= 48 && charcode <= 57) return true; //only numbers
|
||||
return false;
|
||||
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Body page content -->
|
||||
@ -178,21 +178,17 @@ function get_emp_id(emp_id, id){
|
||||
</script>
|
||||
|
||||
<script>
|
||||
let formSubmitted = false;
|
||||
|
||||
document.getElementById('myForm').addEventListener('submit', function(event) {
|
||||
if (formSubmitted) {
|
||||
event.preventDefault(); // Prevent the form from being submitted again
|
||||
return false;
|
||||
}
|
||||
|
||||
formSubmitted = true;
|
||||
document.getElementById('submitBtn').setAttribute('disabled', 'disabled');
|
||||
|
||||
// You might want to show a message or change button text to indicate submission
|
||||
|
||||
return true;
|
||||
});
|
||||
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>
|
||||
|
||||
|
||||
@ -178,3 +178,17 @@ function validateDateRange() {
|
||||
|
||||
</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>
|
||||
@ -45,7 +45,7 @@
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="email"> Email<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="email" name="email" value="<?php if(isset($editData)) { echo $editData->email; } ?>" required="required" class="form-control" type="email" >
|
||||
<input id="email" name="email" value="<?php if(isset($editData)) { echo $editData->email; } ?>" required="required" class="form-control" type="email" pattern="[^\s@]+@[^\s@]+\.[^\s@]+">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@ -453,6 +453,20 @@
|
||||
});
|
||||
});
|
||||
</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>
|
||||
|
||||
|
||||
|
||||
|
||||
@ -525,4 +525,18 @@ function removebutton(index) {
|
||||
// // }
|
||||
// // });
|
||||
// });
|
||||
</script>
|
||||
</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>
|
||||
@ -474,20 +474,16 @@ function remove_row(id)
|
||||
|
||||
</script>
|
||||
<script>
|
||||
let formSubmitted = false;
|
||||
|
||||
document.getElementById('expenceForm').addEventListener('submit', function(event) {
|
||||
if (formSubmitted) {
|
||||
event.preventDefault(); // Prevent the form from being submitted again
|
||||
return false;
|
||||
}
|
||||
|
||||
formSubmitted = true;
|
||||
document.getElementById('submitBtn').setAttribute('disabled', 'disabled');
|
||||
|
||||
// You might want to show a message or change button text to indicate submission
|
||||
|
||||
return true;
|
||||
});
|
||||
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>
|
||||
|
||||
@ -577,8 +577,21 @@ function calculateDateDifference() {
|
||||
|
||||
|
||||
</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>
|
||||
<!-- <script>
|
||||
let formSubmitted = false;
|
||||
|
||||
document.getElementById('myForm').addEventListener('submit', function(event) {
|
||||
@ -595,7 +608,7 @@ function calculateDateDifference() {
|
||||
return true;
|
||||
});
|
||||
|
||||
</script>
|
||||
</script> -->
|
||||
|
||||
|
||||
|
||||
|
||||
@ -210,6 +210,7 @@ public function check_password()
|
||||
redirect('logout');
|
||||
}
|
||||
else{
|
||||
redirect('User/changepassword');
|
||||
// $data['status'] = 'failed';
|
||||
// $data['csrf_hash'] = $this->security->get_csrf_hash();
|
||||
// echo json_encode($data);
|
||||
|
||||
@ -126,7 +126,7 @@
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Mobile<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="text" pattern="[6-9]{1}[0-9]{9}" title="Phone number with 6-9 and remaing 9 digit with 0-9" id="mobile" name="mobile" value="" required="required" class="form-control" onkeyup="check_if_exists(this.id, this.value, this.name)">
|
||||
<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" id="mobile" name="mobile" value="" required="required" class="form-control" onkeyup="check_if_exists(this.id, this.value, this.name)" onkeypress="return matchnum(event)">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Permission<a style="color:red;">*</a> </label>
|
||||
@ -166,7 +166,7 @@
|
||||
<div class="ln_solid"></div>
|
||||
<div class="item form-group">
|
||||
<div class="offset-md-8">
|
||||
<button class="btn btn-secondary" onclick="onclick=" <?= base_url() . "User/userList"; ?>"">Cancel</button>
|
||||
<button class="btn btn-secondary" onclick="<?= base_url() . "User/userList"; ?>">Cancel</button>
|
||||
<button class="btn btn-primary" type="reset">Reset</button>
|
||||
<button type="submit" class="btn btn-success">Submit</button>
|
||||
</div>
|
||||
@ -218,4 +218,15 @@ function check_if_exists(id, value, name) {
|
||||
submitBtn.disabled = true;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
function matchnum(event) {
|
||||
var charcode;
|
||||
|
||||
charcode = event.which || event.keyCode;
|
||||
|
||||
if (charcode >= 48 && charcode <= 57) return true; //only numbers
|
||||
return false;
|
||||
|
||||
}
|
||||
</script>
|
||||
@ -16,13 +16,13 @@
|
||||
<div class="x_panel">
|
||||
<div class="x_content">
|
||||
<br />
|
||||
<form id="change-pass" data-parsley-validate class="form-horizontal form-label-left" method="post"
|
||||
<form data-parsley-validate class="form-horizontal form-label-left" method="post"
|
||||
action="<?php echo base_url();?>User/check_password" enctype="multipart/form-data">
|
||||
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>"
|
||||
value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
|
||||
<!-- --------------------------- -->
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Old Password <a
|
||||
@ -65,9 +65,10 @@ class="fa fa-fw fa-eye field-icon toggle-password"></span>
|
||||
<div class="ln_solid"></div>
|
||||
<div class="item form-group">
|
||||
<div class="offset-md-8">
|
||||
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
||||
<button type="reset" class="btn btn-primary" >Reset</button>
|
||||
<button type="submit" id="submit" class="btn btn-success">Submit</button>
|
||||
<!-- <button class="btn btn-secondary" onclick="history.back()">Cancel</button> -->
|
||||
<button type="button" id="cancel" class="btn btn-secondary" onclick="window.location.href='<?= base_url() ?>Dashboard'">Cancel</button>
|
||||
<button type="reset" id="reset" class="btn btn-primary">Reset</button>
|
||||
<button type="submit" id="submit" class="btn btn-success" id="submit">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -90,30 +91,30 @@ class="fa fa-fw fa-eye field-icon toggle-password"></span>
|
||||
|
||||
<script>
|
||||
console.log($("#change-pass").serialize());
|
||||
$(document).on('click', '#submit', function() {
|
||||
var data = $("#change-pass").serialize();
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "<?php echo base_url();?>User/check_password",
|
||||
data: data,
|
||||
json: true,
|
||||
success: function(response) {
|
||||
response = jQuery.parseJSON(response);
|
||||
if (response.status == "success") {
|
||||
console.log("ssssssssss");
|
||||
$('input[name=csrf_test_name]').val(response.csrf_hash);
|
||||
location.href = "<?php echo base_url();?>Auth/logout";
|
||||
} else {
|
||||
$('input[name=csrf_test_name]').val(response.csrf_hash);
|
||||
$('#message1').html('Worng password').css('color', 'red');
|
||||
$('#password').val('');
|
||||
$('#confirm_password').val('');
|
||||
$('#message').html('');
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, err) {
|
||||
alert('text status ' + textStatus + ', err ' + err)
|
||||
}
|
||||
});
|
||||
});
|
||||
// $(document).on('click', '#submit', function() {
|
||||
// var data = $("#change-pass").serialize();
|
||||
// $.ajax({
|
||||
// type: "post",
|
||||
// url: "<?php echo base_url();?>User/check_password",
|
||||
// data: data,
|
||||
// json: true,
|
||||
// success: function(response) {
|
||||
// response = jQuery.parseJSON(response);
|
||||
// if (response.status == "success") {
|
||||
// console.log("ssssssssss");
|
||||
// $('input[name=csrf_test_name]').val(response.csrf_hash);
|
||||
// location.href = "<?php echo base_url();?>Auth/logout";
|
||||
// } else {
|
||||
// $('input[name=csrf_test_name]').val(response.csrf_hash);
|
||||
// $('#message1').html('Worng password').css('color', 'red');
|
||||
// $('#password').val('');
|
||||
// $('#confirm_password').val('');
|
||||
// $('#message').html('');
|
||||
// }
|
||||
// },
|
||||
// error: function(jqXHR, textStatus, err) {
|
||||
// alert('text status ' + textStatus + ', err ' + err)
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
</script>
|
||||
@ -48,7 +48,7 @@
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Email </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="text" id="email" name="email" value="<?php echo $editData->email; ?>"
|
||||
required="required" class="form-control ">
|
||||
required="required" class="form-control " pattern="[^\s@]+@[^\s@]+\.[^\s@]+">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@ -46,7 +46,7 @@
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Mobile<a style="color:red;">*</a></label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="text" pattern="[6-9]{1}[0-9]{9}" title="Phone number with 6-9 and remaing 9 digit with 0-9" id="mobile" name="mobile" value="<?php echo $editData->mobile; ?>" required="required" class="form-control" onkeyup="check_if_exists(this.id, this.value, this.name)">
|
||||
<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" id="mobile" name="mobile" value="<?php echo $editData->mobile; ?>" required="required" class="form-control" onkeyup="check_if_exists(this.id, this.value, this.name)" onkeypress="return matchnum(event)">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name">Permission<a style="color:red;">*</a></label>
|
||||
@ -140,4 +140,15 @@ function check_if_exists(id, value, name) {
|
||||
submitBtn.disabled = true;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
function matchnum(event) {
|
||||
var charcode;
|
||||
|
||||
charcode = event.which || event.keyCode;
|
||||
|
||||
if (charcode >= 48 && charcode <= 57) return true; //only numbers
|
||||
return false;
|
||||
|
||||
}
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user