changes in master details-4 vadivel J 20-11-2024
This commit is contained in:
parent
6e9aad3c4e
commit
23f90d518d
@ -405,6 +405,7 @@ $routes->get('transporterListing', 'Supplier::transporterListing');
|
|||||||
$routes->post('fetchTransporterDetails', 'Supplier::fetchTransporterDetails');// for Ajax both add and edit....
|
$routes->post('fetchTransporterDetails', 'Supplier::fetchTransporterDetails');// for Ajax both add and edit....
|
||||||
$routes->get('deleteTransporter', 'Supplier::deleteTransporter');
|
$routes->get('deleteTransporter', 'Supplier::deleteTransporter');
|
||||||
$routes->get('reActivateTransporter', 'Supplier::reActivateTransporter');
|
$routes->get('reActivateTransporter', 'Supplier::reActivateTransporter');
|
||||||
|
$routes->post('checkTransporter', 'Supplier::checkTransporter');
|
||||||
|
|
||||||
//Factory Machine Master Routes
|
//Factory Machine Master Routes
|
||||||
|
|
||||||
|
|||||||
@ -465,6 +465,22 @@ class Supplier extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* check the Transporter exists?
|
||||||
|
*/
|
||||||
|
|
||||||
|
function checkTransporter(){
|
||||||
|
|
||||||
|
$data = $this->request->getPost();
|
||||||
|
$message = $this->supplier_model->checkTransporter($data['transportername']);
|
||||||
|
if(!empty($message)){
|
||||||
|
echo true;
|
||||||
|
}else{
|
||||||
|
echo false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* delete the Transporter
|
* delete the Transporter
|
||||||
*/
|
*/
|
||||||
@ -486,6 +502,9 @@ class Supplier extends BaseController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* reactivate the Transporter
|
||||||
|
*/
|
||||||
function reActivateTransporter($id = NULL)
|
function reActivateTransporter($id = NULL)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@ -53,6 +53,16 @@ class Supplier_model extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function checkTransporter($transporterName){
|
||||||
|
$builder = $this->db->table('t_transporter')
|
||||||
|
->where('name', $transporterName)
|
||||||
|
->where('isactive',1);
|
||||||
|
$query = $builder->get();
|
||||||
|
|
||||||
|
return $query->getResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function deleteTransporter($Sid, $SupplierInfo){
|
function deleteTransporter($Sid, $SupplierInfo){
|
||||||
|
|
||||||
|
|||||||
@ -92,7 +92,8 @@
|
|||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a data-toggle="modal" href="#transporterwizard" data-id="0" data-name="" class="btn btn-success">Add New Transporter</a>
|
<a data-toggle="modal" href="#transporterwizard" data-id="0" data-name=""
|
||||||
|
class="btn btn-success">Add New Transporter</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -104,22 +105,29 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
<form class="Date-filter-form" id="DateRangeFilter"
|
||||||
|
style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||||
<input type="hidden" name="table" value="requisition">
|
<input type="hidden" name="table" value="requisition">
|
||||||
<label for="fromDate">From:</label>
|
<label for="fromDate">From:</label>
|
||||||
<input class="form-control date_range form-date-search" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
<input class="form-control date_range form-date-search" id="fromDate" name="fromDate"
|
||||||
|
placeholder="Select From Date" autocomplete="off" required>
|
||||||
|
|
||||||
<label for="toDate">To:</label>
|
<label for="toDate">To:</label>
|
||||||
<input class="form-control date_range to-date-search" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
<input class="form-control date_range to-date-search" id="toDate" name="toDate"
|
||||||
|
placeholder="Select To Date" autocomplete="off" required>
|
||||||
|
|
||||||
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true"
|
||||||
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
class="icon-button" title="Search"></i></button>
|
||||||
|
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button"
|
||||||
|
id="resetButton" title="Reset"></i>
|
||||||
|
|
||||||
<div style="margin-left:auto">
|
<div style="margin-left:auto">
|
||||||
<div class="form-check" style="margin-right: 25px;">
|
<div class="form-check" style="margin-right: 25px;">
|
||||||
<input class="form-check-input" type="checkbox" id="showArchiveId" name="showArchive"
|
<input class="form-check-input" type="checkbox" id="showArchiveId"
|
||||||
value="1" onchange="showArchiveList()" style="width: 18px; height: 18px;">
|
name="showArchive" value="1" onchange="showArchiveList()"
|
||||||
<label class="form-check-label" for="showArchiveId" style="font-size: 1rem; margin-left: 8px;">
|
style="width: 18px; height: 18px;">
|
||||||
|
<label class="form-check-label" for="showArchiveId"
|
||||||
|
style="font-size: 1rem; margin-left: 8px;">
|
||||||
Show Archive
|
Show Archive
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
@ -147,24 +155,27 @@
|
|||||||
$date = $createdat->format('d-m-Y');
|
$date = $createdat->format('d-m-Y');
|
||||||
$time = $createdat->format('h:i A');
|
$time = $createdat->format('h:i A');
|
||||||
?>
|
?>
|
||||||
<tr
|
<tr class="<?php if ($record->isactive == 0) {
|
||||||
class="<?php if($record->isactive == 0){echo"deactivatedRow";}?>"
|
echo "deactivatedRow";
|
||||||
style="<?php if($record->isactive == 0){echo"display:none";}?>"
|
} ?>" style="<?php if ($record->isactive == 0) {
|
||||||
>
|
echo "display:none";
|
||||||
|
} ?>">
|
||||||
<td><?php echo $date; ?></td>
|
<td><?php echo $date; ?></td>
|
||||||
<td><?php echo $record->name ?></td>
|
<td><?php echo $record->name ?></td>
|
||||||
<td><?php echo $record->FirstName ?></td>
|
<td><?php echo $record->FirstName ?></td>
|
||||||
<td>
|
<td>
|
||||||
<?php if ($record->isactive == 0) { ?>
|
<?php if ($record->isactive == 0) { ?>
|
||||||
<a
|
<a onclick="confirmReActivate(event)" style="cursor:pointer;"
|
||||||
onclick="confirmReActivate(event)"
|
href="<?php echo base_url() . 'reActivateTransporter?id=' . $record->id; ?>"><i
|
||||||
style="cursor:pointer;"
|
class="fa fa-key" style="color:#02a8b5;"></i> </a>
|
||||||
href="<?php echo base_url() . 'reActivateTransporter?id=' . $record->id; ?>"><i class="fa fa-key" style="color:#02a8b5;"></i> </a>
|
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<a data-toggle="modal" href="#transporterwizard" data-id="<?php echo $record->id; ?>" data-name="<?php echo $record->name; ?>"><i class="fa fa-edit"></i> </a>
|
<a data-toggle="modal" href="#transporterwizard"
|
||||||
<a
|
data-id="<?php echo $record->id; ?>"
|
||||||
onclick="confirmDelete(event)"
|
data-name="<?php echo $record->name; ?>"><i
|
||||||
href="<?php echo base_url() . 'deleteTransporter?id=' . $record->id; ?>"><i class="fa fa-trash"></i> </a>
|
class="fa fa-edit"></i> </a>
|
||||||
|
<a onclick="confirmDelete(event)"
|
||||||
|
href="<?php echo base_url() . 'deleteTransporter?id=' . $record->id; ?>"><i
|
||||||
|
class="fa fa-trash"></i> </a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -186,14 +197,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- for Add and edit Modal -->
|
<!-- for Add and edit Modal -->
|
||||||
<div id="transporterwizard" class="modal fade" tabindex="-1" role="dialog"
|
<div id="transporterwizard" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
|
||||||
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
|
aria-hidden="true" style="display: none;">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h4 class="modal-title"></h4>
|
<h4 class="modal-title"></h4>
|
||||||
<button type="button" class="close" data-dismiss="modal"
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
aria-hidden="true">×</button>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body p-4">
|
<div class="modal-body p-4">
|
||||||
<form id="transporterForm" class="form-horizontal" role="form">
|
<form id="transporterForm" class="form-horizontal" role="form">
|
||||||
@ -213,10 +223,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-secondary waves-effect"
|
<button type="button" class="btn btn-secondary waves-effect" data-dismiss="modal"
|
||||||
data-dismiss="modal" value="Cancel">Cancel</button>
|
value="Cancel">Cancel</button>
|
||||||
<button type="button"
|
<button type="button" class="btn btn-info waves-effect waves-light tempClick"
|
||||||
class="btn btn-info waves-effect waves-light tempClick" id="tempClick">Submit</button>
|
id="tempClick">Submit</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -247,6 +257,22 @@
|
|||||||
transportername: $('#transportername').val()
|
transportername: $('#transportername').val()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let checkTransporterExists = function checkTransporterExists() {
|
||||||
|
|
||||||
|
let transportername = $('#transportername').val();
|
||||||
|
$.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
url: "<?php echo base_url(); ?>checkTransporter",
|
||||||
|
data: {
|
||||||
|
transportername
|
||||||
|
},
|
||||||
|
success: function (response) {
|
||||||
|
console.log("response", response);
|
||||||
|
if (response) {
|
||||||
|
alert("Already Transporter with this Name Exists..!!");
|
||||||
|
window.location.href = "transporterListing";
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: "<?php echo base_url(); ?>fetchTransporterDetails",
|
url: "<?php echo base_url(); ?>fetchTransporterDetails",
|
||||||
@ -265,6 +291,20 @@
|
|||||||
alert('An error occurred: ' + error);
|
alert('An error occurred: ' + error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function (xhr, status, error) {
|
||||||
|
alert('An error occurred inside Check transporterExsits: ' + error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
checkTransporterExists();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user