latest commit 16-05-2025

This commit is contained in:
vadivelJ96 2025-05-16 18:21:25 +05:30
parent 02946be654
commit 9fc6f50a6d
3 changed files with 63 additions and 62 deletions

View File

@ -2,6 +2,7 @@
namespace App\Controllers;
use App\Helpers\Notification;
use App\Models\Login_model;
/**
@ -150,43 +151,29 @@ class Login extends BaseController
$passcode = substr($string_shuffled, 1, 6);
$password = "RESICO@" . $passcode;
$mobile = "91" . $result[0]->ContactNumber;
$msg = "Hi " . $result[0]->FirstName . ",
\n Your password has been reset successfully.
\n Please login with your new password '" . $password . "'";
$message = urlencode($msg);
$ch = curl_init();
$url = "https://smsapi.24x7sms.com/api_2.0/SendSMS.aspx?APIKEY=xegCdYUIMf3"
. "&MobileNo=" . urlencode($mobile)
. "&SenderID=VNBAIT"
. "&Message=" . urlencode($message)
. "&ServiceName=PROMOTIONAL_HIGH";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$notification = new Notification();
$notification->sendEmail([
'recipient_email' => $emailid,
'subject' => 'Password Reset',
'description' => $msg,
'from_mail'=> 'admin@resicoindustries.com'
]);
$output = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$curlError = curl_error($ch);
$resetpassword = password_hash($password, PASSWORD_DEFAULT);
curl_close($ch);
$this->login_model->updatepassword($result[0]->userId, $resetpassword);
// Debug output
// echo "HTTP Code: " . $httpCode . "<br>";
// echo "cURL Error: " . ($curlError ? $curlError : 'None') . "<br>";
// echo "Response: " . htmlentities($output);
session()->setFlashdata('success', 'Password sent successfully. Please check your mobile .');
return redirect()->to('/login');
$resetpassword = password_hash($password, PASSWORD_DEFAULT);
$this->login_model->updatepassword($result[0]->userId, $resetpassword);
session()->setFlashdata('success', 'Password sent successfully. Please check your mobile .');
return redirect()->to('/login');
} else {
session()->setFlashdata('error', 'Given Mobile Number or Email is not registered with us.');
return redirect()->to('login');

View File

@ -616,7 +616,7 @@ class Ipinvoice_model extends Model
$builder = $this->db->table('t_bagstockdetails tbd')
->select('tbd.balanceStock, tmm.MaterialName')
->select('tbd.balanceStock, tmm.MaterialName ,tmm.MaterialCode')
->join('t_materialmaster tmm', 'tmm.MaterialCode = tbd.materialCode')
->where('tbd.date', $lastDateOfCurrentMonth)
->get()
@ -624,12 +624,16 @@ class Ipinvoice_model extends Model
$header =array_column($builder,'MaterialName');
$materialCode =array_column($builder,'MaterialCode');
$body =array_column($builder,'balanceStock');
$result [] = ['header' => $header];
$result [] = ['materialCode' => $materialCode];
$result[] = ['body' => $body ?? "Not Opened Yet" ] ;
$result [] = ['body' => $body ?? "Not Opened Yet" ] ;
break;
@ -639,7 +643,7 @@ class Ipinvoice_model extends Model
case "resin":
$builder = $this->db->table('t_resinStockDetails trd')
->select('trd.balanceStock, tmm.MaterialName')
->select('trd.balanceStock, tmm.MaterialName ,tmm.MaterialCode')
->join('t_materialmaster tmm', 'tmm.MaterialCode = trd.materialCode')
->where('trd.date', $lastDateOfCurrentMonth)
->get()
@ -647,12 +651,16 @@ class Ipinvoice_model extends Model
$header =array_column($builder,'MaterialName');
$materialCode =array_column($builder,'MaterialCode');
$body =array_column($builder,'balanceStock');
$result [] = ['header' => $header];
$result [] = ['materialCode' => $materialCode];
$result[] = ['body' => $body ?? "Not Opened Yet" ] ;
$result [] = ['body' => $body ?? "Not Opened Yet" ] ;

View File

@ -119,55 +119,62 @@
<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-primary btn-sm px-2" href="<?php echo base_url(); ?>sales_dashboard?stock=diesel">Diesel</a>
<a class="btn btn-danger btn-sm px-2" href="<?php echo base_url(); ?>sales_dashboard?stock=power">Power</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>
<table id="stockClosing" class="table dt-responsive nowrap w-100">
<thead>
<?php if (is_array($stock[0]['header'])) { ?>
<tr>
<?php foreach ($stock[0]['header'] as $header) { ?>
<th><?php echo $header ?></th>
<?php } ?>
<th>S.NO</th>
<th>Material Code</th>
<th>Material Description</th>
<th>Closing Stock</th>
</tr>
<?php } else { ?>
<tr>
<th><?php echo $stock[0]['header'] ?></th>
<th>S.NO</th>
<th>Stock</th>
<th>Closing Stock</th>
</tr>
<?php } ?>
</thead>
<tbody>
<?php if (is_array($stock[1]['body'])) { ?>
<tr>
<?php if (is_array($stock[0]['header'])) { ?>
<?php foreach ($stock[1]['body'] as $body) { ?>
<?php foreach ($stock[2]['body'] as $index => $body) { ?>
<th><?php echo $body ?></th>
<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 $body ?></td>
</tr>
<?php } ?>
</tr>
<?php } else { ?>
<tr>
<td>
<?php echo $stock[1]['body'] ?>
</td>
<td> 1 </td>
<td><?php echo $stock[0]['header'] ?></td>
<td><?php echo $stock[1]['body'] ?></td>
</tr>
<?php } ?>
@ -294,31 +301,30 @@
<script>
$(document).ready(function() {
$('#stockClosing').DataTable({
dom: 'Blfrtip',
buttons: [
'excel'
],
pageLength: 10,
lengthMenu: [
[10, 20, 30, 50, -1],
[10, 20, 30, 50, "All"]
],
responsive: false,
var table = $('#stockClosing').DataTable({
dom: 'Brtip', // Remove length and search inputs
lengthChange: false,
searching: false,
buttons: ['excel'],
responsive: true,
order: false,
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>'
}
}
});
// Move Excel button to custom div
// table.buttons().container().appendTo('#exportExcelBtn');
});
</script>
<script>
const currentYearSales = <?php echo json_encode($currentYearSales); ?>;
const lastYearSales = <?php echo json_encode($lastYearSales); ?>;