added sender ID export, edit payment bug fix, profile page bug fix

This commit is contained in:
Kwesi Banson
2026-10-29 12:23:00 +00:00
parent 8428d94abd
commit 965892ac62
15 changed files with 792 additions and 139 deletions

View File

@@ -0,0 +1,66 @@
<?php
namespace App\Exports;
use App\Models\SenderId;
use Illuminate\Http\Request;
use Maatwebsite\Excel\Concerns\FromQuery;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;
class SenderIdsExport implements FromQuery, WithHeadings, WithMapping
{
use Exportable;
protected $request;
public function __construct(Request $request)
{
$this->request = $request;
}
public function query()
{
$query = SenderId::query();
// Apply the same filters used on the index page
if ($this->request->filled('search')) {
$search = $this->request->input('search');
$query->where('senderid', 'like', "%{$search}%")
->orWhere('mno_name', 'like', "%{$search}%")
->orWhere('supplier_name', 'like', "%{$search}%");
}
if ($this->request->filled('direct_mno')) {
$query->where('direct_mno', $this->request->input('direct_mno'));
}
if ($this->request->filled('status')) {
$query->where('status', $this->request->input('status'));
}
return $query->orderBy('created_at', 'desc');
}
public function headings(): array
{
return [
'Sender ID', 'Direct MNO', 'MNO Name', 'Supplier Name',
'Type', 'Bind Name', 'Status', 'Remarks', 'Created At'
];
}
public function map($sender): array
{
return [
$sender->senderid,
$sender->direct_mno,
$sender->mno_name ?? 'N/A',
$sender->supplier_name ?? 'N/A',
$sender->type,
$sender->bind_name,
strtoupper($sender->status),
$sender->remarks,
$sender->created_at ? $sender->created_at->format('Y-m-d H:i') : '',
];
}
}

View File

