master module 4 vadivel J 26-12-2024
This commit is contained in:
parent
9eb7c54b97
commit
3e46d6568f
@ -323,6 +323,7 @@ class Rawmaterialdetails_model extends Model
|
|||||||
$builder->where('REPLACE(MaterialName, " ", "")' , $materialName);
|
$builder->where('REPLACE(MaterialName, " ", "")' , $materialName);
|
||||||
|
|
||||||
$query = $builder->get();
|
$query = $builder->get();
|
||||||
|
|
||||||
if ($query->getNumRows() > 0) {
|
if ($query->getNumRows() > 0) {
|
||||||
return $query->getResultArray();
|
return $query->getResultArray();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -42,14 +42,14 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="p-2">
|
<div class="p-2">
|
||||||
<form role="form" id="addUser" action="<?php echo base_url() ?>addNewRawmaterial" method="post">
|
<form role="form" id="addMaterialForm" action="<?php echo base_url() ?>addNewRawmaterial" method="post">
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<!-- Supplier Information -->
|
<!-- Supplier Information -->
|
||||||
<div class="col-md-12" style="margin-bottom: 27px;">
|
<div class="col-md-12" style="margin-bottom: 27px;">
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class=" col-md-3">
|
<div class=" col-md-3">
|
||||||
<label class="col-form-label" for="MaterialName">Material Name<span class="badge">*</span></label>
|
<label class="col-form-label" for="MaterialName">Material Name<span class="badge">*</span></label>
|
||||||
<input type="text" class="form-control required " onkeypress="return BlockSpecial(event);" required id="MaterialName" name="MaterialName" maxlength="255">
|
<input type="text" class="form-control required " required id="MaterialName" name="MaterialName" maxlength="255">
|
||||||
</div>
|
</div>
|
||||||
<div class=" col-md-3">
|
<div class=" col-md-3">
|
||||||
<label class="col-form-label" for="MaterialType">Material Type<span class="badge">*</span></label>
|
<label class="col-form-label" for="MaterialType">Material Type<span class="badge">*</span></label>
|
||||||
@ -137,7 +137,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-md-12 text-right">
|
<div class="col-md-12 text-right">
|
||||||
<input type="reset" id="reset" class="btn btn-reset" style="background-color: red;color: white; margin-right: 15px;width: 80px;" value="Reset" />
|
<input type="reset" id="reset" class="btn btn-reset" style="background-color: red;color: white; margin-right: 15px;width: 80px;" value="Reset" />
|
||||||
<input type="submit" onclick="return Validate();" value="Submit" class="btn btn-success">
|
<input type="button" id="addMaterialBtnId" value="Submit" class="btn btn-success">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@ -291,9 +291,18 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#MaterialName').change(function() {
|
$('#addMaterialBtnId').click(function() {
|
||||||
|
|
||||||
var materialName = $('#MaterialName').val();
|
|
||||||
|
//validate
|
||||||
|
|
||||||
|
let validation = Validate();
|
||||||
|
|
||||||
|
if(!validation){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var materialName = $('#MaterialName').val().trim();
|
||||||
var materialCode = '';
|
var materialCode = '';
|
||||||
|
|
||||||
if(materialName == ''){
|
if(materialName == ''){
|
||||||
@ -311,15 +320,19 @@
|
|||||||
type: "POST",
|
type: "POST",
|
||||||
url: "<?php echo base_url(); ?>materialExist",
|
url: "<?php echo base_url(); ?>materialExist",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
var count = data.length;
|
|
||||||
if (count >= 1) {
|
if (data && data.length >= 1) {
|
||||||
$('#loader').hide();
|
$('#loader').hide();
|
||||||
|
|
||||||
if(data[0]?.IsActive == 1){
|
if(data[0]?.IsActive == 1){
|
||||||
alert('Material name already existed ! ');
|
alert('Material name already existed ! ');
|
||||||
$('#MaterialName').val('');
|
$('#MaterialName').val('');
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
alert('Material name already existing in the deleted section.!!');
|
alert('Material name already existing in the deleted section.!!');
|
||||||
|
$('#MaterialName').val('');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -330,11 +343,15 @@
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
alert("'" + materialname + "' - related materials are , " + " \n \n" + related_name);
|
alert("'" + materialName + "' - related materials are , " + " \n \n" + related_name);
|
||||||
$("#MaterialName").val('');
|
$("#MaterialName").val('');
|
||||||
$("#MaterialName").focus();
|
$("#MaterialName").focus();
|
||||||
} else {
|
|
||||||
|
|
||||||
|
} else{
|
||||||
$('#loader').hide();
|
$('#loader').hide();
|
||||||
|
|
||||||
|
$('addMaterialForm').submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -350,6 +367,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
function Validate() {
|
function Validate() {
|
||||||
|
|
||||||
if ($("#MaterialName").val().length < 1) {
|
if ($("#MaterialName").val().length < 1) {
|
||||||
alert('Please Enter MaterialName');
|
alert('Please Enter MaterialName');
|
||||||
$("#MaterialName").focus();
|
$("#MaterialName").focus();
|
||||||
@ -371,6 +389,8 @@
|
|||||||
$("#MaterialType").focus();
|
$("#MaterialType").focus();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -434,4 +454,15 @@
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
$(document).on('keydown', function(event) {
|
||||||
|
if (event.key === 'Enter') {
|
||||||
|
event.preventDefault(); // Prevent default Enter key behavior
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -158,7 +158,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-md-12 text-right">
|
<div class="col-md-12 text-right">
|
||||||
<input type="reset" id="reset" class="btn btn-reset" style="background-color: red;color: white; margin-right: 15px;width: 80px;" value="Reset" />
|
<input type="reset" id="reset" class="btn btn-reset" style="background-color: red;color: white; margin-right: 15px;width: 80px;" value="Reset" />
|
||||||
<input type="submit" onclick="return Validate();" value="Submit" class="btn btn-success">
|
<input type="button" id="addAssetBtnId" value="Submit" class="btn btn-success">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@ -383,8 +383,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -431,43 +430,68 @@
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#AssetName').on('change',function(){
|
$('#addAssetBtnId').on('click',function(){
|
||||||
|
|
||||||
let assetName = $(this).val().trim();
|
let validation = validate();
|
||||||
let assetId = $('#AssetCode').val() ?? '';
|
|
||||||
|
|
||||||
$('#loader').show();
|
if(validation){
|
||||||
|
|
||||||
|
let assetName = $('#AssetName').val().trim();
|
||||||
|
let assetId = $('#AssetCode').val() ?? '';
|
||||||
|
|
||||||
|
$('#loader').show();
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type:'POST',
|
||||||
|
url:'<?php echo base_url()?>assetdetails/checkAssetName',
|
||||||
|
data:{assetId,assetName},
|
||||||
|
success: function(data){
|
||||||
|
if(data && data.length>0){
|
||||||
|
let IsActive = data[0]?.IsActive;
|
||||||
|
if(IsActive == 1){
|
||||||
|
alert("Asset Name Exists..!!");
|
||||||
|
$('#AssetName').val('');
|
||||||
|
$('#AssetName').focus();
|
||||||
|
}else{
|
||||||
|
alert("Asset Name Existing in deleted section..!!");
|
||||||
|
$('#AssetName').val('');
|
||||||
|
$('#AssetName').focus();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$('#addAsset').submit();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
error: function(error){
|
||||||
|
//error
|
||||||
|
console.error('error ocurred' + error);
|
||||||
|
},
|
||||||
|
complete :function (){
|
||||||
|
$('#loader').hide();
|
||||||
|
console.log('ajax call completed..!!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
$.ajax({
|
|
||||||
type:'POST',
|
|
||||||
url:'<?php echo base_url()?>assetdetails/checkAssetName',
|
|
||||||
data:{assetId,assetName},
|
|
||||||
success: function(data){
|
|
||||||
if(data && data.length>0){
|
|
||||||
let IsActive = data[0]?.IsActive;
|
|
||||||
if(IsActive == 1){
|
|
||||||
alert("Asset Name Exists..!!");
|
|
||||||
$('#AssetName').val('');
|
|
||||||
$('#AssetName').focus();
|
|
||||||
}else{
|
|
||||||
alert("Asset Name Existing in deleted section..!!");
|
|
||||||
$('#AssetName').val('');
|
|
||||||
$('#AssetName').focus();
|
|
||||||
}
|
}
|
||||||
}
|
else{
|
||||||
},
|
return false;
|
||||||
error: function(error){
|
}
|
||||||
//error
|
|
||||||
console.error('error ocurred' + error);
|
});
|
||||||
},
|
|
||||||
complete :function (){
|
|
||||||
$('#loader').hide();
|
|
||||||
console.log('ajax call completed..!!');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
$(document).on('keydown', function(event) {
|
||||||
|
if (event.key === 'Enter') {
|
||||||
|
event.preventDefault(); // Prevent default Enter key behavior
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -92,7 +92,7 @@
|
|||||||
<div class="col-md-12 text-right">
|
<div class="col-md-12 text-right">
|
||||||
<input type="hidden" name="txtRowCount" id="txtRowCount" />
|
<input type="hidden" name="txtRowCount" id="txtRowCount" />
|
||||||
<a class="btn btn-secondary" href="<?php echo base_url() ?>configlisting" class="btn btn-secondary">Cancel</a>
|
<a class="btn btn-secondary" href="<?php echo base_url() ?>configlisting" class="btn btn-secondary">Cancel</a>
|
||||||
<input type="submit" onclick="return Validate();" value="Submit" class="btn btn-success">
|
<input type="button" id="addConFigBtnId" value="Submit" class="btn btn-success">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@ -388,7 +388,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$('#configurationname').change(function () {
|
$('#addConFigBtnId').click(function (){
|
||||||
$('#loader').show();
|
$('#loader').show();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
|
||||||
@ -408,7 +408,9 @@
|
|||||||
$('#configurationname').val('');
|
$('#configurationname').val('');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}else{
|
||||||
|
$('#addconfig').submit();
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
error:function(error){
|
error:function(error){
|
||||||
@ -438,4 +440,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
$(document).on('keydown', function(event) {
|
||||||
|
if (event.key === 'Enter') {
|
||||||
|
event.preventDefault(); // Prevent default Enter key behavior
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -429,4 +429,15 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
$(document).on('keydown', function(event) {
|
||||||
|
if (event.key === 'Enter') {
|
||||||
|
event.preventDefault(); // Prevent default Enter key behavior
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -156,7 +156,7 @@ if (!empty($assetList)) {
|
|||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<form role="form" id="addAsset" action="<?php echo base_url() ?>editasset" method="post">
|
<form role="form" id="editAsset" action="<?php echo base_url() ?>editasset" method="post">
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
|
|
||||||
<input type="text" class="form-control" id="AssetCode" name="AssetCode" value="<?php echo $AssetCode; ?>" hidden>
|
<input type="text" class="form-control" id="AssetCode" name="AssetCode" value="<?php echo $AssetCode; ?>" hidden>
|
||||||
@ -272,7 +272,7 @@ if (!empty($assetList)) {
|
|||||||
<div class="form-row mt-4 text-right">
|
<div class="form-row mt-4 text-right">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<a href="<?php echo base_url() ?>assetListing" class="btn btn-secondary">Cancel</a>
|
<a href="<?php echo base_url() ?>assetListing" class="btn btn-secondary">Cancel</a>
|
||||||
<button type="submit" class="btn btn-success">Submit</button>
|
<button type="button" id="editAssetBtnId" class="btn btn-success">Submit</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@ -426,7 +426,7 @@ if (!empty($assetList)) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#AssetName').on('change',function(){
|
$('#editAssetBtnId').on('click',function(){
|
||||||
|
|
||||||
let assetId = $('#AssetCode').val();
|
let assetId = $('#AssetCode').val();
|
||||||
let assetName = $(this).val().trim();
|
let assetName = $(this).val().trim();
|
||||||
@ -438,18 +438,22 @@ if (!empty($assetList)) {
|
|||||||
url:'<?php echo base_url()?>assetdetails/checkAssetName',
|
url:'<?php echo base_url()?>assetdetails/checkAssetName',
|
||||||
data:{assetId,assetName},
|
data:{assetId,assetName},
|
||||||
success: function(data){
|
success: function(data){
|
||||||
if(data && data.length>0){
|
if(data && data.length>0){
|
||||||
let IsActive = data[0]?.IsActive;
|
let IsActive = data[0]?.IsActive;
|
||||||
if(IsActive == 1){
|
if(IsActive == 1){
|
||||||
alert("Asset Name Exists..!!");
|
alert("Asset Name Exists..!!");
|
||||||
$('#AssetName').val('');
|
$('#AssetName').val('');
|
||||||
$('#AssetName').focus();
|
$('#AssetName').focus();
|
||||||
|
}else{
|
||||||
|
alert("Asset Name Existing in deleted section..!!");
|
||||||
|
$('#AssetName').val('');
|
||||||
|
$('#AssetName').focus();
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
alert("Asset Name Existing in deleted section..!!");
|
|
||||||
$('#AssetName').val('');
|
$('#editAsset').submit();
|
||||||
$('#AssetName').focus();
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
error: function(error){
|
error: function(error){
|
||||||
//error
|
//error
|
||||||
@ -465,4 +469,15 @@ if (!empty($assetList)) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
$(document).on('keydown', function(event) {
|
||||||
|
if (event.key === 'Enter') {
|
||||||
|
event.preventDefault(); // Prevent default Enter key behavior
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -289,7 +289,7 @@ if ($total <= $reorder) {
|
|||||||
<button type="button" class="btn btn-secondary" onclick="history.back()">
|
<button type="button" class="btn btn-secondary" onclick="history.back()">
|
||||||
<span class="bold">Cancel</span>
|
<span class="bold">Cancel</span>
|
||||||
</button>
|
</button>
|
||||||
<input type="submit" class="btn btn-success" value="Submit" />
|
<input type="button" id="editRawMaterialBtnId" class="btn btn-success" value="Submit" />
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div><!-- /.card-body -->
|
</div><!-- /.card-body -->
|
||||||
@ -438,7 +438,7 @@ if ($total <= $reorder) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#MaterialName').change(function() {
|
$('#editRawMaterialBtnId').click(function(){
|
||||||
|
|
||||||
var materialName = $('#MaterialName').val();
|
var materialName = $('#MaterialName').val();
|
||||||
var materialCode = $('#RMcode').val();
|
var materialCode = $('#RMcode').val();
|
||||||
@ -458,15 +458,15 @@ if ($total <= $reorder) {
|
|||||||
type: "POST",
|
type: "POST",
|
||||||
url: "<?php echo base_url(); ?>materialExist",
|
url: "<?php echo base_url(); ?>materialExist",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
var count = data.length;
|
|
||||||
|
|
||||||
if (count >= 1) {
|
if (data && data.length >= 1) {
|
||||||
$('#loader').hide();
|
$('#loader').hide();
|
||||||
if(data[0]?.IsActive == 1){
|
if(data[0]?.IsActive == 1){
|
||||||
alert('Material name already existed ! ');
|
alert('Material name already existed ! ');
|
||||||
$('#MaterialName').val('');
|
$('#MaterialName').val('');
|
||||||
}else{
|
}else{
|
||||||
alert('Material name already existing in the deleted section.!!');
|
alert('Material name already existing in the deleted section.!!');
|
||||||
|
$('#MaterialName').val('');
|
||||||
}
|
}
|
||||||
var related_name = "";
|
var related_name = "";
|
||||||
$.each(data, function(i, obj) {
|
$.each(data, function(i, obj) {
|
||||||
@ -475,12 +475,13 @@ if ($total <= $reorder) {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
alert("'" + materialname + "' - related materials are , " + " \n \n" + related_name);
|
alert("'" + materialName + "' - related materials are , " + " \n \n" + related_name);
|
||||||
$("#MaterialName").val('');
|
$("#MaterialName").val('');
|
||||||
$("#MaterialName").focus();
|
$("#MaterialName").focus();
|
||||||
} else {
|
} else {
|
||||||
$('#loader').hide();
|
$('#loader').hide();
|
||||||
// alert("empty data");
|
console.log("working")
|
||||||
|
$('#editRawmaterial').submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -556,4 +557,15 @@ if ($total <= $reorder) {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
$(document).on('keydown', function(event) {
|
||||||
|
if (event.key === 'Enter') {
|
||||||
|
event.preventDefault(); // Prevent default Enter key behavior
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
@ -37,7 +37,7 @@ if (!empty($master)) {
|
|||||||
helper('form');
|
helper('form');
|
||||||
$error = session()->getFlashdata('error');
|
$error = session()->getFlashdata('error');
|
||||||
if ($error) {
|
if ($error) {
|
||||||
?>
|
?>
|
||||||
<div class="alert alert-danger alert-dismissable">
|
<div class="alert alert-danger alert-dismissable">
|
||||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||||
<?php echo session()->getFlashdata('error'); ?>
|
<?php echo session()->getFlashdata('error'); ?>
|
||||||
@ -47,7 +47,7 @@ if (!empty($master)) {
|
|||||||
<?php
|
<?php
|
||||||
$success = session()->getFlashdata('success');
|
$success = session()->getFlashdata('success');
|
||||||
if ($success) {
|
if ($success) {
|
||||||
?>
|
?>
|
||||||
<div class="alert alert-info alert-dismissable">
|
<div class="alert alert-info alert-dismissable">
|
||||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||||
<?php echo session()->getFlashdata('success'); ?>
|
<?php echo session()->getFlashdata('success'); ?>
|
||||||
@ -61,7 +61,7 @@ if (!empty($master)) {
|
|||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<?php
|
<?php
|
||||||
$attributes = array('class' => 'form-horizontal', 'id' => 'editConfig');
|
$attributes = array('class' => 'form-horizontal', 'id' => 'editConfig');
|
||||||
echo form_open(base_url() . 'configurationctrl/updateconfig', $attributes);?>
|
echo form_open(base_url() . 'configurationctrl/updateconfig', $attributes); ?>
|
||||||
|
|
||||||
<div class="form-row" style="margin-top:10px">
|
<div class="form-row" style="margin-top:10px">
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
@ -77,13 +77,13 @@ if (!empty($master)) {
|
|||||||
<label class="col-form-label" for="ConfigName">Configuration Name</label>
|
<label class="col-form-label" for="ConfigName">Configuration Name</label>
|
||||||
<font color="Red">*</font>
|
<font color="Red">*</font>
|
||||||
<?php
|
<?php
|
||||||
$data = array('name' => 'ConfigName', 'value' => set_value('ConfigName', $ConfigName), 'id' => 'ConfigName', 'class' => 'form-control', 'required' => 'true', 'maxlength' => '20');
|
$data = array('name' => 'ConfigName', 'value' => set_value('ConfigName', $ConfigName), 'id' => 'ConfigName', 'class' => 'form-control', 'required' => 'true', 'maxlength' => '30');
|
||||||
echo form_input($data);
|
echo form_input($data);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<label class="col-form-label" for="Remarks">Comments</label>
|
<label class="col-form-label" for="Remarks"> Comments </label>
|
||||||
<font color="Red">*</font>
|
<font color="Red">*</font>
|
||||||
<?php
|
<?php
|
||||||
$data = array('name' => 'Remarks', 'value' => set_value('Remarks', $Comments), 'id' => 'Remarks', 'class' => 'form-control', 'required' => 'true', 'maxlength' => '20');
|
$data = array('name' => 'Remarks', 'value' => set_value('Remarks', $Comments), 'id' => 'Remarks', 'class' => 'form-control', 'required' => 'true', 'maxlength' => '20');
|
||||||
@ -95,8 +95,8 @@ if (!empty($master)) {
|
|||||||
<div class="form-row" style="margin-top:10px">
|
<div class="form-row" style="margin-top:10px">
|
||||||
<div class="col-md-12 text-right">
|
<div class="col-md-12 text-right">
|
||||||
<a data-toggle="modal" href="#AddConfiguration" style="margin-right: 10px;"
|
<a data-toggle="modal" href="#AddConfiguration" style="margin-right: 10px;"
|
||||||
class="btn btn-success"><i class="fa fa-plus"></i> Add
|
class="btn btn-success"><i class="fa fa-plus"></i>
|
||||||
Configuration</a>
|
Configuration Value</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ if (!empty($master)) {
|
|||||||
$index = 0;
|
$index = 0;
|
||||||
foreach ($child as $con) {
|
foreach ($child as $con) {
|
||||||
$index++;
|
$index++;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<input type="hidden" name="DbKey<?php echo $index ?>"
|
<input type="hidden" name="DbKey<?php echo $index ?>"
|
||||||
id="DbKey<?php echo $index ?>" value="<?php echo $con->Key ?>">
|
id="DbKey<?php echo $index ?>" value="<?php echo $con->Key ?>">
|
||||||
@ -143,10 +143,10 @@ if (!empty($master)) {
|
|||||||
value="<?php echo $con->ConfigValue ?>">
|
value="<?php echo $con->ConfigValue ?>">
|
||||||
|
|
||||||
<tr class="<?php if ($con->isActive == 0) {
|
<tr class="<?php if ($con->isActive == 0) {
|
||||||
echo "deactivatedRow";
|
echo "deactivatedRow";
|
||||||
} ?>" style="<?php if ($con->isActive == 0) {
|
} ?>" style="<?php if ($con->isActive == 0) {
|
||||||
echo "display:none";
|
echo "display:none";
|
||||||
} ?>">
|
} ?>">
|
||||||
|
|
||||||
<td><?php echo $index; ?></td>
|
<td><?php echo $index; ?></td>
|
||||||
<td><?php echo $con->ConfigValue; ?></td>
|
<td><?php echo $con->ConfigValue; ?></td>
|
||||||
@ -168,8 +168,8 @@ if (!empty($master)) {
|
|||||||
title="Click here to Edit Config Value"></i>
|
title="Click here to Edit Config Value"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a onclick="confirmDeleteConfig(event)" href="<?php echo base_url() . 'configurationctrl/deleteConfigValue
|
<a onclick="confirmDeleteConfig(event)" href="<?php echo base_url() . 'configurationctrl/deleteConfigValue
|
||||||
?ConfigValue=' . $con->ConfigValue . '
|
?ConfigValue=' . $con->ConfigValue . '
|
||||||
&ConfigID=' . $con->Config_ID; ?>">
|
&ConfigID=' . $con->Config_ID; ?>">
|
||||||
@ -182,7 +182,7 @@ if (!empty($master)) {
|
|||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php }
|
<?php }
|
||||||
} ?>
|
} ?>
|
||||||
<input type="hidden" name="txtRowCount" id="txtRowCount"
|
<input type="hidden" name="txtRowCount" id="txtRowCount"
|
||||||
value="<?php echo $index ?>" />
|
value="<?php echo $index ?>" />
|
||||||
@ -194,7 +194,7 @@ if (!empty($master)) {
|
|||||||
<div class="form-row text-right" style="margin-top:10px; text-align:right">
|
<div class="form-row text-right" style="margin-top:10px; text-align:right">
|
||||||
<div class="col-md-12 text-right">
|
<div class="col-md-12 text-right">
|
||||||
<a href="<?php echo base_url() ?>configlisting" class="btn btn-secondary">Cancel</a>
|
<a href="<?php echo base_url() ?>configlisting" class="btn btn-secondary">Cancel</a>
|
||||||
<input type="submit" class="btn btn-success" value="Update" />
|
<input type="button" id="updateConfigBtnId" class="btn btn-success" value="Update" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -234,8 +234,7 @@ if (!empty($master)) {
|
|||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<a class="btn btn-success" style="background-color: grey;border: none;margin-right:10px"
|
<a class="btn btn-success" style="background-color: grey;border: none;margin-right:10px"
|
||||||
data-dismiss="modal">Cancel</a>
|
data-dismiss="modal">Cancel</a>
|
||||||
<a class="btn btn-success font tempClickAdd" id="tempClickAdd"><i
|
<a class="btn btn-success font tempClickAdd" id="tempClickAdd"> Add </a>
|
||||||
class="fa fa-plus"></i> Add</a>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -330,13 +329,14 @@ if (!empty($master)) {
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function () {
|
$(document).ready(function() {
|
||||||
|
|
||||||
var index = $('#txtRowCount').val();
|
var index = $('#txtRowCount').val();
|
||||||
var userid = '';
|
var userid = '';
|
||||||
|
|
||||||
$("#Edit").on("shown.bs.modal", function (e) {
|
$("#Edit").on("shown.bs.modal", function(e) {
|
||||||
userid = $(e.relatedTarget).data('userid');
|
userid = $(e.relatedTarget).data('userid');
|
||||||
$('#key').val($('#configtable tr:eq(' + userid + ') td:eq(0)').text());
|
$('#key').val($('#configtable tr:eq(' + userid + ') td:eq(0)').text());
|
||||||
$('#Config_ID').val($('#ConfigId').val());
|
$('#Config_ID').val($('#ConfigId').val());
|
||||||
@ -345,7 +345,7 @@ if (!empty($master)) {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.tempClickAdd').click(function () {
|
$('.tempClickAdd').click(function() {
|
||||||
|
|
||||||
var cid = $('#ConfigId').val()
|
var cid = $('#ConfigId').val()
|
||||||
if ($("#AddConfigValue").val() != '-1' && $("#AddConfigValue").val() != null && $("#AddConfigValue").val() != '') {
|
if ($("#AddConfigValue").val() != '-1' && $("#AddConfigValue").val() != null && $("#AddConfigValue").val() != '') {
|
||||||
@ -404,7 +404,7 @@ if (!empty($master)) {
|
|||||||
theForm.append(input);
|
theForm.append(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
$('.tempClickUpdate').click(function () {
|
$('.tempClickUpdate').click(function() {
|
||||||
|
|
||||||
|
|
||||||
if ($("#configValue").val() != '') {
|
if ($("#configValue").val() != '') {
|
||||||
@ -450,7 +450,7 @@ if (!empty($master)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//var baseurl = "<?php print base_url(); ?>";
|
//var baseurl = "<?php print base_url(); ?>";
|
||||||
$(".editConfig").submit(function (e) {
|
$(".editConfig").submit(function(e) {
|
||||||
if (validate()) {
|
if (validate()) {
|
||||||
|
|
||||||
$('#loader').show();
|
$('#loader').show();
|
||||||
@ -458,7 +458,7 @@ if (!empty($master)) {
|
|||||||
data: $('.editConfig').serialize(),
|
data: $('.editConfig').serialize(),
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: "<?php echo base_url(); ?>configurationctrl/configedit",
|
url: "<?php echo base_url(); ?>configurationctrl/configedit",
|
||||||
success: function (data) {
|
success: function(data) {
|
||||||
//alert(data);
|
//alert(data);
|
||||||
$('#loader').hide();
|
$('#loader').hide();
|
||||||
|
|
||||||
@ -493,57 +493,60 @@ if (!empty($master)) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$('#ConfigName').change(function () {
|
$('#updateConfigBtnId').click(function() {
|
||||||
|
|
||||||
$('#loader').show();
|
$('#loader').show();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
data: {
|
data: {
|
||||||
configName: $('#ConfigName').val().trim(),
|
configName: $('#ConfigName').val().trim(),
|
||||||
configId : $('#ConfigId').val().trim()
|
configId: $('#ConfigId').val().trim()
|
||||||
},
|
},
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: "<?php echo base_url(); ?>configurationctrl/configNameCheck",
|
url: "<?php echo base_url(); ?>configurationctrl/configNameCheck",
|
||||||
success: function (data) {
|
success: function(data) {
|
||||||
|
|
||||||
if (data && data.length > 0) {
|
if (data && data.length > 0) {
|
||||||
|
|
||||||
if (data[0]?.isActive == 1) {
|
if (data[0]?.isActive == 1) {
|
||||||
alert("This Configuration Name is already present. kindly change it..!!");
|
alert("This Configuration Name is already present. kindly change it..!!");
|
||||||
$('#ConfigName').val('');
|
$('#ConfigName').val('');
|
||||||
return;
|
event.preventDefault();
|
||||||
|
return false;
|
||||||
} else {
|
} else {
|
||||||
alert("This Configuration Name is already present in deleted section. kindly reactivate it If needed..!!");
|
alert("This Configuration Name is already present in deleted section. kindly reactivate it If needed..!!");
|
||||||
$('#ConfigName').val('');
|
$('#ConfigName').val('');
|
||||||
return;
|
event.preventDefault();
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
$('#editConfig').submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
error: function (error) {
|
error: function(error) {
|
||||||
console.log("error occured..!!", error);
|
console.log("error occured..!!", error);
|
||||||
},
|
},
|
||||||
complete: function () {
|
complete: function() {
|
||||||
$('#loader').hide();
|
$('#loader').hide();
|
||||||
console.log('ajax call completed..!!');
|
console.log('ajax call completed..!!');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
$('#AddConfigValue, #configValue').change(function() {
|
||||||
$('#AddConfigValue, #configValue').change(function () {
|
|
||||||
|
|
||||||
let configValue = $(this).val();
|
let configValue = $(this).val();
|
||||||
let configTable = customTableToJson();
|
let configTable = customTableToJson();
|
||||||
let configValueExisting = configTable.filter(element => element['Configuration Value'] == configValue);
|
let configValueExisting = configTable.filter(element => element['Configuration Value'] == configValue);
|
||||||
|
|
||||||
if(configValueExisting && configValueExisting.length > 0){
|
if (configValueExisting && configValueExisting.length > 0) {
|
||||||
alert('configuration value is already present , Kindly check in Table and archive too..!!');
|
alert('configuration value is already present , Kindly check in Table and archive too..!!');
|
||||||
$(this).val('');
|
$(this).val('');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -553,14 +556,14 @@ if (!empty($master)) {
|
|||||||
let headers = [];
|
let headers = [];
|
||||||
|
|
||||||
// Get table headers
|
// Get table headers
|
||||||
$(`#configtable thead tr th`).each(function () {
|
$(`#configtable thead tr th`).each(function() {
|
||||||
headers.push($(this).text().trim());
|
headers.push($(this).text().trim());
|
||||||
});
|
});
|
||||||
|
|
||||||
// Get table rows including hidden ones
|
// Get table rows including hidden ones
|
||||||
$(`#configtable tbody tr`).each(function () {
|
$(`#configtable tbody tr`).each(function() {
|
||||||
let row = {};
|
let row = {};
|
||||||
$(this).find('td').each(function (index) {
|
$(this).find('td').each(function(index) {
|
||||||
// Use the headers as keys for JSON
|
// Use the headers as keys for JSON
|
||||||
let header = headers[index];
|
let header = headers[index];
|
||||||
row[header] = $(this).text().trim();
|
row[header] = $(this).text().trim();
|
||||||
@ -570,19 +573,17 @@ if (!empty($master)) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return rows;
|
return rows;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
|
||||||
function showChildArchiveList() {
|
function showChildArchiveList() {
|
||||||
let isChecked = $("#showChildArchiveId").prop('checked');
|
let isChecked = $("#showChildArchiveId").prop('checked');
|
||||||
|
|
||||||
// Show or hide the rows based on checkbox status
|
// Show or hide the rows based on checkbox status
|
||||||
$(".deactivatedRow").each(function () {
|
$(".deactivatedRow").each(function() {
|
||||||
if (isChecked) {
|
if (isChecked) {
|
||||||
$(this).show();
|
$(this).show();
|
||||||
} else {
|
} else {
|
||||||
@ -593,12 +594,12 @@ if (!empty($master)) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function() {
|
||||||
let table = $('#configtable');
|
let table = $('#configtable');
|
||||||
|
|
||||||
showChildArchiveList();
|
showChildArchiveList();
|
||||||
|
|
||||||
table.on('draw', function () {
|
table.on('draw', function() {
|
||||||
showChildArchiveList();
|
showChildArchiveList();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -606,12 +607,28 @@ if (!empty($master)) {
|
|||||||
|
|
||||||
function confirmDeleteConfig(event) {
|
function confirmDeleteConfig(event) {
|
||||||
let result = confirm("Do You want to delete this configuration ?");
|
let result = confirm("Do You want to delete this configuration ?");
|
||||||
if (result) { return; } else { event.preventDefault(); }
|
if (result) {
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function confirmReActivateConfig(event) {
|
function confirmReActivateConfig(event) {
|
||||||
let result = confirm("Do You want to Re activate deleted configuration ?");
|
let result = confirm("Do You want to Re activate deleted configuration ?");
|
||||||
if (result) { return; } else { event.preventDefault(); }
|
if (result) {
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).on('keydown', function(event) {
|
||||||
|
if (event.key === 'Enter') {
|
||||||
|
event.preventDefault(); // Prevent default Enter key behavior
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@ -54,10 +54,18 @@ $energyType = $masterData['energy_type'] ?? '';
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<form action="<?= empty($masterData)
|
<form
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
action="<?= empty($masterData)
|
||||||
? base_url('createFactoryMachineMasterDetails')
|
? base_url('createFactoryMachineMasterDetails')
|
||||||
: base_url('updateFactoryMachineMasterDetails?id=' . $masterData['id']); ?>" method="post"
|
: base_url('updateFactoryMachineMasterDetails?id=' . $masterData['id']); ?>" method="post"
|
||||||
class="form-label-left">
|
|
||||||
|
id="factoryFormId"
|
||||||
|
class="form-label-left">
|
||||||
|
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
|
|
||||||
|
|
||||||
@ -79,7 +87,7 @@ $energyType = $masterData['energy_type'] ?? '';
|
|||||||
class="text-danger">*</span></label>
|
class="text-danger">*</span></label>
|
||||||
<select name="energyType" id="energyType"
|
<select name="energyType" id="energyType"
|
||||||
class="form-control searchabledropdown" data-toggle="select2" required>
|
class="form-control searchabledropdown" data-toggle="select2" required>
|
||||||
<option value="-1">Select Energy Type</option>
|
<option value="">Select Energy Type</option>
|
||||||
<option value="diesel" <?= $energyType == 'diesel' ? 'selected' : '' ?>> Diesel
|
<option value="diesel" <?= $energyType == 'diesel' ? 'selected' : '' ?>> Diesel
|
||||||
</option>
|
</option>
|
||||||
<option value="petrol" <?= $energyType == 'petrol' ? 'selected' : '' ?>> Petrol
|
<option value="petrol" <?= $energyType == 'petrol' ? 'selected' : '' ?>> Petrol
|
||||||
@ -102,7 +110,7 @@ $energyType = $masterData['energy_type'] ?? '';
|
|||||||
|
|
||||||
<div class="form-group col">
|
<div class="form-group col">
|
||||||
|
|
||||||
<button type="submit"
|
<button type="button" id="submitBtnId"
|
||||||
class="btn btn-info waves-effect waves-light">Submit</button>
|
class="btn btn-info waves-effect waves-light">Submit</button>
|
||||||
|
|
||||||
<button type="button" class="btn btn-secondary"
|
<button type="button" class="btn btn-secondary"
|
||||||
@ -127,8 +135,42 @@ $energyType = $masterData['energy_type'] ?? '';
|
|||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$('#machineName').on('change', function () {
|
|
||||||
let machineName = $(this).val().trim();
|
function validate(){
|
||||||
|
|
||||||
|
let machineName = $('#machineName').val().trim();
|
||||||
|
let machineType = $('#machineType').val().trim();
|
||||||
|
let energyType = $('#energyType').val().trim();
|
||||||
|
|
||||||
|
if(machineName == ''){
|
||||||
|
alert('Machine Name is required..!!');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(machineType == ''){
|
||||||
|
alert('Machine Type is required..!!');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(energyType == ''){
|
||||||
|
alert('Energy Type is required..!!');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#submitBtnId').on('click', function () {
|
||||||
|
|
||||||
|
|
||||||
|
let validation = validate();
|
||||||
|
|
||||||
|
if(!validation){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let machineName = $('#machineName').val().trim();
|
||||||
let machineId = $('#machineId').val()??'';
|
let machineId = $('#machineId').val()??'';
|
||||||
$('#loader').show();
|
$('#loader').show();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -145,6 +187,9 @@ $energyType = $masterData['energy_type'] ?? '';
|
|||||||
alert("Machine Name already existing in the deleted section ..!!");
|
alert("Machine Name already existing in the deleted section ..!!");
|
||||||
$('#machineName').val('');
|
$('#machineName').val('');
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
|
||||||
|
validation === true ? $('#factoryFormId').submit():'' ;
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -158,4 +203,17 @@ $energyType = $masterData['energy_type'] ?? '';
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
$(document).on('keydown', function(event) {
|
||||||
|
if (event.key === 'Enter') {
|
||||||
|
event.preventDefault(); // Prevent default Enter key behavior
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -52,7 +52,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
helper('form');
|
helper('form');
|
||||||
$error = session()->getFlashdata('error');
|
$error = session()->getFlashdata('error');
|
||||||
if ($error) {
|
if ($error) {
|
||||||
$type = "error";
|
$type = "error";
|
||||||
|
|||||||
@ -251,10 +251,11 @@
|
|||||||
$('#tempClick').click(function () {
|
$('#tempClick').click(function () {
|
||||||
//loader is initiated
|
//loader is initiated
|
||||||
$('#loader').show();
|
$('#loader').show();
|
||||||
|
|
||||||
if ($('#transportername').val() === '') {
|
if ($('#transportername').val().trim() === '') {
|
||||||
alert('Please Enter the Transporter Name');
|
alert('Please Enter the Transporter Name');
|
||||||
return;
|
$('#loader').hide();
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var formData = {
|
var formData = {
|
||||||
@ -448,4 +449,15 @@
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
$(document).on('keydown', function(event) {
|
||||||
|
if (event.key === 'Enter') {
|
||||||
|
event.preventDefault(); // Prevent default Enter key behavior
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user