diff --git a/app/Controllers/Login.php b/app/Controllers/Login.php
index 59f63800..2d65ce28 100755
--- a/app/Controllers/Login.php
+++ b/app/Controllers/Login.php
@@ -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 . "
";
- // echo "cURL Error: " . ($curlError ? $curlError : 'None') . "
";
- // 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');
diff --git a/app/Models/Ipinvoice_model.php b/app/Models/Ipinvoice_model.php
index 0cd6c2b0..09ca546c 100755
--- a/app/Models/Ipinvoice_model.php
+++ b/app/Models/Ipinvoice_model.php
@@ -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" ] ;
diff --git a/app/Views/sales_dashboard.php b/app/Views/sales_dashboard.php
index d1cbb260..26988248 100755
--- a/app/Views/sales_dashboard.php
+++ b/app/Views/sales_dashboard.php
@@ -119,55 +119,62 @@
| - - + | S.NO | +Material Code | +Material Description | +Closing Stock |
|---|---|---|---|---|
| + | S.NO | +Stock | +Closing Stock | |
| + | ||||
| + | + | + | + + | |
| - - | +1 | ++ |