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>
|
||||||
|
|
||||||
@ -435,3 +455,14 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
$(document).on('keydown', function(event) {
|
||||||
|
if (event.key === 'Enter') {
|
||||||
|
event.preventDefault(); // Prevent default Enter key behavior
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
</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,9 +430,13 @@
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#AssetName').on('change',function(){
|
$('#addAssetBtnId').on('click',function(){
|
||||||
|
|
||||||
let assetName = $(this).val().trim();
|
let validation = validate();
|
||||||
|
|
||||||
|
if(validation){
|
||||||
|
|
||||||
|
let assetName = $('#AssetName').val().trim();
|
||||||
let assetId = $('#AssetCode').val() ?? '';
|
let assetId = $('#AssetCode').val() ?? '';
|
||||||
|
|
||||||
$('#loader').show();
|
$('#loader').show();
|
||||||
@ -454,7 +457,12 @@ $.ajax({
|
|||||||
$('#AssetName').val('');
|
$('#AssetName').val('');
|
||||||
$('#AssetName').focus();
|
$('#AssetName').focus();
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
$('#addAsset').submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
error: function(error){
|
error: function(error){
|
||||||
//error
|
//error
|
||||||
@ -466,8 +474,24 @@ $.ajax({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
</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,6 +408,8 @@
|
|||||||
$('#configurationname').val('');
|
$('#configurationname').val('');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
$('#addconfig').submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -439,3 +441,15 @@
|
|||||||
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
$(document).on('keydown', function(event) {
|
||||||
|
if (event.key === 'Enter') {
|
||||||
|
event.preventDefault(); // Prevent default Enter key behavior
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
@ -430,3 +430,14 @@
|
|||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
$(document).on('keydown', function(event) {
|
||||||
|
if (event.key === 'Enter') {
|
||||||
|
event.preventDefault(); // Prevent default Enter key behavior
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
</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();
|
||||||
@ -449,6 +449,10 @@ if (!empty($assetList)) {
|
|||||||
$('#AssetName').val('');
|
$('#AssetName').val('');
|
||||||
$('#AssetName').focus();
|
$('#AssetName').focus();
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
|
||||||
|
$('#editAsset').submit();
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function(error){
|
error: function(error){
|
||||||
@ -466,3 +470,14 @@ if (!empty($assetList)) {
|
|||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
$(document).on('keydown', function(event) {
|
||||||
|
if (event.key === 'Enter') {
|
||||||
|
event.preventDefault(); // Prevent default Enter key behavior
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
</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();
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -557,3 +558,14 @@ if ($total <= $reorder) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
$(document).on('keydown', function(event) {
|
||||||
|
if (event.key === 'Enter') {
|
||||||
|
event.preventDefault(); // Prevent default Enter key behavior
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
@ -77,7 +77,7 @@ 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>
|
||||||
@ -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>
|
||||||
|
|
||||||
@ -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,6 +329,7 @@ if (!empty($master)) {
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
@ -493,7 +493,8 @@ if (!empty($master)) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$('#ConfigName').change(function () {
|
$('#updateConfigBtnId').click(function() {
|
||||||
|
|
||||||
$('#loader').show();
|
$('#loader').show();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
data: {
|
data: {
|
||||||
@ -509,12 +510,16 @@ if (!empty($master)) {
|
|||||||
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -528,11 +533,9 @@ if (!empty($master)) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
$('#AddConfigValue, #configValue').change(function() {
|
$('#AddConfigValue, #configValue').change(function() {
|
||||||
|
|
||||||
let configValue = $(this).val();
|
let configValue = $(this).val();
|
||||||
@ -576,8 +579,6 @@ if (!empty($master)) {
|
|||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
|
||||||
function showChildArchiveList() {
|
function showChildArchiveList() {
|
||||||
let isChecked = $("#showChildArchiveId").prop('checked');
|
let isChecked = $("#showChildArchiveId").prop('checked');
|
||||||
|
|
||||||
@ -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>
|
||||||
|
$(document).on('keydown', function(event) {
|
||||||
|
if (event.key === 'Enter') {
|
||||||
|
event.preventDefault(); // Prevent default Enter key behavior
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</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"
|
||||||
|
|
||||||
|
id="factoryFormId"
|
||||||
class="form-label-left">
|
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():'' ;
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -159,3 +204,16 @@ $energyType = $masterData['energy_type'] ?? '';
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
$(document).on('keydown', function(event) {
|
||||||
|
if (event.key === 'Enter') {
|
||||||
|
event.preventDefault(); // Prevent default Enter key behavior
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
@ -252,9 +252,10 @@
|
|||||||
//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 = {
|
||||||
@ -449,3 +450,14 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
$(document).on('keydown', function(event) {
|
||||||
|
if (event.key === 'Enter') {
|
||||||
|
event.preventDefault(); // Prevent default Enter key behavior
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user