Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme
This commit is contained in:
commit
b21339c99d
@ -266,7 +266,10 @@ $routes->post('inwardgateregister/edituploadfile', 'Inwardgateregister::edituplo
|
||||
// Non IGR / Expense
|
||||
$routes->get('ListIGR', 'Expense::index');
|
||||
$routes->post('addExpense', 'Expense::addExpense');
|
||||
$routes->get('getExpenseDetails', 'Expense::getExpenseDetails');
|
||||
$routes->post('editExpense', 'Expense::editExpense');
|
||||
$routes->post('getExpenseDetails', 'Expense::getExpenseDetails');
|
||||
$routes->get('uploads/(:any)', 'Expense::downloads/$1');
|
||||
$routes->post('deleteFile', 'Expense::deleteFile');
|
||||
|
||||
|
||||
// Application OGR Page
|
||||
|
||||
@ -3,46 +3,44 @@
|
||||
namespace App\Controllers;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
|
||||
use App\Models\Expense_model;
|
||||
use App\Models\Supplier_model;
|
||||
|
||||
|
||||
|
||||
class Expense extends BaseController
|
||||
{
|
||||
protected $expense_model;
|
||||
protected $supplier_model;
|
||||
protected $expense_model;
|
||||
protected $supplier_model;
|
||||
protected $session;
|
||||
|
||||
/**
|
||||
* This is default constructor of the class
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->expense_model = new Expense_model();
|
||||
$this->supplier_model = new Supplier_model();
|
||||
|
||||
$this->session = session();
|
||||
helper('form'); //$this->load->library('form_validation');
|
||||
|
||||
helper('form');
|
||||
$this->isLoggedIn();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data['expense_list'] = $this->expense_model->getAllExpense();
|
||||
$data['supplier_list'] = json_encode($this->supplier_model->supplierlisting());
|
||||
$this->global['pageTitle'] = 'Non IGR / Expense List';
|
||||
// echo "<pre>";
|
||||
// print_r($data);die;
|
||||
$this->loadViews("expense_list", $this->global, $data, NULL);
|
||||
}
|
||||
|
||||
function addExpense()
|
||||
public function addExpense()
|
||||
{
|
||||
$data = array(
|
||||
'transporter_file' => $this->request->getPost('transporterfile'),
|
||||
$file = $this->request->getFile('transporterfile');
|
||||
$fileName = '';
|
||||
if ($file->isValid() && !$file->hasMoved()) {
|
||||
$fileName = $file->getRandomName();
|
||||
$file->move(WRITEPATH . 'uploads', $fileName);
|
||||
}
|
||||
|
||||
$data = [
|
||||
'transporter_file' => $fileName,
|
||||
'supplier_id' => $this->request->getPost('supplierid'),
|
||||
'remarks' => $this->request->getPost('remarks'),
|
||||
'cost' => $this->request->getPost('cost'),
|
||||
@ -50,26 +48,20 @@ class Expense extends BaseController
|
||||
'total' => $this->request->getPost('total'),
|
||||
'status' => $this->request->getPost('status'),
|
||||
'payment_method' => $this->request->getPost('payment_method')
|
||||
);
|
||||
|
||||
];
|
||||
$insert_id = $this->expense_model->insertExpense($data);
|
||||
|
||||
if ($insert_id) {
|
||||
// Return success response or redirect
|
||||
// $this->session->set_flashdata('success', 'Expense added successfully.');
|
||||
// redirect('your_controller/your_method'); // Replace with your redirect path
|
||||
return json_encode('true');
|
||||
} else {
|
||||
// Return error response
|
||||
// $this->session->set_flashdata('error', 'Failed to add expense.');
|
||||
// redirect('your_controller/your_method'); // Replace with your redirect path
|
||||
return json_encode('false');
|
||||
}
|
||||
}
|
||||
|
||||
public function getExpenseDetails() {
|
||||
public function getExpenseDetails()
|
||||
{
|
||||
$id = $this->request->getPost('id');
|
||||
|
||||
|
||||
if ($id) {
|
||||
$expense = $this->expense_model->getExpenseById($id);
|
||||
echo json_encode($expense);
|
||||
@ -78,28 +70,93 @@ class Expense extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
public function updateExpense() {
|
||||
// $id = $this->input->post('id');
|
||||
// $data = [
|
||||
// 'transporterfile' => $this->input->post('transporterfile'),
|
||||
// 'supplierid' => $this->input->post('supplierid'),
|
||||
// 'remarks' => $this->input->post('remarks'),
|
||||
// 'cost' => $this->input->post('cost'),
|
||||
// 'gst' => $this->input->post('gst'),
|
||||
// 'total' => $this->input->post('total'),
|
||||
// 'status' => $this->input->post('status'),
|
||||
// 'payment_method' => $this->input->post('payment_method')
|
||||
// ];
|
||||
public function editExpense()
|
||||
{
|
||||
$id = $this->request->getPost('id');
|
||||
$file = $this->request->getFile('transporterfile');
|
||||
$fileName = '';
|
||||
|
||||
// if ($id) {
|
||||
// $result = $this->Expense_model->updateExpense($id, $data);
|
||||
// if ($result) {
|
||||
// echo json_encode(['success' => 'Expense updated successfully']);
|
||||
// } else {
|
||||
// echo json_encode(['error' => 'Failed to update expense']);
|
||||
// }
|
||||
// } else {
|
||||
// echo json_encode(['error' => 'Invalid ID']);
|
||||
// }
|
||||
if ($file->isValid() && !$file->hasMoved()) {
|
||||
$fileName = $file->getRandomName();
|
||||
$file->move(WRITEPATH . 'uploads', $fileName);
|
||||
} else {
|
||||
$fileName = $this->request->getPost('existing_file'); // Use existing file if no new file is uploaded
|
||||
}
|
||||
|
||||
$data = [
|
||||
'supplier_id' => $this->request->getPost('supplierid'),
|
||||
'remarks' => $this->request->getPost('remarks'),
|
||||
'cost' => $this->request->getPost('cost'),
|
||||
'gst' => $this->request->getPost('gst'),
|
||||
'total' => $this->request->getPost('total'),
|
||||
'status' => $this->request->getPost('status'),
|
||||
'payment_method' => $this->request->getPost('payment_method')
|
||||
];
|
||||
if(!empty($fileName)){
|
||||
$data['transporter_file'] = $fileName;
|
||||
}
|
||||
|
||||
if ($id) {
|
||||
$result = $this->expense_model->updateExpense($id, $data);
|
||||
if ($result) {
|
||||
echo json_encode(['success' => 'Expense updated successfully']);
|
||||
} else {
|
||||
echo json_encode(['error' => 'Failed to update expense']);
|
||||
}
|
||||
} else {
|
||||
echo json_encode(['error' => 'Invalid ID']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function downloads($filename)
|
||||
{
|
||||
$path = WRITEPATH . 'uploads/' . $filename;
|
||||
if (file_exists($path)) {
|
||||
return $this->response->download($path, null);
|
||||
} else {
|
||||
throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound('File not found');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function deleteFile()
|
||||
{
|
||||
$fileName = $this->request->getPost('file_name');
|
||||
$expenseId = $this->request->getPost('expense_id');
|
||||
|
||||
if ($fileName && $expenseId) {
|
||||
// Construct the file path
|
||||
$path = WRITEPATH . 'uploads/' . $fileName;
|
||||
|
||||
// Begin transaction
|
||||
$db = \Config\Database::connect();
|
||||
$db->transBegin();
|
||||
|
||||
try {
|
||||
// Delete the file from the folder
|
||||
if (file_exists($path)) {
|
||||
if (!unlink($path)) {
|
||||
throw new \Exception('Unable to delete file from the folder.');
|
||||
}
|
||||
}
|
||||
|
||||
// Update the database to set transporter_file to null
|
||||
$this->expense_model->deleteFile($expenseId);
|
||||
|
||||
// Commit transaction
|
||||
$db->transCommit();
|
||||
echo json_encode(['success' => true]);
|
||||
} catch (\Exception $e) {
|
||||
// Rollback transaction
|
||||
$db->transRollback();
|
||||
echo json_encode(['success' => false, 'message' => $e->getMessage()]);
|
||||
}
|
||||
} else {
|
||||
echo json_encode(['success' => false, 'message' => 'Invalid parameters.']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ class Expense_model extends Model
|
||||
protected $primaryKey = 'id'; // Primary key
|
||||
|
||||
protected $allowedFields = [
|
||||
'transporterfile', 'supplier_id', 'remarks', 'cost', 'gst', 'total', 'status', 'payment_method'
|
||||
'transporter_file', 'supplier_id', 'remarks', 'cost', 'gst', 'total', 'status', 'payment_method'
|
||||
];
|
||||
|
||||
// Retrieve all active expenses
|
||||
@ -34,5 +34,12 @@ class Expense_model extends Model
|
||||
public function updateExpense($id, $data) {
|
||||
return $this->update($id, $data); // Use primary key
|
||||
}
|
||||
|
||||
|
||||
public function deleteFile($expenseId)
|
||||
{
|
||||
// Update the database to set transporter_file to null
|
||||
return $this->update($expenseId, ['transporter_file' => null]);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@ -69,14 +69,7 @@
|
||||
<div class="error" id="error"></div>
|
||||
</form>
|
||||
<div class="card-body">
|
||||
<table id="view_inward_gate_register" class="table dt-responsive nowrap w-100">
|
||||
<thead>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table class="table table-bordered table-hover" id="asset_list_table" style="background-color:#fff;font-size:12px;">
|
||||
<thead style="background-color: #ddd;">
|
||||
<tr>
|
||||
|
||||
@ -37,6 +37,11 @@
|
||||
.icon-button:hover {
|
||||
color: #0056b3;
|
||||
}
|
||||
.delete_button{
|
||||
border: none;
|
||||
background-color: white;
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
<div class="content-page">
|
||||
<div class="content">
|
||||
@ -74,13 +79,13 @@
|
||||
<thead style="background-color: #ddd;">
|
||||
<tr>
|
||||
<th align="right">Created Date</th>
|
||||
<th align="right">Expense Id</th>
|
||||
<th align="right">Supplier Name</th>
|
||||
<th align="right">Cost</th>
|
||||
<th align="right">GST</th>
|
||||
<th align="right">Total</th>
|
||||
<th align="right">Status</th>
|
||||
<th align="right">payment_method</th>
|
||||
<th align="right">Action</th> <!-- New column for actions -->
|
||||
<th align="right">Payment Method</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -95,17 +100,13 @@
|
||||
$cdate = date('d-m-Y', strtotime($record['created_on']));
|
||||
} ?>
|
||||
<td><?php echo $cdate; ?></td>
|
||||
<td class="edit-button" data-id="<?php echo $record['id']; ?>"><a href="#" data-toggle="modal" data-target="#expenseModal"><?php echo $record['id']; ?></a></td>
|
||||
<td><?php echo $record['SupplierName']; ?></td>
|
||||
<td><?php echo $record['cost']; ?></td>
|
||||
<td><?php echo $record['gst']; ?></td>
|
||||
<td><?php echo $record['total']; ?></td>
|
||||
<td><?php echo $record['status']; ?></td>
|
||||
<td><?php echo $record['payment_method']; ?></td>
|
||||
<td>
|
||||
<button class="btn btn-primary edit-button" data-id="<?php echo $record['id']; ?>" data-toggle="modal" data-target="#expenseModal">
|
||||
Edit
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
@ -134,15 +135,20 @@
|
||||
</div>
|
||||
<div class="modal-body p-4">
|
||||
<form id="expenseForm" class="form-horizontal" role="form">
|
||||
<input type="hidden" name="id" id="id">
|
||||
<div class="form-group row">
|
||||
<div class="col-md-5">
|
||||
<label for="transporterfile" class="col-form-label">Transporter File:</label>
|
||||
<input type="text" name="transporterfile" id="transporterfile" class="form-control">
|
||||
<input type="file" name="transporterfile" id="transporterfile" class="form-control">
|
||||
<input type="hidden" name="transporterfile_name" id="transporterfile_name">
|
||||
<small id="fileHelp" class="form-text text-muted">
|
||||
Current file: <span id="currentFileName"></span>
|
||||
</small>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<label for="supplierid" class="col-form-label">Supplier ID:</label>
|
||||
<label for="supplierid" class="col-form-label">Supplier :</label>
|
||||
<select name="supplierid" id="supplierid" class="form-control">
|
||||
<option value="">Select Supplier</option>
|
||||
</select>
|
||||
@ -175,13 +181,21 @@
|
||||
<div class="form-group row">
|
||||
<div class="col-md-5">
|
||||
<label for="status" class="col-form-label">Status:</label>
|
||||
<input type="text" name="status" id="status" class="form-control">
|
||||
<select name="status" id="status_id" class="form-control" required>
|
||||
<option >Select Status</option>
|
||||
<option value="1">Pending</option>
|
||||
<option value="2">Complete</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<label for="payment_method" class="col-form-label">Payment Method:</label>
|
||||
<input type="text" name="payment_method" id="payment_method" class="form-control">
|
||||
<select name="payment_method" id="payment_method" class="form-control" required>
|
||||
<option >Select Payment Method</option>
|
||||
<option value="1">Cash</option>
|
||||
<option value="2">Online</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@ -195,94 +209,145 @@
|
||||
</div>
|
||||
</div><!-- /.modal -->
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(document).on('click', '.edit-button', function() {
|
||||
var expenseId = $(this).data('id');
|
||||
var formActionUrl = '';
|
||||
|
||||
$.ajax({
|
||||
url: '<?php echo base_url().'getExpenseDetails' ?>', // Your PHP script to get expense details
|
||||
type: 'POST',
|
||||
data: { id: expenseId },
|
||||
success: function(response) {
|
||||
var expense = JSON.parse(response);
|
||||
// Event handler for file input change
|
||||
$('#transporterfile').on('change', function() {
|
||||
var fileName = $(this).val().split('\\').pop(); // Get the file name
|
||||
$('#file-name-display').text(fileName); // Display the file name
|
||||
});
|
||||
|
||||
// Populate the form with existing data
|
||||
$('#transporterfile').val(expense.transporterfile);
|
||||
$('#supplierid').val(expense.supplierid);
|
||||
$('#remarks').val(expense.remarks);
|
||||
$('#cost').val(expense.cost);
|
||||
$('#gst').val(expense.gst);
|
||||
$('#total').val(expense.total);
|
||||
$('#status').val(expense.status);
|
||||
$('#payment_method').val(expense.payment_method);
|
||||
$('#expenseForm').data('id', expenseId); // Store the ID in the form for later use
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
alert('An error occurred: ' + error);
|
||||
}
|
||||
});
|
||||
$(document).on('click', '.edit-button', function() {
|
||||
$('.modal-title').html('Edit Expense');
|
||||
var expenseId = $(this).data('id');
|
||||
var supplier_list = [<?php echo $supplier_list; ?>];
|
||||
$('#supplierid').empty(); // Clear the supplier dropdown
|
||||
$('#supplierid').append('<option >Select Supplier</option>');
|
||||
supplier_list[0].forEach(function(supplier) {
|
||||
$('#supplierid').append('<option value="' + supplier.SupplierID + '">' + supplier.SupplierName + '</option>');
|
||||
});
|
||||
formActionUrl = '<?php echo base_url().'editExpense' ?>'; // Set action URL for adding
|
||||
|
||||
$.ajax({
|
||||
url: '<?php echo base_url().'getExpenseDetails'; ?>',
|
||||
type: 'POST',
|
||||
data: { id: expenseId },
|
||||
success: function(response) {
|
||||
var expense = JSON.parse(response);
|
||||
$('#id').val(expense.id);
|
||||
$('#transporterfile').val(''); // Clear the file input
|
||||
$('#currentFileName').text(''); // Clear the file name display
|
||||
$('#supplierid').val(expense.supplier_id);
|
||||
$('#remarks').val(expense.remarks);
|
||||
$('#cost').val(expense.cost);
|
||||
$('#gst').val(expense.gst);
|
||||
$('#total').val(expense.total);
|
||||
if(expense.status == 1){
|
||||
$('#status_id').val("Pending");
|
||||
}else if(expense.status == 2){
|
||||
$('#status_id').val("Completed");
|
||||
}
|
||||
if(expense.payment_method == 1){
|
||||
$('#payment_method').val("Cash");
|
||||
}else if(expense.payment_method == 2){
|
||||
$('#payment_method').val("Online");
|
||||
}
|
||||
|
||||
// Clear any existing file link and delete button
|
||||
$('#transporterfile').next('.download_button').remove();
|
||||
$('#transporterfile').next('.delete_button').remove();
|
||||
|
||||
if (expense.transporter_file) {
|
||||
$('#transporterfile_name').val(expense.transporter_file); // Set the hidden input value
|
||||
$('#currentFileName').text(expense.transporter_file); // Display the existing file name
|
||||
|
||||
// Construct the full URL to the file
|
||||
var fileUrl = '<?php echo base_url('uploads/'); ?>' + expense.transporter_file;
|
||||
|
||||
// Create download link and delete button
|
||||
var fileLink = '<a class="download_button" href="' + fileUrl + '" target="_blank" download="' + expense.transporter_file + '">Download Current File</a>';
|
||||
var deleteButton = '<button id="deleteFile" class="delete_button" data-value="' + expense.id +'" data-id="' + expense.id + '" data-file="' + expense.transporter_file + '"><i class="fas fa-trash"></i></button>';
|
||||
|
||||
// Add the file link and delete button
|
||||
$('#transporterfile').after(fileLink + ' ' + deleteButton);
|
||||
} else {
|
||||
$('#transporterfile_name').val(''); // Clear hidden input if no file
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
$(document).on('click', '#addExpense', function () {
|
||||
$('.download_button').remove();
|
||||
$('.delete_button').remove();
|
||||
$('.modal-title').html('Add Expense');
|
||||
$('#transporterfile').val(''); // Clear the file input
|
||||
$('#currentFileName').text(''); // Clear the file name display
|
||||
$('#supplierid').val('');
|
||||
$('#remarks').val('');
|
||||
$('#cost').val('');
|
||||
$('#gst').val('');
|
||||
$('#total').val('');
|
||||
$('#status_id').val('');
|
||||
$('#payment_method').val('');
|
||||
var supplier_list = [<?php echo $supplier_list; ?>];
|
||||
$('#supplierid').empty(); // Clear the supplier dropdown
|
||||
$('#supplierid').append('<option >Select Supplier</option>');
|
||||
|
||||
supplier_list[0].forEach(function(supplier) {
|
||||
$('#supplierid').append('<option value="' + supplier.SupplierID + '">' + supplier.SupplierName + '</option>');
|
||||
});
|
||||
$(document).on('click', '#addExpense', function () {
|
||||
console.log("1111111111111111111");
|
||||
|
||||
var supplier_list = [<?php echo $supplier_list; ?>];
|
||||
supplier_list[0].forEach(function(supplier) {
|
||||
// Append each supplier to the dropdown
|
||||
$('#supplierid').append('<option value="' + supplier.SupplierID + '">' + supplier.SupplierName + '</option>');
|
||||
});
|
||||
});
|
||||
$('#tempClick').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
var formData = $('#expenseForm').serialize(); // Serialize form data
|
||||
formActionUrl = '<?php echo base_url().'addExpense' ?>'; // Set action URL for adding
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: '<?php echo base_url().'addExpense' ?>', // Your PHP script to save data
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
success: function(response) {
|
||||
// Handle form submission
|
||||
$('#tempClick').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
var formData = new FormData($('#expenseForm')[0]); // Use FormData to handle file upload
|
||||
console.log(formActionUrl);
|
||||
|
||||
$.ajax({
|
||||
url: formActionUrl, // Use the correct URL based on the button clicked
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
|
||||
if (response) {
|
||||
$('#expenseModal').modal('hide');
|
||||
$('#expenseForm')[0].reset();
|
||||
$('#file-name-display').text(''); // Clear the file name display
|
||||
window.location.reload();
|
||||
} else {
|
||||
console.log(response);
|
||||
|
||||
if (response) {
|
||||
// Close the modal
|
||||
$('#expenseModal').modal('hide');
|
||||
|
||||
// Clear the form
|
||||
$('#expenseForm')[0].reset();
|
||||
|
||||
// Refresh the DataTable
|
||||
window.location.reload();
|
||||
} else {
|
||||
// Handle errors here
|
||||
console.log(response);
|
||||
|
||||
// alert(response.message);
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
// Handle errors here
|
||||
alert('An error occurred: ' + error);
|
||||
}
|
||||
});
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
alert('An error occurred: ' + error);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
// DataTable initialization and date range filter logic (unchanged)
|
||||
var table = $('#expense_list_table').DataTable({
|
||||
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
|
||||
dom: 'Blfrtip',
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
|
||||
'copy', 'csv', 'excel', 'pdf', 'print'
|
||||
],
|
||||
pageLength: 10, // Default rows per page
|
||||
lengthMenu: [ [10, 20, 30, 50, -1], [10, 20, 30, 50, "All"] ], // Rows per page options
|
||||
responsive: true, // Responsive table
|
||||
order: [[0, 'desc']], // Default ordering (column index 0, descending)
|
||||
pageLength: 10,
|
||||
lengthMenu: [ [10, 20, 30, 50, -1], [10, 20, 30, 50, "All"] ],
|
||||
responsive: true,
|
||||
order: [[0, 'desc']],
|
||||
language: {
|
||||
paginate: {
|
||||
next: '<i class="fas fa-angle-right"></i>', // Next button icon
|
||||
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
|
||||
next: '<i class="fas fa-angle-right"></i>',
|
||||
previous: '<i class="fas fa-angle-left"></i>'
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -296,50 +361,77 @@
|
||||
return true; // If no dates selected, don't filter
|
||||
}
|
||||
|
||||
var dateStr = data[0]; // Assuming the date is in the first column
|
||||
var dateStr = data[0];
|
||||
var dateParts = dateStr.split("-");
|
||||
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
|
||||
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]);
|
||||
|
||||
var startDate = new Date(fromDate);
|
||||
var endDate = new Date(toDate);
|
||||
|
||||
// Adjust startDate to include the day before the selected fromDate
|
||||
startDate.setDate(startDate.getDate() - 1);
|
||||
|
||||
// Ensure endDate includes the entire end date by setting time to the end of the day
|
||||
endDate.setHours(23, 59, 59, 999);
|
||||
|
||||
// Return true if the date is within the range
|
||||
return date >= startDate && date <= endDate;
|
||||
}
|
||||
);
|
||||
|
||||
// Handle form submission for the date range filter
|
||||
$("#DateRangeFilter").submit(function(e) {
|
||||
e.preventDefault();
|
||||
table.draw(); // Redraw the table to apply the filter
|
||||
table.draw();
|
||||
});
|
||||
|
||||
// Reset button functionality
|
||||
$("#resetButton").click(function() {
|
||||
$("#fromDate").val('');
|
||||
$("#toDate").val('');
|
||||
table.draw(); // Redraw the table to clear the filter
|
||||
table.draw();
|
||||
});
|
||||
|
||||
// Automatically focus and open the To Date picker when From Date is selected
|
||||
document.getElementById('fromDate').addEventListener('change', function() {
|
||||
var fromDate = this.value;
|
||||
var toDateInput = document.getElementById('toDate');
|
||||
|
||||
// Set the min attribute of the To Date input to the selected From Date
|
||||
toDateInput.min = fromDate;
|
||||
|
||||
// Optionally reset the To Date input if the current value is before the new min date
|
||||
if (toDateInput.value < fromDate) {
|
||||
toDateInput.value = fromDate;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click', '#deleteFile', function() {
|
||||
var fileName = $(this).data('file');
|
||||
var expenseId = $(this).data('value');
|
||||
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('deleteFile'); ?>',
|
||||
type: 'POST',
|
||||
data: { file_name: fileName, expense_id: expenseId },
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
|
||||
var result = JSON.parse(response);
|
||||
if (result.success) {
|
||||
alert('File deleted successfully.');
|
||||
$('#currentFileName').text('');
|
||||
$('#transporterfile_name').val('');
|
||||
$('#deleteFile').remove(); // Remove the delete button
|
||||
$('#transporterfile').next('a').remove(); // Remove the download link
|
||||
} else {
|
||||
alert('Failed to delete the file: ' + result.message);
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
alert('Error deleting the file.');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
document.getElementById('transporterfile').addEventListener('change', function() {
|
||||
var fileName = this.files[0].name;
|
||||
document.getElementById('currentFileName').textContent = fileName;
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -1,110 +1,144 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Resico (India) Pvt Ltd | Admin System Log in</title>
|
||||
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
|
||||
<!-- <link href="<?php echo base_url(); ?>public/assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> -->
|
||||
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
|
||||
<!-- <link href="<?php echo base_url(); ?>public/assets/dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" /> -->
|
||||
<!-- <link href="<?php echo base_url(); ?>public/assets/dist/css/skins/skin-green.min.css" rel="stylesheet" type="text/css" /> -->
|
||||
<!-- web favicon -->
|
||||
<!-- This is needed for IE -->
|
||||
<link rel="icon" href="<?php echo base_url(); ?>public/assets/dist/img/RI_favicon.png"/>
|
||||
<link href="<?php echo base_url(); ?>public/new_assets/css/bootstrap-creative.min.css" rel="stylesheet" type="text/css" id="bs-default-stylesheet" />
|
||||
<link href="<?php echo base_url(); ?>public/new_assets/css/app-creative.min.css" rel="stylesheet" type="text/css" id="app-default-stylesheet" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta content="A fully featured admin theme which can be used to build CRM, CMS, etc." name="description" />
|
||||
<meta content="Coderthemes" name="author" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<!-- App favicon -->
|
||||
<link rel="shortcut icon" href="<?php echo base_url(); ?>public/new_assets/images/RI_favicon.png">
|
||||
|
||||
<link href="<?php echo base_url(); ?>public/new_assets/css/bootstrap-creative-dark.min.css" rel="stylesheet" type="text/css" id="bs-dark-stylesheet" />
|
||||
<link href="<?php echo base_url(); ?>public/new_assets/css/app-creative-dark.min.css" rel="stylesheet" type="text/css" id="app-dark-stylesheet" />
|
||||
<!-- App css -->
|
||||
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet"
|
||||
type="text/css" />
|
||||
<link href="<?php echo base_url(); ?>public/new_assets/css/bootstrap-creative.min.css" rel="stylesheet"
|
||||
type="text/css" id="bs-default-stylesheet" />
|
||||
<link href="<?php echo base_url(); ?>public/new_assets/css/app-creative.min.css" rel="stylesheet" type="text/css"
|
||||
id="app-default-stylesheet" />
|
||||
|
||||
<link href="<?php echo base_url(); ?>public/new_assets/css/bootstrap-creative-dark.min.css" rel="stylesheet"
|
||||
type="text/css" id="bs-dark-stylesheet" />
|
||||
<link href="<?php echo base_url(); ?>public/new_assets/css/app-creative-dark.min.css" rel="stylesheet"
|
||||
type="text/css" id="app-dark-stylesheet" />
|
||||
|
||||
<!-- icons -->
|
||||
<link href="<?php echo base_url(); ?>public/new_assets/css/icons.min.css" rel="stylesheet" type="text/css" />
|
||||
<style>
|
||||
.debug-bar-dinlineBlock {display: none !important;}
|
||||
.a-tag-link {
|
||||
color: #00a65a;
|
||||
transition: color 0.3s ease;
|
||||
}
|
||||
.a-tag-link:hover {
|
||||
color: #ff0000;
|
||||
}
|
||||
</style>
|
||||
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body class="loading">
|
||||
|
||||
<div class="account-pages mt-5 mb-5">
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8 col-lg-6 col-xl-5">
|
||||
<div class="card">
|
||||
</head>
|
||||
|
||||
<div class="card-body p-4">
|
||||
|
||||
<div class="text-center w-75 m-auto">
|
||||
<div class="auth-logo">
|
||||
<a href="index.html" class="logo logo-dark text-center">
|
||||
<span class="logo-lg">
|
||||
<img src="<?php echo base_url('public/new_assets/images/RI_logo.png'); ?> " alt="" height="60">
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<a href="index.html" class="logo logo-light text-center">
|
||||
<span class="logo-lg">cfd
|
||||
<img src="<?php echo base_url(); ?> " alt="" height="22">
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form action="<?php echo base_url(); ?>loginMe" method="post">
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="emailaddress">Email address</label>
|
||||
<input type="email" class="form-control" placeholder="Enter your email" name="email" required="" />
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="password">Password</label>
|
||||
<div class="input-group input-group-merge">
|
||||
<input type="password" class="form-control" placeholder="Enter your password" name="password" id="password" required />
|
||||
<div class="input-group-append" data-password="false">
|
||||
<div class="input-group-text">
|
||||
<span class="password-eye"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group mb-0 text-center">
|
||||
<input type="submit" class="btn btn-primary btn-block" value="Sign In" />
|
||||
<body class="loading auth-fluid-pages pb-0">
|
||||
|
||||
</div>
|
||||
<div class="login-bg">
|
||||
<div class="auth-fluid">
|
||||
<!-- Auth fluid right content -->
|
||||
<div class="auth-fluid-right">
|
||||
<div class="auth-user-testimonial">
|
||||
<h3 class="mb-3 text-white">Welcome to Resico!</h3>
|
||||
<p class="lead font-weight-normal">
|
||||
<i class="mdi mdi-format-quote-open"></i>
|
||||
Resico (India) Pvt Ltd has marked its presence in the domestic market
|
||||
as one of the renowned Manufacturers and Suppliers of washed graded dry Silica sand.
|
||||
Backed by the modern technology, our company has gained the trust of the clients present all across the country.
|
||||
Our washed graded dry Silica sand is extensively used in various industrial applications.
|
||||
<i class="mdi mdi-format-quote-close"></i>
|
||||
</p>
|
||||
|
||||
</div> <!-- end auth-user-testimonial-->
|
||||
</div>
|
||||
<!-- end Auth fluid right content -->
|
||||
|
||||
</form>
|
||||
<!--Auth fluid left content -->
|
||||
<div class="auth-fluid-form-box">
|
||||
<div class="align-items-center d-flex h-100">
|
||||
<div class="card-body">
|
||||
|
||||
</div> <!-- end card-body -->
|
||||
</div>
|
||||
<!-- end card -->
|
||||
</div> <!-- end col -->
|
||||
</div>
|
||||
<!-- end row -->
|
||||
</div>
|
||||
<!-- end container -->
|
||||
</div>
|
||||
<!-- end page -->
|
||||
<!-- Logo -->
|
||||
<div class="auth-brand text-center text-lg-left">
|
||||
<div class="auth-logo">
|
||||
<a href="index.html" class="logo logo-dark text-center">
|
||||
<span class="logo-lg">
|
||||
<img src="<?php echo base_url('public/new_assets/images/RI_logo.png'); ?> " alt=""
|
||||
height="60">
|
||||
</span>
|
||||
</a>
|
||||
<a href="index.html" class="logo logo-dark text-center">
|
||||
<span class="logo-lg">
|
||||
<img src="<?php echo base_url(); ?> " alt="" height="22">
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<footer class="footer footer-alt">
|
||||
<script>document.write(new Date().getFullYear())</script> © Resico <a href="" class="text-dark"></a>
|
||||
</footer>
|
||||
<a href="index.html" class="logo logo-light text-center">
|
||||
<span class="logo-lg">
|
||||
<img src="<?php echo base_url('public/new_assets/images/RI_logo.png'); ?> " alt=""
|
||||
height="60">
|
||||
</span>
|
||||
</a>
|
||||
<a href="index.html" class="logo logo-light text-center">
|
||||
<span class="logo-lg">
|
||||
<img src="<?php echo base_url(); ?> " alt="" height="22">
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Vendor js -->
|
||||
<script src="<?php echo base_url(); ?>public/new_assets/js/vendor.min.js"></script>
|
||||
<!-- title-->
|
||||
<h4 class="mt-0">Sign In</h4>
|
||||
<br>
|
||||
|
||||
<!-- App js -->
|
||||
<script src="<?php echo base_url(); ?>public/new_assets/js/app.min.js"></script>
|
||||
<!-- form -->
|
||||
<form action="<?php echo base_url(); ?>loginMe" method="post">
|
||||
<div class="form-group">
|
||||
<label for="emailaddress">Email address</label>
|
||||
<input type="email" class="form-control" placeholder="Enter your email" name="email"
|
||||
required="" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<a href="auth-recoverpw-2.html" class="text-muted float-right"><small>Forgot your
|
||||
password?</small></a>
|
||||
<label for="password">Password</label>
|
||||
<div class="input-group input-group-merge">
|
||||
<input type="password" class="form-control" placeholder="Enter your password"
|
||||
name="password" id="password" required />
|
||||
<div class="input-group-append" data-password="false">
|
||||
<div class="input-group-text">
|
||||
<span class="password-eye"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group mb-0 text-center">
|
||||
<button class="btn btn-primary btn-block" type="submit">Log In </button>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
<!-- end form-->
|
||||
|
||||
|
||||
|
||||
</div> <!-- end .card-body -->
|
||||
</div> <!-- end .align-items-center.d-flex.h-100-->
|
||||
</div>
|
||||
<!-- end auth-fluid-form-box-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- end auth-fluid-->
|
||||
|
||||
<!-- Vendor js -->
|
||||
<script src="<?php echo base_url(); ?>public/new_assets/js/vendor.min.js"></script>
|
||||
|
||||
<!-- App js -->
|
||||
<script src="<?php echo base_url(); ?>public/new_assets/js/app.min.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
</html>
|
||||
112
app/Views/login_old.php
Normal file
112
app/Views/login_old.php
Normal file
@ -0,0 +1,112 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Resico (India) Pvt Ltd | Admin System Log in</title>
|
||||
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
|
||||
|
||||
<!-- <link href="<?php echo base_url(); ?>public/assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> -->
|
||||
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
|
||||
<!-- <link href="<?php echo base_url(); ?>public/assets/dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" /> -->
|
||||
<!-- <link href="<?php echo base_url(); ?>public/assets/dist/css/skins/skin-green.min.css" rel="stylesheet" type="text/css" /> -->
|
||||
<!-- web favicon -->
|
||||
<!-- This is needed for IE -->
|
||||
<link rel="icon" href="<?php echo base_url(); ?>public/assets/dist/img/RI_favicon.png"/>
|
||||
<link href="<?php echo base_url(); ?>public/new_assets/css/bootstrap-creative.min.css" rel="stylesheet" type="text/css" id="bs-default-stylesheet" />
|
||||
<link href="<?php echo base_url(); ?>public/new_assets/css/app-creative.min.css" rel="stylesheet" type="text/css" id="app-default-stylesheet" />
|
||||
|
||||
<link href="<?php echo base_url(); ?>public/new_assets/css/bootstrap-creative-dark.min.css" rel="stylesheet" type="text/css" id="bs-dark-stylesheet" />
|
||||
<link href="<?php echo base_url(); ?>public/new_assets/css/app-creative-dark.min.css" rel="stylesheet" type="text/css" id="app-dark-stylesheet" />
|
||||
<link href="<?php echo base_url(); ?>public/new_assets/css/icons.min.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
<style>
|
||||
.debug-bar-dinlineBlock {display: none !important;}
|
||||
.a-tag-link {
|
||||
color: #00a65a;
|
||||
transition: color 0.3s ease;
|
||||
}
|
||||
.a-tag-link:hover {
|
||||
color: #ff0000;
|
||||
}
|
||||
</style>
|
||||
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body class="loading">
|
||||
|
||||
<div class="account-pages mt-5 mb-5">
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8 col-lg-6 col-xl-5">
|
||||
<div class="card">
|
||||
|
||||
<div class="card-body p-4">
|
||||
|
||||
<div class="text-center w-75 m-auto">
|
||||
<div class="auth-logo">
|
||||
<a href="index.html" class="logo logo-dark text-center">
|
||||
<span class="logo-lg">
|
||||
<img src="<?php echo base_url('public/new_assets/images/RI_logo.png'); ?> " alt="" height="60">
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<a href="index.html" class="logo logo-light text-center">
|
||||
<span class="logo-lg">
|
||||
<img src="<?php echo base_url(); ?> " alt="" height="22">
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form action="<?php echo base_url(); ?>loginMe" method="post">
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="emailaddress">Email address</label>
|
||||
<input type="email" class="form-control" placeholder="Enter your email" name="email" required="" />
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="password">Password</label>
|
||||
<div class="input-group input-group-merge">
|
||||
<input type="password" class="form-control" placeholder="Enter your password" name="password" id="password" required />
|
||||
<div class="input-group-append" data-password="false">
|
||||
<div class="input-group-text">
|
||||
<span class="password-eye"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group mb-0 text-center">
|
||||
<input type="submit" class="btn btn-primary btn-block" value="Sign In" />
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div> <!-- end card-body -->
|
||||
</div>
|
||||
<!-- end card -->
|
||||
</div> <!-- end col -->
|
||||
</div>
|
||||
<!-- end row -->
|
||||
</div>
|
||||
<!-- end container -->
|
||||
</div>
|
||||
<!-- end page -->
|
||||
|
||||
<footer class="footer footer-alt">
|
||||
<script>document.write(new Date().getFullYear())</script> © Resico <a href="" class="text-dark"></a>
|
||||
</footer>
|
||||
|
||||
<!-- Vendor js -->
|
||||
<script src="<?php echo base_url(); ?>public/new_assets/js/vendor.min.js"></script>
|
||||
|
||||
<!-- App js -->
|
||||
<script src="<?php echo base_url(); ?>public/new_assets/js/app.min.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 302 KiB |
BIN
public/new_assets/images/bg-auth2.jpg
Normal file
BIN
public/new_assets/images/bg-auth2.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
Loading…
Reference in New Issue
Block a user