Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme
This commit is contained in:
commit
02e0ef9b13
@ -140,9 +140,9 @@ class Login extends BaseController
|
||||
*/
|
||||
public function resetPasswordUser()
|
||||
{
|
||||
$mobileno = $this->request->getPost('phno');
|
||||
|
||||
$emailid = $this->request->getPost('email');
|
||||
$result = $this->login_model->getuserid($mobileno, $emailid);
|
||||
$result = $this->login_model->getuserid($emailid);
|
||||
|
||||
if (!empty($result)) {
|
||||
|
||||
@ -169,13 +169,13 @@ class Login extends BaseController
|
||||
|
||||
$this->login_model->updatepassword($result[0]->userId, $resetpassword);
|
||||
|
||||
session()->setFlashdata('success', 'Password sent successfully. Please check your mobile .');
|
||||
session()->setFlashdata('success', 'Password sent successfully. Please check your E-mail .');
|
||||
|
||||
return redirect()->to('/login');
|
||||
|
||||
|
||||
} else {
|
||||
session()->setFlashdata('error', 'Given Mobile Number or Email is not registered with us.');
|
||||
session()->setFlashdata('error', 'Given Email is not registered with us.');
|
||||
return redirect()->to('login');
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,6 +90,7 @@ class Sales extends BaseController
|
||||
$stock = $this->request->getVar('stock')??"none"; // maybe any thing like bag or resin or power or diesel or gas
|
||||
|
||||
$data['stock'] = $this->ipinvoice_model->getClosingStock($stock);
|
||||
$data['givenStock'] = $stock ?? 'resin';
|
||||
|
||||
|
||||
|
||||
|
||||
@ -672,17 +672,25 @@ class Ipinvoice_model extends Model
|
||||
default:
|
||||
|
||||
|
||||
$result [] = ['header' => 'Gas Final Closing'];
|
||||
$builder = $this->db->table('t_resinStockDetails trd')
|
||||
->select('trd.balanceStock, tmm.MaterialName ,tmm.MaterialCode')
|
||||
->join('t_materialmaster tmm', 'tmm.MaterialCode = trd.materialCode')
|
||||
->where('trd.date', $lastDateOfCurrentMonth)
|
||||
->get()
|
||||
->getResultArray();
|
||||
|
||||
$header =array_column($builder,'MaterialName');
|
||||
|
||||
$materialCode =array_column($builder,'MaterialCode');
|
||||
|
||||
$body =array_column($builder,'balanceStock');
|
||||
|
||||
|
||||
$result [] = ['header' => $header];
|
||||
|
||||
$result [] = ['materialCode' => $materialCode];
|
||||
|
||||
$builder = $this->db
|
||||
->table('t_gasstockdetails')
|
||||
->select('balanceStock')
|
||||
->where('date',$lastDateOfCurrentMonth)
|
||||
->get()
|
||||
->getResultArray();
|
||||
|
||||
$result[] =['body' => $builder[0]['balanceStock']] ;
|
||||
$result [] = ['body' => $body ?? "Not Opened Yet" ] ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -151,12 +151,11 @@ class Login_model extends Model
|
||||
/**
|
||||
* get the user dtl
|
||||
*/
|
||||
function getuserid($mobileno, $emailid)
|
||||
function getuserid($emailid)
|
||||
{
|
||||
$builder = $this->db->table('tbl_users as UsrTbl');
|
||||
$builder->select('UsrTbl.userId,UsrTbl.email,EmpTbl.ContactNumber,EmpTbl.FirstName')
|
||||
->join('t_employee_details as EmpTbl', 'UsrTbl.EmpID = EmpTbl.EmpID')
|
||||
->where('EmpTbl.ContactNumber', $mobileno)
|
||||
->where('UsrTbl.email', $emailid)
|
||||
->where('UsrTbl.isDeleted', 0);
|
||||
$res = $builder->get();
|
||||
|
||||
@ -24,10 +24,6 @@
|
||||
<p class="login-box-msg">Forgot Password</p>
|
||||
<!-- <form action="<?php echo base_url(); ?>resetPasswordConfirmUser" method="post"> // this form action for OTP -->
|
||||
<form action="<?php echo base_url(); ?>resetPasswordUser" method="post">
|
||||
<div class="form-group has-feedback">
|
||||
<input type="text" class="form-control" placeholder="Mobile Number" name ="phno" id= "phno" maxlength="10" onkeypress="return isNumber(event)">
|
||||
<span class="glyphicon glyphicon glyphicon-phone form-control-feedback"></span>
|
||||
</div>
|
||||
<div class="form-group has-feedback">
|
||||
<input type="text" class="form-control" placeholder="Email" name="email" required />
|
||||
<span class="glyphicon glyphicon-envelope form-control-feedback"></span>
|
||||
|
||||
@ -235,7 +235,7 @@ if (!empty($Status)) {
|
||||
var table = $('#requisition_listing').DataTable({
|
||||
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
|
||||
'excel', 'pdf' // Export buttons
|
||||
],
|
||||
pageLength: 10, // Default rows per page
|
||||
lengthMenu: [
|
||||
|
||||
@ -115,16 +115,42 @@
|
||||
<div class="col-xl-12 col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="header-title">Stock Dashboard</h4>
|
||||
<h4 class="header-title">This Month Stock Closing</h4>
|
||||
|
||||
<div align="left">
|
||||
<a class="btn btn-success btn-sm px-2" href="<?php echo base_url(); ?>sales_dashboard?stock=gas">Gas</a>
|
||||
<a class="btn btn-danger btn-sm px-2" href="<?php echo base_url(); ?>sales_dashboard?stock=diesel">Diesel</a>
|
||||
<a class="btn btn-primary btn-sm px-2" href="<?php echo base_url(); ?>sales_dashboard?stock=resin">Resin</a>
|
||||
<a class="btn btn-secondary btn-sm px-2" href="<?php echo base_url(); ?>sales_dashboard?stock=bag">Bag</a>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<a class="btn btn-primary btn-sm px-2" href="<?php echo base_url(); ?>sales_dashboard?stock=resin">Resin</a>
|
||||
<a class="btn btn-secondary btn-sm px-2" href="<?php echo base_url(); ?>sales_dashboard?stock=bag">Bag</a>
|
||||
<a class="btn btn-danger btn-sm px-2" href="<?php echo base_url(); ?>sales_dashboard?stock=diesel">Diesel</a>
|
||||
<a class="btn btn-success btn-sm px-2" href="<?php echo base_url(); ?>sales_dashboard?stock=gas">Gas</a>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button class="btn btn-primary btn-sm px-2" id="xldwnldStockDbd">Excel</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php if(isset($givenStock)){
|
||||
|
||||
switch ($givenStock) {
|
||||
case 'gas':
|
||||
$href = base_url('gasStockDetails');
|
||||
break;
|
||||
case 'diesel':
|
||||
$href = base_url('dieselMachineDetails');
|
||||
break;
|
||||
case 'resin':
|
||||
$href = base_url('resinStockDetails');
|
||||
break;
|
||||
case 'bag':
|
||||
$href = base_url('bagStockDetails');
|
||||
break;
|
||||
default:
|
||||
$href = base_url('resinStockDetails');
|
||||
}
|
||||
}?>
|
||||
|
||||
<table id="stockClosing" class="table dt-responsive nowrap w-100">
|
||||
<thead>
|
||||
|
||||
@ -157,9 +183,12 @@
|
||||
|
||||
<tr>
|
||||
|
||||
<td> <?php echo $index + 1 ?></td>
|
||||
<td> <?php echo $stock[1]['materialCode'][$index] ?> </td>
|
||||
<td> <?php echo $stock[0]['header'][$index] ?></td>
|
||||
<td> <?php echo $index + 1 ?></td>
|
||||
<td> <?php echo $stock[1]['materialCode'][$index] ?> </td>
|
||||
<td> <a href="<?=$href?>">
|
||||
<?php echo $stock[0]['header'][$index] ?>
|
||||
</a>
|
||||
</td>
|
||||
<td> <?php echo $body ?></td>
|
||||
|
||||
</tr>
|
||||
@ -173,8 +202,12 @@
|
||||
|
||||
<tr>
|
||||
<td> 1 </td>
|
||||
<td><?php echo $stock[0]['header'] ?></td>
|
||||
<td><?php echo $stock[1]['body'] ?></td>
|
||||
<td>
|
||||
<a href="<?=$href?>">
|
||||
<?php echo $stock[0]['header'] ?>
|
||||
</a>
|
||||
</td>
|
||||
<td> <?php echo $stock[1]['body'] ?></td>
|
||||
</tr>
|
||||
|
||||
<?php } ?>
|
||||
@ -305,7 +338,7 @@
|
||||
dom: 'Brtip', // Remove length and search inputs
|
||||
lengthChange: false,
|
||||
searching: false,
|
||||
buttons: ['excel'],
|
||||
buttons: [''],
|
||||
responsive: true,
|
||||
order: false,
|
||||
language: {
|
||||
@ -375,4 +408,62 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
function exportTableToExcel(tableID, filename = '') {
|
||||
|
||||
let table = document.getElementById(tableID);
|
||||
|
||||
let cloneTable = table.cloneNode(true); // Clone the table to modify
|
||||
|
||||
// Remove hidden rows
|
||||
$(cloneTable).find('tr').filter(function() {
|
||||
return $(this).css('display') === 'none';
|
||||
}).remove();
|
||||
|
||||
// Remove hidden columns
|
||||
$(cloneTable).find('th, td').each(function() {
|
||||
if ($(this).css('display') === 'none') {
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
let ws = XLSX.utils.table_to_sheet(cloneTable);
|
||||
|
||||
// Set column width to 10 for all columns
|
||||
let colCount = 0;
|
||||
$(cloneTable).find('tr').each(function() {
|
||||
let count = $(this).find('th, td').length;
|
||||
if (count > colCount) colCount = count;
|
||||
});
|
||||
|
||||
let wscols = [];
|
||||
for (let i = 0; i < colCount; i++) {
|
||||
wscols.push({ wch: 10 }); // Set width of 10 for all columns
|
||||
}
|
||||
ws['!cols'] = wscols;
|
||||
|
||||
let wb = XLSX.utils.book_new(); // Create a new workbook
|
||||
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1'); // Append sheet to workbook
|
||||
XLSX.writeFile(wb, filename || 'export.xlsx'); // Save the file
|
||||
}
|
||||
|
||||
let tableId = 'stockClosing';
|
||||
|
||||
document.getElementById('xldwnldStockDbd').addEventListener('click', function() {
|
||||
|
||||
<?php $month = date('d-m-Y'); ?>
|
||||
|
||||
exportTableToExcel(tableId, 'Stock Closing-<?= $month ?>.xlsx');
|
||||
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user