@@ -110,7 +110,7 @@ class ClientsController extends Controller
$voice_codes = Models\ClientShortCode::where('client_id', $id)->where('code_type', 'voice')->get() ?? collect(); $voice_codes = Models\ClientShortCode::where('client_id', $id)->where('code_type', 'voice')->get() ?? collect();
$sms_codes = Models\ClientShortCode::where('client_id', $id)->where('code_type', 'sms')->get() ?? collect(); $sms_codes = Models\ClientShortCode::where('client_id', $id)->where('code_type', 'sms')->get() ?? collect();
$ussd_codes = Models\ClientShortCode::where('client_id', $id)->where('code_type', 'ussd')->get() ?? collect(); $ussd_codes = Models\ClientShortCode::where('client_id', $id)->where('code_type', 'ussd')->get() ?? collect();
$recent_payments = Models\ClientPayment::where('client_id', $id)->latest('id')->get() ?? collect(); $recent_payments = Models\ClientPayment::where('client_id', $id)->latest('updated_at')->get() ?? collect();
$showdocuments = Models\ClientFile::where('client_id', $id)->get() ?? collect(); $showdocuments = Models\ClientFile::where('client_id', $id)->get() ?? collect();
// Also ensure client attributes are safe arrays // Also ensure client attributes are safe arrays
@@ -667,7 +667,7 @@ class ClientsController extends Controller
'invoice_date' => 'required', 'invoice_date' => 'required',
'invoice_status' => 'required' 'invoice_status' => 'required'
]); ]);
dd($request->all());
$auth_user = Auth::user(); $auth_user = Auth::user();
$payment = Models\ClientPayment::findOrFail($request->payment_id); $payment = Models\ClientPayment::findOrFail($request->payment_id);
@@ -883,7 +883,7 @@ class ClientsController extends Controller
} }
public function update_payment(Request $request, $id) public function update_payment(Request $request, $id)
{ {
// Validate the inputs based on the fields in your edit modal
$validated = $request->validate([ $validated = $request->validate([
'invoice_number' => 'required|string', 'invoice_number' => 'required|string',
'invoice_amount' => 'required|numeric', 'invoice_amount' => 'required|numeric',

View File

@@ -12,7 +12,6 @@ class ProfileController extends Controller
public function index() public function index()
{ {
$staff = StaffMember::with('dependents')->where('email', auth()->user()->email)->firstOrFail(); $staff = StaffMember::with('dependents')->where('email', auth()->user()->email)->firstOrFail();
return view('profile.index', compact('staff')); return view('profile.index', compact('staff'));
} }

View File

@@ -4,11 +4,15 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use App\Models; use App\Models;
use App\Exports\SenderIdsExport;
use Barryvdh\DomPDF\Facade\Pdf;
use Maatwebsite\Excel\Facades\Excel;
class SenderidsController extends Controller class SenderidsController extends Controller
{ {
public function index(Request $request) public function index(Request $request)
{ {
// Fetch KPI Metrics (Keep your existing counts) // Fetch KPI Metrics (Keep your existing counts)
@@ -68,6 +72,34 @@ class SenderidsController extends Controller
return view('senderids.index', $data); return view('senderids.index', $data);
} }
public function exportExcel(Request $request)
{
return Excel::download(new SenderIdsExport($request), 'Sender_IDs_Export_' . date('Ymd_Hi') . '.xlsx');
}
public function exportPdf(Request $request)
{
$query = \App\Models\SenderId::query();
if ($request->filled('search')) {
$search = $request->input('search');
$query->where('senderid', 'like', "%{$search}%")
->orWhere('mno_name', 'like', "%{$search}%")
->orWhere('supplier_name', 'like', "%{$search}%");
}
if ($request->filled('direct_mno')) {
$query->where('direct_mno', $request->input('direct_mno'));
}
if ($request->filled('status')) {
$query->where('status', $request->input('status'));
}
$senderIds = $query->orderBy('created_at', 'desc')->get();
$pdf = Pdf::loadView('senderids.pdf', compact('senderIds'))->setPaper('a4', 'landscape');
return $pdf->download('Sender_IDs_Export_' . date('Ymd_Hi') . '.pdf');
}
public function store(Request $request) public function store(Request $request)
{ {
$validated = $request->validate([ $validated = $request->validate([

View File

@@ -1,11 +0,0 @@
<?php
namespace App\models;
use Illuminate\Database\Eloquent\Model;
class IncomingEmail extends Model
{
protected $guarded = array('id');
public $table = "incoming_emails";
}

View File

@@ -1,109 +0,0 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\Storage;
class VpnClient extends Model
{
protected $table = 'vpn_clients';
protected $fillable = [
'name',
'username',
'type',
'server_id',
'auth_type',
'password',
'allowed_ips',
'routes',
'push_dns',
'compress',
'notes',
'active',
'config_path', // optional stored config file path
];
protected $casts = [
'push_dns' => 'boolean',
'compress' => 'boolean',
'active' => 'boolean',
];
// Relationships
public function server()
{
return $this->belongsTo(Server::class);
}
// Scopes
public function scopeActive($q)
{
return $q->where('active', 1);
}
public function scopeOfType($q, $type)
{
return $q->where('type', $type);
}
// Generate a basic OpenVPN config (example). Adapt to your templates and security needs.
public function generateConfig()
{
// If a pre-generated config is stored, return it
if ($this->config_path && Storage::exists($this->config_path)) {
return Storage::get($this->config_path);
}
// Example template — replace with your real generation logic
$server = $this->server ? $this->server->address : 'vpn.example.com';
$proto = 'udp';
$port = 1194;
$conf = [];
$conf[] = "client";
$conf[] = "dev tun";
$conf[] = "proto {$proto}";
$conf[] = "remote {$server} {$port}";
$conf[] = "resolv-retry infinite";
$conf[] = "nobind";
if ($this->compress) {
$conf[] = "comp-lzo";
}
if ($this->push_dns) {
$conf[] = "dhcp-option DNS 10.8.0.1";
}
if ($this->allowed_ips) {
// allowed_ips are usually server-side; include as comment for operator
$conf[] = "# Allowed IPs: " . $this->allowed_ips;
}
// insert certs/keys placeholders — do NOT store private keys in cleartext unless secure
if ($this->auth_type === 'cert') {
$conf[] = "<ca>\n# CA cert here\n</ca>";
$conf[] = "<cert>\n# Client cert here\n</cert>";
$conf[] = "<key>\n# Client key hidden\n</key>";
} else {
// username/password auth
$conf[] = "auth-user-pass";
}
return implode("\n", $conf) . "\n";
}
/**
* Store generated config to disk (optional).
* Returns storage path.
*/
public function storeGeneratedConfig()
{
$config = $this->generateConfig();
$filename = 'vpn/configs/' . Str::slug($this->name) . '-' . $this->id . '.ovpn';
Storage::put($filename, $config);
$this->config_path = $filename;
$this->save();
return $filename;
}
}

View File

@@ -11,6 +11,7 @@
"laravel/framework": "^11.31", "laravel/framework": "^11.31",
"laravel/tinker": "^2.9", "laravel/tinker": "^2.9",
"laravel/ui": "^4.6", "laravel/ui": "^4.6",
"maatwebsite/excel": "^3.1",
"symfony/filesystem": "^7.4" "symfony/filesystem": "^7.4"
}, },
"require-dev": { "require-dev": {

590
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "4090af069360d112f49872b58f33e0a6", "content-hash": "ae90b5e8ce98547aeb568521a2e66d20",
"packages": [ "packages": [
{ {
"name": "barryvdh/laravel-dompdf", "name": "barryvdh/laravel-dompdf",
@@ -212,6 +212,159 @@
], ],
"time": "2024-02-09T16:56:22+00:00" "time": "2024-02-09T16:56:22+00:00"
}, },
{
"name": "composer/pcre",
"version": "3.4.0",
"source": {
"type": "git",
"url": "https://github.com/composer/pcre.git",
"reference": "d5a341b3fb61f3001970940afb1d332968a183ed"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/pcre/zipball/d5a341b3fb61f3001970940afb1d332968a183ed",
"reference": "d5a341b3fb61f3001970940afb1d332968a183ed",
"shasum": ""
},
"require": {
"php": "^7.4 || ^8.0"
},
"conflict": {
"phpstan/phpstan": "<2.2.2"
},
"require-dev": {
"phpstan/phpstan": "^2",
"phpstan/phpstan-deprecation-rules": "^2",
"phpstan/phpstan-strict-rules": "^2",
"phpunit/phpunit": "^9"
},
"type": "library",
"extra": {
"phpstan": {
"includes": [
"extension.neon"
]
},
"branch-alias": {
"dev-main": "3.x-dev"
}
},
"autoload": {
"psr-4": {
"Composer\\Pcre\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jordi Boggiano",
"email": "j.boggiano@seld.be",
"homepage": "http://seld.be"
}
],
"description": "PCRE wrapping library that offers type-safe preg_* replacements.",
"keywords": [
"PCRE",
"preg",
"regex",
"regular expression"
],
"support": {
"issues": "https://github.com/composer/pcre/issues",
"source": "https://github.com/composer/pcre/tree/3.4.0"
},
"funding": [
{
"url": "https://packagist.com",
"type": "custom"
},
{
"url": "https://github.com/composer",
"type": "github"
}
],
"time": "2026-06-07T11:47:49+00:00"
},
{
"name": "composer/semver",
"version": "3.5.2",
"source": {
"type": "git",
"url": "https://github.com/composer/semver.git",
"reference": "9dfce66f1e97360ea5e6d3e38ab14277e4cc591e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/semver/zipball/9dfce66f1e97360ea5e6d3e38ab14277e4cc591e",
"reference": "9dfce66f1e97360ea5e6d3e38ab14277e4cc591e",
"shasum": ""
},
"require": {
"php": "^5.3.2 || ^7.0 || ^8.0"
},
"require-dev": {
"phpstan/phpstan": "^1.11",
"symfony/phpunit-bridge": "^3 || ^7"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "3.x-dev"
}
},
"autoload": {
"psr-4": {
"Composer\\Semver\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nils Adermann",
"email": "naderman@naderman.de",
"homepage": "http://www.naderman.de"
},
{
"name": "Jordi Boggiano",
"email": "j.boggiano@seld.be",
"homepage": "http://seld.be"
},
{
"name": "Rob Bast",
"email": "rob.bast@gmail.com",
"homepage": "http://robbast.nl"
}
],
"description": "Version comparison library that offers utilities, version constraint parsing and validation.",
"keywords": [
"semantic",
"semver",
"validation",
"versioning"
],
"support": {
"irc": "ircs://irc.libera.chat:6697/composer",
"issues": "https://github.com/composer/semver/issues",
"source": "https://github.com/composer/semver/tree/3.5.2"
},
"funding": [
{
"url": "https://packagist.com",
"type": "custom"
},
{
"url": "https://github.com/composer",
"type": "github"
}
],
"time": "2026-10-22T15:37:26+00:00"
},
{ {
"name": "dflydev/dot-access-data", "name": "dflydev/dot-access-data",
"version": "v3.0.3", "version": "v3.0.3",
@@ -740,6 +893,67 @@
], ],
"time": "2025-03-06T22:45:56+00:00" "time": "2025-03-06T22:45:56+00:00"
}, },
{
"name": "ezyang/htmlpurifier",
"version": "v4.19.1",
"source": {
"type": "git",
"url": "https://github.com/ezyang/htmlpurifier.git",
"reference": "5e0539132d934f936fbae2c88b55d58f9438623f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/5e0539132d934f936fbae2c88b55d58f9438623f",
"reference": "5e0539132d934f936fbae2c88b55d58f9438623f",
"shasum": ""
},
"require": {
"php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0"
},
"require-dev": {
"cerdic/css-tidy": "^1.7 || ^2.0",
"simpletest/simpletest": "dev-master"
},
"suggest": {
"cerdic/css-tidy": "If you want to use the filter 'Filter.ExtractStyleBlocks'.",
"ext-bcmath": "Used for unit conversion and imagecrash protection",
"ext-iconv": "Converts text to and from non-UTF-8 encodings",
"ext-tidy": "Used for pretty-printing HTML"
},
"type": "library",
"autoload": {
"files": [
"library/HTMLPurifier.composer.php"
],
"psr-0": {
"HTMLPurifier": "library/"
},
"exclude-from-classmap": [
"/library/HTMLPurifier/Language/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1-or-later"
],
"authors": [
{
"name": "Edward Z. Yang",
"email": "admin@htmlpurifier.org",
"homepage": "http://ezyang.com"
}
],
"description": "Standards compliant HTML filter written in PHP",
"homepage": "http://htmlpurifier.org/",
"keywords": [
"html"
],
"support": {
"issues": "https://github.com/ezyang/htmlpurifier/issues",
"source": "https://github.com/ezyang/htmlpurifier/tree/v4.19.1"
},
"time": "2026-09-15T15:42:51+00:00"
},
{ {
"name": "fruitcake/php-cors", "name": "fruitcake/php-cors",
"version": "v1.4.0", "version": "v1.4.0",
@@ -2307,6 +2521,272 @@
], ],
"time": "2026-01-15T06:54:53+00:00" "time": "2026-01-15T06:54:53+00:00"
}, },
{
"name": "maatwebsite/excel",
"version": "3.1.70",
"source": {
"type": "git",
"url": "https://github.com/SpartnerNL/Laravel-Excel.git",
"reference": "b5cafdfcf7ec63924e83303763be8fcae340f70b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/SpartnerNL/Laravel-Excel/zipball/b5cafdfcf7ec63924e83303763be8fcae340f70b",
"reference": "b5cafdfcf7ec63924e83303763be8fcae340f70b",
"shasum": ""
},
"require": {
"composer/semver": "^3.3",
"ext-json": "*",
"illuminate/support": "5.8.*||^6.0||^7.0||^8.0||^9.0||^10.0||^11.0||^12.0||^13.0",
"php": "^7.0||^8.0",
"phpoffice/phpspreadsheet": "^1.30.5",
"psr/simple-cache": "^1.0||^2.0||^3.0"
},
"require-dev": {
"laravel/scout": "^7.0||^8.0||^9.0||^10.0||^11.0",
"orchestra/testbench": "^6.0||^7.0||^8.0||^9.0||^10.0||^11.0",
"predis/predis": "^1.1"
},
"type": "library",
"extra": {
"laravel": {
"aliases": {
"Excel": "Maatwebsite\\Excel\\Facades\\Excel"
},
"providers": [
"Maatwebsite\\Excel\\ExcelServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Maatwebsite\\Excel\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Patrick Brouwers",
"email": "patrick@spartner.nl"
}
],
"description": "Supercharged Excel exports and imports in Laravel",
"keywords": [
"PHPExcel",
"batch",
"csv",
"excel",
"export",
"import",
"laravel",
"php",
"phpspreadsheet"
],
"support": {
"issues": "https://github.com/SpartnerNL/Laravel-Excel/issues",
"source": "https://github.com/SpartnerNL/Laravel-Excel/tree/3.1.70"
},
"funding": [
{
"url": "https://laravel-excel.com/commercial-support",
"type": "custom"
},
{
"url": "https://github.com/patrickbrouwers",
"type": "github"
}
],
"time": "2026-08-13T09:11:54+00:00"
},
{
"name": "maennchen/zipstream-php",
"version": "3.2.2",
"source": {
"type": "git",
"url": "https://github.com/maennchen/ZipStream-PHP.git",
"reference": "77bebeb4c6c340bb3c11c843b2cffd8bbfde4d5e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/77bebeb4c6c340bb3c11c843b2cffd8bbfde4d5e",
"reference": "77bebeb4c6c340bb3c11c843b2cffd8bbfde4d5e",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"ext-zlib": "*",
"php-64bit": "^8.3"
},
"require-dev": {
"brianium/paratest": "^7.7",
"ext-zip": "*",
"friendsofphp/php-cs-fixer": "^3.86",
"guzzlehttp/guzzle": "^7.5",
"mikey179/vfsstream": "^1.6",
"php-coveralls/php-coveralls": "^2.5",
"phpunit/phpunit": "^12.0",
"vimeo/psalm": "^6.0"
},
"suggest": {
"guzzlehttp/psr7": "^2.4",
"psr/http-message": "^2.0"
},
"type": "library",
"autoload": {
"psr-4": {
"ZipStream\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Paul Duncan",
"email": "pabs@pablotron.org"
},
{
"name": "Jonatan Männchen",
"email": "jonatan@maennchen.ch"
},
{
"name": "Jesse Donat",
"email": "donatj@gmail.com"
},
{
"name": "András Kolesár",
"email": "kolesar@kolesar.hu"
}
],
"description": "ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.",
"keywords": [
"stream",
"zip"
],
"support": {
"issues": "https://github.com/maennchen/ZipStream-PHP/issues",
"source": "https://github.com/maennchen/ZipStream-PHP/tree/3.2.2"
},
"funding": [
{
"url": "https://github.com/maennchen",
"type": "github"
}
],
"time": "2026-04-11T18:38:28+00:00"
},
{
"name": "markbaker/complex",
"version": "3.0.2",
"source": {
"type": "git",
"url": "https://github.com/MarkBaker/PHPComplex.git",
"reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/95c56caa1cf5c766ad6d65b6344b807c1e8405b9",
"reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "dev-master",
"phpcompatibility/php-compatibility": "^9.3",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
"squizlabs/php_codesniffer": "^3.7"
},
"type": "library",
"autoload": {
"psr-4": {
"Complex\\": "classes/src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mark Baker",
"email": "mark@lange.demon.co.uk"
}
],
"description": "PHP Class for working with complex numbers",
"homepage": "https://github.com/MarkBaker/PHPComplex",
"keywords": [
"complex",
"mathematics"
],
"support": {
"issues": "https://github.com/MarkBaker/PHPComplex/issues",
"source": "https://github.com/MarkBaker/PHPComplex/tree/3.0.2"
},
"time": "2022-12-06T16:21:08+00:00"
},
{
"name": "markbaker/matrix",
"version": "3.0.1",
"source": {
"type": "git",
"url": "https://github.com/MarkBaker/PHPMatrix.git",
"reference": "728434227fe21be27ff6d86621a1b13107a2562c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/728434227fe21be27ff6d86621a1b13107a2562c",
"reference": "728434227fe21be27ff6d86621a1b13107a2562c",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "dev-master",
"phpcompatibility/php-compatibility": "^9.3",
"phpdocumentor/phpdocumentor": "2.*",
"phploc/phploc": "^4.0",
"phpmd/phpmd": "2.*",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
"sebastian/phpcpd": "^4.0",
"squizlabs/php_codesniffer": "^3.7"
},
"type": "library",
"autoload": {
"psr-4": {
"Matrix\\": "classes/src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mark Baker",
"email": "mark@demon-angel.eu"
}
],
"description": "PHP Class for working with matrices",
"homepage": "https://github.com/MarkBaker/PHPMatrix",
"keywords": [
"mathematics",
"matrix",
"vector"
],
"support": {
"issues": "https://github.com/MarkBaker/PHPMatrix/issues",
"source": "https://github.com/MarkBaker/PHPMatrix/tree/3.0.1"
},
"time": "2022-12-02T22:17:43+00:00"
},
{ {
"name": "masterminds/html5", "name": "masterminds/html5",
"version": "2.10.1", "version": "2.10.1",
@@ -2881,6 +3361,114 @@
], ],
"time": "2025-11-20T02:34:59+00:00" "time": "2025-11-20T02:34:59+00:00"
}, },
{
"name": "phpoffice/phpspreadsheet",
"version": "1.30.7",
"source": {
"type": "git",
"url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
"reference": "f5dd9c1f084d336ea63cf53099533e061a9c157a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/f5dd9c1f084d336ea63cf53099533e061a9c157a",
"reference": "f5dd9c1f084d336ea63cf53099533e061a9c157a",
"shasum": ""
},
"require": {
"composer/pcre": "^1||^2||^3",
"ext-ctype": "*",
"ext-dom": "*",
"ext-fileinfo": "*",
"ext-gd": "*",
"ext-iconv": "*",
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-simplexml": "*",
"ext-xml": "*",
"ext-xmlreader": "*",
"ext-xmlwriter": "*",
"ext-zip": "*",
"ext-zlib": "*",
"ezyang/htmlpurifier": "^4.15",
"maennchen/zipstream-php": "^2.1 || ^3.0",
"markbaker/complex": "^3.0",
"markbaker/matrix": "^3.0",
"php": ">=7.4.0 <8.5.0",
"psr/simple-cache": "^1.0 || ^2.0 || ^3.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "dev-main",
"doctrine/instantiator": "^1.5",
"dompdf/dompdf": "^1.0 || ^2.0 || ^3.0",
"friendsofphp/php-cs-fixer": "^3.2",
"mitoteam/jpgraph": "^10.3",
"mpdf/mpdf": "^8.1.1",
"phpcompatibility/php-compatibility": "^9.3",
"phpstan/phpstan": "^1.1",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^8.5 || ^9.0",
"squizlabs/php_codesniffer": "^3.7",
"tecnickcom/tcpdf": "^6.5"
},
"suggest": {
"dompdf/dompdf": "Option for rendering PDF with PDF Writer",
"ext-intl": "PHP Internationalization Functions",
"mitoteam/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers",
"mpdf/mpdf": "Option for rendering PDF with PDF Writer",
"tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer"
},
"type": "library",
"autoload": {
"psr-4": {
"PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Maarten Balliauw",
"homepage": "https://blog.maartenballiauw.be"
},
{
"name": "Mark Baker",
"homepage": "https://markbakeruk.net"
},
{
"name": "Franck Lefevre",
"homepage": "https://rootslabs.net"
},
{
"name": "Erik Tilt"
},
{
"name": "Adrien Crivelli"
},
{
"name": "Owen Leibman"
}
],
"description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
"homepage": "https://github.com/PHPOffice/PhpSpreadsheet",
"keywords": [
"OpenXML",
"excel",
"gnumeric",
"ods",
"php",
"spreadsheet",
"xls",
"xlsx"
],
"support": {
"issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues",
"source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.30.7"
},
"time": "2026-09-17T03:56:23+00:00"
},
{ {
"name": "phpoption/phpoption", "name": "phpoption/phpoption",
"version": "1.9.5", "version": "1.9.5",

View File

@@ -455,15 +455,17 @@ document.addEventListener("DOMContentLoaded", function() {
// Populate Payment Edit Modal // Populate Payment Edit Modal
$(document).on('click', '.edit-payment-btn', function() { $(document).on('click', '.edit-payment-btn', function() {
console.log('heeere');
let id = $(this).data('id'); let id = $(this).data('id');
console.log($(this).data);
$('#edit_payment_id').val(id); $('#edit_payment_id').val(id);
$('#edit_pay_invoice').val($(this).data('invoice')); $('#edit_pay_invoice').val($(this).data('invoice'));
$('#edit_pay_amount').val($(this).data('amount')); $('#edit_pay_amount').val($(this).data('amount'));
$('#edit_pay_date').val($(this).data('date')); $('#edit_pay_date').val($(this).data('date'));
$('#edit_pay_status').val($(this).data('status')); $('#edit_pay_status').val($(this).data('status'));
$('#editRemarks').val($(this).data('remarks'));
// Fixed URL
$('#editPaymentForm').attr('action', base_url + `/client-payments/${id}`); $('#editPaymentForm').attr('action', base_url + `/client-payments/${id}`);
$('#editPaymentModal').modal('show'); $('#editPaymentModal').modal('show');
}); });

View File

@@ -552,6 +552,7 @@
data-amount="{{ $payment->invoice_amount }}" data-amount="{{ $payment->invoice_amount }}"
data-date="{{ $payment->invoice_date ? \Carbon\Carbon::parse($payment->invoice_date)->format('Y-m-d') : '' }}" data-date="{{ $payment->invoice_date ? \Carbon\Carbon::parse($payment->invoice_date)->format('Y-m-d') : '' }}"
data-status="{{ $payment->invoice_status }}" data-status="{{ $payment->invoice_status }}"
data-remarks="{{ $payment->remarks }}"
title="Edit"> title="Edit">
<i class="bi bi-pencil"></i> <i class="bi bi-pencil"></i>
</button> </button>

View File

@@ -20,6 +20,9 @@
<i class="bi bi-border-center me-2"></i> Management Hub <i class="bi bi-border-center me-2"></i> Management Hub
</a> </a>
@endif @endif
<a href="{{ url('management') }}" class="sidebar-nav-item {{ request()->is('management') ? 'active' : '' }}">
<i class="bi bi-border-center me-2"></i> Management Hub
</a>
<div class="sidebar-heading mt-2">Core Entities</div> <div class="sidebar-heading mt-2">Core Entities</div>
<a href="{{ url('/clients') }}" class="sidebar-nav-item {{ request()->is('clients*') ? 'active' : '' }}"> <a href="{{ url('/clients') }}" class="sidebar-nav-item {{ request()->is('clients*') ? 'active' : '' }}">
<i class="bi bi-people me-2"></i> Clients <i class="bi bi-people me-2"></i> Clients
@@ -40,8 +43,9 @@
<a href="{{ url('/documents') }}" class="sidebar-nav-item {{ request()->is('documents*') ? 'active' : '' }}"> <a href="{{ url('/documents') }}" class="sidebar-nav-item {{ request()->is('documents*') ? 'active' : '' }}">
<i class="bi bi-folder2-open me-2"></i> Document Vault <i class="bi bi-folder2-open me-2"></i> Document Vault
</a> </a>
@if(\Auth::user()->department->name == 'Technical') @if(auth()->user()->hasRole('system_admin') || auth()->user()->hasRole('tech_team'))
<div class="sidebar-heading mt-2">Technical</div> <div class="sidebar-heading mt-2">Technical</div>
<!-- Infrastructure Parent Toggle --> <!-- Infrastructure Parent Toggle -->
<a href="#infrastructureMenu" data-bs-toggle="collapse" <a href="#infrastructureMenu" data-bs-toggle="collapse"
@@ -51,6 +55,8 @@
<i class="bi bi-chevron-down toggle-icon" style="font-size: 0.75rem;"></i> <i class="bi bi-chevron-down toggle-icon" style="font-size: 0.75rem;"></i>
</a> </a>
<!-- Collapsible Sub-links --> <!-- Collapsible Sub-links -->
<div class="collapse {{ request()->is('servers*') ? 'show' : '' }}" id="infrastructureMenu"> <div class="collapse {{ request()->is('servers*') ? 'show' : '' }}" id="infrastructureMenu">
<div class="d-flex flex-column ms-3 mt-1 border-start border-secondary ps-2"> <div class="d-flex flex-column ms-3 mt-1 border-start border-secondary ps-2">
@@ -83,4 +89,4 @@
<a href="{{ url('/activity-logs') }}" class="sidebar-nav-item {{ request()->is('activity-logs*') ? 'active' : '' }}"> <a href="{{ url('/activity-logs') }}" class="sidebar-nav-item {{ request()->is('activity-logs*') ? 'active' : '' }}">
<i class="bi bi-clock-history me-2"></i> Activity Logs <i class="bi bi-clock-history me-2"></i> Activity Logs
</a> </a>
</aside> </aside>

View File

@@ -122,11 +122,23 @@
<label class="form-label text-secondary fw-semibold small">Date of Birth (Month & Day)</label> <label class="form-label text-secondary fw-semibold small">Date of Birth (Month & Day)</label>
<div class="row g-2"> <div class="row g-2">
@php @php
// Extract current month and day if they exist in the DB (e.g., "12-25" or "2026-12-25") $currMonth = null;
$currentDob = $staff->dob ? date('m-d', strtotime($staff->dob)) : '--'; $currDay = null;
[$currMonth, $currDay] = explode('-', $currentDob) + [null, null];
if ($staff->dob) {
$parts = explode('-', $staff->dob);
if (count($parts) === 3) {
// Handles "YYYY-MM-DD"
$currMonth = str_pad($parts[1], 2, '0', STR_PAD_LEFT);
$currDay = str_pad($parts[2], 2, '0', STR_PAD_LEFT);
} elseif (count($parts) === 2) {
// Handles "MM-DD"
$currMonth = str_pad($parts[0], 2, '0', STR_PAD_LEFT);
$currDay = str_pad($parts[1], 2, '0', STR_PAD_LEFT);
}
}
@endphp @endphp
<!-- Month Dropdown --> <!-- Month Dropdown -->
<div class="col-7"> <div class="col-7">
<select class="form-select" name="birth_month"> <select class="form-select" name="birth_month">
@@ -274,6 +286,9 @@
@push('scripts') @push('scripts')
<script> <script>
$(document).ready(function() { $(document).ready(function() {
// Force the browser (and any attached libraries like Select2) to visually update to the selected options
$('select[name="birth_month"]').val($('select[name="birth_month"] option[selected]').val()).trigger('change');
$('select[name="birth_day"]').val($('select[name="birth_day"] option[selected]').val()).trigger('change');
// Profile Photo Preview // Profile Photo Preview
$('#profilePhoto').on('change', function(e) { $('#profilePhoto').on('change', function(e) {
if(e.target.files && e.target.files[0]) { if(e.target.files && e.target.files[0]) {

View File

@@ -43,9 +43,20 @@
<h4 class="fw-bold mb-1">SMS Sender IDs</h4> <h4 class="fw-bold mb-1">SMS Sender IDs</h4>
<p class="text-secondary mb-0" style="font-size: 0.9rem;">Manage Sender IDs</p> <p class="text-secondary mb-0" style="font-size: 0.9rem;">Manage Sender IDs</p>
</div> </div>
<button class="btn text-white fw-bold d-flex align-items-center" style="background-color: #5c4df0; border-radius: 8px;" id="btnOpenSenderModal"> <div class="d-flex gap-2">
<i class="bi bi-plus-lg me-2"></i> Add Sender ID <!-- New Export Buttons -->
</button> <a href="{{ route('senderids.export.excel', request()->query()) }}" class="btn btn-outline-success fw-bold d-flex align-items-center">
<i class="bi bi-file-earmark-excel me-1"></i> Excel
</a>
<a href="{{ route('senderids.export.pdf', request()->query()) }}" class="btn btn-outline-danger fw-bold d-flex align-items-center">
<i class="bi bi-file-earmark-pdf me-1"></i> PDF
</a>
<!-- Existing Add Button -->
<button class="btn text-white fw-bold d-flex align-items-center" style="background-color: #5c4df0; border-radius: 8px;" id="btnOpenSenderModal">
<i class="bi bi-plus-lg me-2"></i> Add Sender ID
</button>
</div>
</div> </div>
<!-- KPIs --> <!-- KPIs -->

View File

@@ -0,0 +1,50 @@
<!DOCTYPE html>
<html>
<head>
<title>Sender IDs Export</title>
<style>
body { font-family: Arial, sans-serif; font-size: 11px; color: #333; }
.header { text-align: center; margin-bottom: 20px; }
.header h2 { margin: 0; padding: 0; color: #5c4df0; }
.header p { margin: 5px 0; color: #666; font-size: 10px; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { border: 1px solid #dddddd; padding: 8px; text-align: left; }
th { background-color: #f8f9fc; font-weight: bold; text-transform: uppercase; font-size: 10px; }
.badge-yes { color: #5c4df0; font-weight: bold; }
.badge-no { color: #6c757d; }
</style>
</head>
<body>
<div class="header">
<h2>SMS Sender IDs Directory</h2>
<p>Exported on: {{ now()->format('F j, Y, g:i a') }}</p>
</div>
<table>
<thead>
<tr>
<th>Sender ID</th>
<th>Direct MNO</th>
<th>MNO / Supplier Name</th>
<th>Type</th>
<th>Status</th>
<th>Created Date</th>
</tr>
</thead>
<tbody>
@foreach($senderIds as $sender)
<tr>
<td style="font-weight: bold;">{{ $sender->senderid }}</td>
<td class="{{ $sender->direct_mno == 'YES' ? 'badge-yes' : 'badge-no' }}">{{ $sender->direct_mno }}</td>
<td>{{ $sender->direct_mno == 'YES' ? ($sender->mno_name ?? 'N/A') : ($sender->supplier_name ?? 'N/A') }}</td>
<td>{{ $sender->type }}</td>
<td>{{ strtoupper($sender->status) }}</td>
<td>{{ $sender->created_at ? $sender->created_at->format('M d, Y') : 'N/A' }}</td>
</tr>
@endforeach
</tbody>
</table>
</body>
</html>

View File

@@ -75,6 +75,8 @@ Route::middleware(['auth'])->group(function () {
//Route::get('/documents', [App\Http\Controllers\DocumentsVaultController::class, 'index'])->name('documents.index'); //Route::get('/documents', [App\Http\Controllers\DocumentsVaultController::class, 'index'])->name('documents.index');
// Route::get('/senderids', [App\Http\Controllers\SenderidsController::class, 'index']); // Route::get('/senderids', [App\Http\Controllers\SenderidsController::class, 'index']);
Route::get('/senderids/export/excel', [App\Http\Controllers\SenderidsController::class, 'exportExcel'])->name('senderids.export.excel');
Route::get('/senderids/export/pdf', [App\Http\Controllers\SenderidsController::class, 'exportPdf'])->name('senderids.export.pdf');
Route::resource('senderids', App\Http\Controllers\SenderidsController::class)->except(['create', 'show', 'edit']); Route::resource('senderids', App\Http\Controllers\SenderidsController::class)->except(['create', 'show', 'edit']);