Initial commit

This commit is contained in:
Kwesi Banson Jnr
2026-08-04 14:50:01 +00:00
commit 2cfcfade4e
1605 changed files with 499334 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
@extends('dealer_layouts.dealer_master')
@section('page-title')
Dealer | Activity Log
@endsection
@section('page-content')
<div class="row">
<div class="col-md-12">
<div class="hpanel hblue">
<div class="panel-heading hbuilt">Activity Log for </div>
<div class="panel-body">
<div class="table-responsive">
<table cellpadding="1" cellspacing="1" class="table table-bordered table-striped">
<thead>
<tr>
<th>Title</th>
<th>Details</th>
<th>Date</th>
</tr>
</thead>
<tbody>
@forelse ($activities as $row)
<tr>
<?php $content = json_decode($row->description, true); //dump($content['data']); ?>
<td>
{{ $content['title'] }}
</td>
<td>
<?php $data_all = is_array($content['data']) ? implode(" | ", $content['data']) : $content['data']; ?>
{{ $data_all }}
</td>
<td>{{ $row->created_at }}</td>
</tr>
@empty
<tr>
<td colspan="">No Data</td>
</tr>
@endforelse
</tbody>
</table>
</div>
{{ $activities->links() }}
</div>
<div class="panel-footer">
Page : {{ $activities->currentPage() }} of {{ $activities->lastPage() }} |
Total Records : <span id="totalRecords">{{ $activities->total() }}</span>
</div>
</div>
</div>
</div>
@endsection
@section('page-js')
@endsection

View File

@@ -0,0 +1,140 @@
@extends('dealer_layouts.dealer_master')
@section('page-title')
Dealer | {{ $page_title }}
@endsection
@section('page-content')
<div class="row">
<!-- Top Statistics Panel -->
<div class="col-lg-12">
<div class="hpanel">
<div class="panel-heading">
Dashboard information and statistics
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-3 text-center">
<div class="small">
<i class="fa fa-bolt"></i> Current Balance
</div>
<div>
<h1 class="font-extra-bold m-t-xl m-b-xs text-info">
{{ $organisation->currency ?? "" }} {{ number_format(($organisation->balance ?? 0) ?: 0, 2) }}
</h1>
</div>
</div>
<div class="col-md-6">
<!-- Space for future charts or metrics -->
</div>
<div class="col-md-3 text-center">
<div class="small">
<i class="fa fa-money"></i> Total Sales (Overall)
</div>
<div>
<h1 class="font-extra-bold m-t-xl m-b-xs text-info">
{{ $organisation->currency ?? "" }} {{ number_format($merchant_topups->sum('amount'), 2) }}
</h1>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Merchant Top Up Form -->
<div class="col-md-6">
<div class="hpanel hblue">
<div class="panel-heading hbuilt">Merchant Top Up</div>
<div class="panel-body">
<form action="{{ route('dealer.topup') }}" method="POST" class="form-horizontal" id="dealerTopForm">
@csrf
<div class="col-md-12" style="padding-bottom: 10px;">
@include('commons.notifications')
</div>
<div class="form-group">
<label class="col-md-3 control-label">Select Merchant</label>
<div class="col-md-7">
<select required class="form-control" name="merchant" id="merchant">
<option value="">-- Select Account --</option>
@foreach ($merchants as $row)
<option value="{{ $row->id }}">{{ $row->fullname ?? "" }} ({{ $row->phone }})</option>
@endforeach
</select>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<label class="col-md-3 control-label">Amount</label>
<div class="col-md-7">
<input type="number" name="amount" class="form-control" id="amount" placeholder="Top Up Amount" required>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<div class="col-sm-12">
<button class="btn btn-info btn-block btn-lg" id="topFormBtn" type="submit">
<i class="fa fa-money"></i> Top Up Merchant
</button>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- Recent Transactions Table -->
<div class="col-md-6">
<div class="hpanel hblue">
<div class="panel-heading hbuilt">Recent Transactions</div>
<div class="panel-body">
<div class="table-responsive" style="height: 250px; overflow-y: auto;">
<table class="table table-bordered table-striped">
<thead>
<tr class="bg-info">
<th>Recipient Merchant</th>
<th>Amount ({{ $organisation->currency ?? "" }})</th>
<th>Payment Method</th>
<th>Status</th>
<th>Sale Date</th>
</tr>
</thead>
<tbody>
@forelse ($merchant_topups as $row)
<tr>
<td>{{ optional($row->merchantInfo)->fullname ?? 'N/A' }}</td>
<td>{{ number_format($row->amount, 2) }}</td>
<td>{{ $row->payment_method }}</td>
<td>{{ $row->status }}</td>
<td>{{ \Carbon\Carbon::parse($row->created_at)->format('F d, Y') }}</td>
</tr>
@empty
<tr>
<td colspan="5" class="text-center">No Data Available</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
@endsection
@section('page-js')
<script src="{{ asset('public/js/dealer_landing.js') }}"></script>
<script>
$(function () {
// Custom page scripts can go here
});
</script>
@endsection

View File

@@ -0,0 +1,63 @@
@extends('dealer_layouts.dealer_master')
@section('page-title')
Organisation | {{ $page_title }}
@endsection
@section('page-css')
@endsection
@section('page-content')
<div class="row">
<div class="col-md-12">
@include('commons.notifications')
</div>
<div class="col-md-6">
<div class="hpanel hblue">
<div class="panel-heading hbuilt">Merchant Account</div>
<div class="panel-body">
<form action="{{ route('merchant.update', $merchant->id) }}" id="editMerchantForm" method="POST" class="form-horizontal">
{{ csrf_field() }}
@method('PUT')
<div class="form-group">
<label class="col-sm-2 control-label">Fullname</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="fullname" value="{{ $merchant->fullname }}" placeholder="Full Name of Merchant " required>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group"><label class="col-sm-2 control-label">Phone</label>
<div class="col-sm-10">
<input type="text" name="phone" value="{{ $merchant->phone }}" class="form-control" id="merchantPhone" placeholder="Phone number " required >
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group"><label class="col-sm-2 control-label">Language</label>
<div class="col-sm-10">
<select class="form-control" name="language" id="merchantLanguage">
<option value="">-- Select Language --</option>
<option value="english" <?php echo ($merchant->language == 'english') ? "selected" : ""; ?> >English</option>
<option value="chichewa" <?php echo ($merchant->language == 'chichewa') ? "selected" : ""; ?>>Chichewa</option>
</select>
</div>
</div>
<div class="form-group"><label class="col-sm-2 control-label">Status</label>
<div class="col-sm-10">
<select class="form-control" name="status" id="merchantStatus">
<option value="">-- Select Status --</option>
<option value="active" <?php echo ($merchant->status == 'active') ? "selected" : ""; ?> >Active</option>
<option value="inactive" <?php echo ($merchant->status == 'inactive') ? "selected" : ""; ?>>Inactive</option>
</select>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<div class="col-sm-12 ">
<button class="btn btn-success btn-block" type="submit"> <i class="fa fa-save"></i> Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,143 @@
@extends('dealer_layouts.dealer_master')
@section('page-title')
Dealer | Transactions
@endsection
@section('page-content')
@include('organisation.partials.top_up_merchant')
@include('organisation.partials.top_up_merchant_by_id')
<div class="row">
<div class="col-lg-3">
<div class="hpanel stats hblue">
<div class="panel-heading hbuilt">Merchant Details</div>
<div class="panel-body list">
<div class="stats-title pull-left">
<!-- <h4>Details</h4> -->
</div>
<!-- <div class="stats-icon pull-right text-warning">
<i class="pe-7s-science fa-4x"></i>
</div> -->
<div class="row m-t-md">
<div class="col-lg-12">
<div class="text-center bg-success p-xs">
<span class="font-extra-bold no-margins text-center">
<u>{{ strtoupper($merchant->fullname) }}</u>
</span>
<br/>
</div>
</div>
</div>
<div class="row m-t-md">
<div class="col-lg-6">
<h4 class="no-margins font-bold text-success">{{ $merchant->phone }}</h4>
<div class="font-bold">Phone <i class="fa fa-phone text-success"></i></div>
</div>
<div class="col-lg-6">
<h4 class="no-margins font-bold text-success">{{ ucfirst($merchant->language) }}</h4>
<div class="font-bold">Language</div>
</div>
</div>
<div class="row m-t-md">
<div class="col-lg-6">
<h3 class="no-margins font-bold text-info ">{{ number_format($merchant->balance, 2) }}</h3>
<div class="font-bold">Balance <i class="fa fa-money"></i></div>
</div>
<div class="col-lg-6">
<h3 class="no-margins font-bold text-info">{{ ucfirst($merchant->status) }}</h3>
<div class="font-bold">Status <i class=""></i></div>
</div>
</div>
<div class="row m-t-md">
<div class="col-md-12">
<button class="btn btn-block btn-success topUpMerchantByIdBtn" id=""><i class="fa fa-money"></i> Top Up Balance</button>
<input type="hidden" class="hidden rowMerchantId" value="{{ $merchant->id }}" />
</div>
</div>
<div class="row m-t-md">
<div class="col-md-12">
<!-- <button class="btn btn-block btn-info"><i class="fa fa-edit"></i> Edit Merchant</button> -->
<a href="{{ route('merchant.edit', $merchant->id) }}" class="btn btn-info btn-block"><i class="fa fa-edit"></i> Edit Details</a>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-6">
<div class="hpanel hblue">
<div class="panel-heading hbuilt">
Merchant Sales to Customers
</div>
<div class="panel-body list">
<div class="table-responsive project-list">
<table class="table table-striped">
<thead>
<tr class="bg-info">
<th>Recipient Phone</th>
<th>Amount (MWK)</th>
<th>Status</th>
<th>Date</th>
</tr>
</thead>
<tbody>
<tr>
@forelse ($merchant->transactions as $row)
<td>{{ $row->msisdn }}
<!-- <br/>
<small><i class="fa fa-money"></i> {{ $row->amount }} </small> -->
</td>
<td>
<span class="pie">{{ number_format($row->amount) }}</span>
</td>
<td><strong>{{ $row->status }}</strong></td>
<td>{{ $row->created_at }}</td>
</tr>
@empty
<tr>
<td colspan="7">No Data</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="hpanel hblue">
<div class="panel-heading hbuilt">
Merchant Balance Top Ups
</div>
<div class="panel-body list">
<!-- <div class="panel-title">Last Activity</div> -->
<!-- <small class="fo">This is simple example</small> -->
<div class="list-item-container">
@forelse ($merchant_topups as $row)
<div class="list-item">
<h3 class="no-margins font-extra-bold text-success">MWK {{ number_format($row->amount) }}</h3>
<small>{{ $row->status }}</small> <br>
<div class="pull-right font-bold">{{ $row->created_at }} <i class="fa fa-calendar text-success"></i></div>
</div>
@empty
<tr>
<td colspan="7">No Data</td>
</tr>
@endforelse
</div>
</div>
</div>
</div>
</div>
@endsection
@section('page-js')
<script src="{{ url('public/js/dealer_landing.js') }}"></script>
@endsection

View File

@@ -0,0 +1,82 @@
@extends('dealer_layouts.dealer_master')
@section('page-title')
Dealer | Merchants
@endsection
@section('page-content')
@include('organisation.partials.create_merchant')
@include('organisation.partials.top_up_merchant_by_id')
<div class="row">
<div class="col-md-12">
<div class="hpanel hblue">
<div class="panel-heading hbuilt text-info">
Sales to Merchants
<buton class="btn btn-success btn-xs mb-2 pull-right" id="addNewMerchant"><i class="fa fa-plus"></i> Add Merchant</button>
<input type="hidden" class="orgRowId" value="{{ $org_user['org_id'] }}">
<div class="clearfix"></div>
</div>
<div class="panel-body">
<div>
@include('commons.notifications')
<div class="clearfix"></div>
</div>
<div class="table-responsive">
<table cellpadding="1" cellspacing="1" class="table table-bordered table-striped">
<thead>
<tr class="bg-info">
<th>Name</th>
<th>Phone</th>
<th>Language</th>
<th>Balance</th>
<th>Status</th>
<th>Registration Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@forelse ($merchants as $row)
<tr>
<td>{{ $row->fullname }}</td>
<td>{{ $row->phone }}</td>
<td>{{ ucfirst($row->language) }}</td>
<td>{{ number_format($row->balance) }}</td>
<td class="<?php echo ($row->status == 'inactive') ? 'bg-warning' : 'bg-success'; ?>">{{ ucfirst($row->status) }}</td>
<td>{{ $row->created_at }}</td>
<td>
<input type="hidden" class="orgRowId" value="{{ $row->id }}">
<button type="button" class="btn btn-success btn-xs topUpMerchantBtn" ><i class="fa fa-plus"></i> Top Up</button>
<a href="{{ route('merchant.show', $row->id) }}" class="btn btn-primary btn-xs"><i class="fa fa-eye"></i> View</a>
<a href="{{ route('merchant.edit', $row->id) }}" class="btn btn-info btn-xs"><i class="fa fa-edit"></i> Edit</a>
<!-- <a href="{{ route('merchant.destroy', $row->id) }}" class="btn btn-danger btn-xs" onclick="return confirm('Are you sure you want to delete this merchant?')"><i class="fa fa-ban"></i> Disable</a> -->
</td>
</tr>
@empty
<tr>
<td colspan="7">No Data</td>
</tr>
@endforelse
</tbody>
</table>
</div>
{{ $merchants->links() }}
</div>
<div class="panel-footer">
Page : {{ $merchants->currentPage() }} of {{ $merchants->lastPage() }} |
Total Records : <span id="totalRecords">{{ $merchants->total() }}</span>
</div>
</div>
</div>
</div>
@endsection
@section('page-js')
<script src="{{ url('public/js/dealer_landing.js') }}"></script>
<script>
$(document).ready(function() {
});
</script>
@endsection

View File

@@ -0,0 +1,128 @@
@extends('dealer_layouts.dealer_master')
@section('page-title')
Dealer | Transactions
@endsection
@section('page-css')
<link href="{!! url('public/theme_assets/vendor/tabulator/css/bootstrap/tabulator_bootstrap.css') !!}" type="text/css" rel="stylesheet">
@endsection
@section('page-content')
<div class="row">
<div class="col-md-12">
<div class="hpanel hblue">
<div class="panel-heading hbuilt">Purchases from Super Venders</div>
<div class="panel-body">
<div class="" style="padding-bottom: 10px;">
<button id="transactions-download-xlsx" class="btn btn-success btn-sm"><i class="fa fa-file-excel-o"></i> Download XLSX</button>
<button id="transactions-download-pdf" class="btn btn-danger btn-sm"><i class="fa fa-file-pdf-o"></i> Download PDF</button>
</div>
<div class="pull-right">
<form method="GET" action="{!! url('organisation/mytopups') !!}">
<div class="col-md-12 form-group pull-right top_search" style="background: cornflowerblue;">
<div class="input-group">
<input type="text" name="keyword" class="form-control" id="keywordField" placeholder="Keyword here.. ">
</div>
</div>
</form>
</div>
<div id="transactionsTable"></div>
</div>
<div class="panel-footer"></div>
</div>
</div>
</div>
@endsection
@section('page-js')
<script src="{!! url('public/theme_assets/vendor/tabulator/js/tabulator.js') !!}"></script>
<script src="{!! url('public/theme_assets/vendor/tabulator/js/xlsx.full.min.js') !!}"></script>
<script src="{!! url('public/theme_assets/vendor/tabulator/js/jspdf.min.js') !!}"></script>
<script src="{!! url('public/theme_assets/vendor/tabulator/js/jspdf.plugin.autotable.js') !!}"></script>
<script>
function statusDesign (cell, formatterParams){
var value = cell.getValue();
// if(value === 'Approved'){
if(value.includes('Success')){
return "<span style='color:#3FB449; font-weight:bold;'>" + value + "</span>";
}
else if(value.includes('Failed')){
return "<span style='color:#3FB449; font-weight:bold;'>" + value + "</span>";
}
else{
return "<span style='color:#E4A11B;'>" + value + "</span>";
}
}
var table = new Tabulator("#transactionsTable", {
ajaxURL: "mytopups/all",
paginationSize: 15,
layout: "fitColumns",
pagination: "remote",
selectable: false,
printAsHtml: true,
ajaxLoaderLoading: $('#logo_spinner').html(),
columns: [
{
title: "Vendor Name",
field: "name",
sorter: "string",
// formatter: cellDesign,
// formatter:link,
},
{
title: "Amount",
field: "amount",
sorter: "number",
},
{
title: "Payment Method",
field: "payment_method",
sorter: "string",
},
{
title: "Status",
field: "status",
sorter: "string",
formatter: statusDesign,
},
{
title: "Date",
field: "created_at",
sorter: "string",
},
],
rowClick:function(e, row){
var userID = row.getData().id;
console.log(userID);
//$('#modalHere').modal('show');
},
});
document.getElementById("transactions-download-xlsx").addEventListener("click", function(){
table.download("xlsx", "transactions-list.xlsx", {sheetName:"Sheet 1"});
});
//trigger download of data.pdf file
document.getElementById("transactions-download-pdf").addEventListener("click", function(){
table.download("pdf", "transactions-list.pdf", {
orientation:"portrait", //set page orientation to portrait
title:"Click Mobile - Sender ID", //add title to report
});
});
$('#keywordField').on('keyup', function(){
console.log('up');
var keyword = $(this).val();
table.setData("mytopups/all?keyword=" + keyword);
});
</script>
@endsection

View File

@@ -0,0 +1,50 @@
<div class="modal fade" id="createMerchantModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="color-line"></div>
<div class="modal-header">
<h4 class="modal-title titleHead" ></h4>
<small class="font-bold">Merchant Registration</small>
</div>
<div class="modal-body">
<div class="alert alert-danger hidden" id="topupError"></div>
<div class="alert alert-success hidden" id="topupSuccess"></div>
<!-- {{ url('organisation/merchant') }} -->
<form action="" id="newMerchantForm" method="POST" class="form-horizontal">
{{ csrf_field() }}
<div class="form-group">
<label class="col-sm-2 control-label">Fullname</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="fullname" placeholder="Full Name of Merchant " required>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group"><label class="col-sm-2 control-label">Phone</label>
<div class="col-sm-10">
<input type="text" name="phone_number" class="form-control" id="merchantPhone" placeholder="Phone number " required >
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group"><label class="col-sm-2 control-label">Language</label>
<div class="col-sm-10">
<select class="form-control" name="language" id="merchantLanguage">
<option value="">-- Select Language --</option>
<option value="english">English</option>
<option value="chichewa">Chichewa</option>
</select>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<div class="col-sm-12 ">
<button class="btn btn-primary btn-block" type="submit">Submit</button>
<button class="btn btn-default btn-block" type="button">Cancel</button> <br>
</div>
</div>
</form>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,59 @@
<div class="modal fade" id="topUpMerchantModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="color-line"></div>
<div class="modal-header">
<h4 class="modal-title titleHead" ></h4>
<small class="font-bold">Merchant Top Up</small>
</div>
<div class="modal-body">
<div class="alert alert-danger hidden" id="topupError"></div>
<div class="alert alert-success hidden" id="topupSuccess"></div>
<form action="{{ url('organisation/topup') }}" method="POST" class="form-horizontal" id="dealerTopForm">
{{csrf_field()}}
<div class="col-md-12" style="padding-bottom: 10px;">
@include('commons.notifications')
</div>
<div class="form-group">
<label class="col-md-3 control-label">Select Merchant</label>
<div class="col-md-7">
<!-- <input type="text" class="form-control" name="phone_number" placeholder="phone number" required> -->
<select required class="form-control" name="merchant" id="merchant" placeholder="Merchant" >
<option>-- Select Account --</option>
<?php foreach ($merchants_list as $row): ?>
<option value="{{ $row->id }}">{{ $row->fullname }} ({{ $row->phone }}) </option>
<?php endforeach ?>
</select>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<label class="col-md-3 control-label">Amount (MWK)</label>
<div class="col-md-7">
<input type="number" name="amount" class="form-control" id="amount" placeholder="Top Up Amount" required>
</div>
</div>
<div class="form-group hidden" id="otpDivArea">
<label class="col-md-3 control-label">OTP</label>
<div class="col-md-7">
<input type="number" name="otp" class="form-control" id="otp" placeholder="One Time Password(OTP)" required>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<div class="col-sm-12 ">
<button class="btn btn-success btn-block btn-lg" id="otpButton" type="submit"><i class="fa fa-send"></i> Submit</button>
</div>
</div>
<div class="form-group">
<div class="col-sm-12 ">
<button class="btn btn-info btn-block btn-lg hidden" id="topFormBtn" type="submit"><i class="fa fa-money"></i> Top Up Merchant</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,49 @@
<div class="modal fade" id="topUpMerchantByIdModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="color-line"></div>
<div class="modal-header">
<h4 class="modal-title titleHead" ></h4>
<small class="font-bold">Merchant Top Up</small>
</div>
<div class="modal-body">
<div class="col-md-12" style="padding-bottom: 10px;">
@include('commons.notifications')
</div>
<div class="alert alert-danger hidden" id="topupByIdError"></div>
<div class="alert alert-success hidden" id="topupByIdSuccess"></div>
<!-- {{ url('organisation/topup') }} -->
<form action="" method="POST" class="form-horizontal" id="dealerTopFormById">
<input type="hidden" name="merchant_id" class="selectedMerchantId" value="">
<input type="hidden" name="merchant" class="selectedMerchantId" value="">
{{ csrf_field() }}
<div class="hr-line-dashed"></div>
<div class="form-group">
<label class="col-md-3 control-label" for="topUpAmountById">Amount (MWK)</label>
<div class="col-md-7">
<input type="number" name="amount" class="form-control" id="topUpAmountById" placeholder="Top Up Amount" required>
</div>
</div>
<!-- <div class="form-group hidden" id="otpDivArea">
<label class="col-md-3 control-label">OTP</label>
<div class="col-md-7">
<input type="number" name="otp" class="form-control" id="otp" placeholder="One Time Password(OTP)" required>
</div>
</div> -->
<div class="hr-line-dashed"></div>
<!-- <div class="form-group">
<div class="col-sm-12 ">
<button class="btn btn-success btn-block btn-lg" id="otpButton" type="submit"><i class="fa fa-send"></i> Submit</button>
</div>
</div> -->
<div class="form-group">
<div class="col-sm-12 ">
<button class="btn btn-info btn-block btn-lg" id="topFormByIdBtn" type="submit"><i class="fa fa-money"></i> Top Up Merchant</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,57 @@
@extends('dealer_layouts.dealer_master')
@section('page-title')
Dealer | Transactions
@endsection
@section('page-content')
<div class="row">
<div class="col-md-12">
<div class="hpanel hblue">
<div class="panel-heading hbuilt">Sales from {{ $org_user['name'] }} to Merchants</div>
<div class="panel-body">
<div class="table-responsive">
<table cellpadding="1" cellspacing="1" class="table table-bordered table-striped">
<thead>
<tr class="bg-info">
<th>Recipient Merchant</th>
<th>Amount</th>
<th>Payment Method</th>
<th>Status</th>
<th>Date</th>
</tr>
</thead>
<tbody>
@forelse ($merchant_topups as $row)
<tr>
<td>{{ $row->merchantInfo->fullname }}</td>
<td>{{ number_format($row->amount) }}</td>
<td>{{ $row->payment_method }}</td>
<td>{{ $row->status }}</td>
<td>{{ $row->created_at }}</td>
</tr>
@empty
<tr>
<td colspan="">No Data</td>
</tr>
@endforelse
</tbody>
</table>
</div>
{{ $merchant_topups->links() }}
</div>
<div class="panel-footer">
Page : {{ $merchant_topups->currentPage() }} of {{ $merchant_topups->lastPage() }} |
Total Records : <span id="totalRecords">{{ $merchant_topups->total() }}</span>
</div>
</div>
</div>
</div>
@endsection
@section('page-js')
@endsection

View File

@@ -0,0 +1,135 @@
@extends('dealer_layouts.dealer_master')
@section('page-title')
Dealer | Transactions
@endsection
@section('page-css')
<link href="{!! url('public/theme_assets/vendor/tabulator/css/bootstrap/tabulator_bootstrap.css') !!}" type="text/css" rel="stylesheet">
@endsection
@section('page-content')
<div class="row">
<div class="col-md-12">
<div class="hpanel hblue">
<div class="panel-heading hbuilt">Sales from <span class="text-success"><b>{{ strtoupper($org_user['name']) }}</b> </span>to Merchants</div>
<div class="panel-body">
<div class="" style="padding-bottom: 10px;">
<button id="transactions-download-xlsx" class="btn btn-success btn-sm"><i class="fa fa-file-excel-o"></i> Download XLSX</button>
<button id="transactions-download-pdf" class="btn btn-danger btn-sm"><i class="fa fa-file-pdf-o"></i> Download PDF</button>
</div>
<div class="pull-right">
<form method="GET" action="{!! url('organisation/transactions') !!}">
<div class="col-md-12 form-group pull-right top_search" style="background: cornflowerblue;">
<div class="input-group">
<input type="text" name="keyword" class="form-control" id="keywordField" placeholder="Keyword here.. ">
</div>
</div>
</form>
</div>
<div id="transactionsTable"></div>
</div>
<div class="panel-footer"></div>
</div>
</div>
</div>
@endsection
@section('page-js')
<script src="{!! url('public/theme_assets/vendor/tabulator/js/tabulator.js') !!}"></script>
<script src="{!! url('public/theme_assets/vendor/tabulator/js/xlsx.full.min.js') !!}"></script>
<script src="{!! url('public/theme_assets/vendor/tabulator/js/jspdf.min.js') !!}"></script>
<script src="{!! url('public/theme_assets/vendor/tabulator/js/jspdf.plugin.autotable.js') !!}"></script>
<script>
function statusDesign (cell, formatterParams){
var value = cell.getValue();
// if(value === 'Approved'){
if(value.includes('Success')){
return "<span style='color:#3FB449; font-weight:bold;'>" + value + "</span>";
}
else if(value.includes('Failed')){
return "<span style='color:#3FB449; font-weight:bold;'>" + value + "</span>";
}
else{
return "<span style='color:#E4A11B;'>" + value + "</span>";
}
}
var table = new Tabulator("#transactionsTable", {
ajaxURL: "transactions/all",
paginationSize: 15,
layout: "fitColumns",
pagination: "remote",
selectable: false,
printAsHtml: true,
ajaxLoaderLoading: $('#logo_spinner').html(),
columns: [
{
title: "Merchant",
field: "fullname",
sorter: "string",
// formatter: cellDesign,
// formatter:link,
},
{
title: "Merchant Phone",
field: "phone",
sorter: "string",
// formatter: cellDesign,
// formatter:link,
},
{
title: "Amount",
field: "amount",
sorter: "number",
},
{
title: "Payment Method",
field: "payment_method",
sorter: "string",
},
{
title: "Status",
field: "status",
sorter: "string",
formatter: statusDesign,
},
{
title: "Date",
field: "created_at",
sorter: "string",
},
],
rowClick:function(e, row){
var userID = row.getData().id;
console.log(userID);
//$('#modalHere').modal('show');
},
});
document.getElementById("transactions-download-xlsx").addEventListener("click", function(){
table.download("xlsx", "transactions-list.xlsx", {sheetName:"Sheet 1"});
});
//trigger download of data.pdf file
document.getElementById("transactions-download-pdf").addEventListener("click", function(){
table.download("pdf", "transactions-list.pdf", {
orientation:"portrait", //set page orientation to portrait
title:"Click Mobile - Sender ID", //add title to report
});
});
$('#keywordField').on('keyup', function(){
console.log('up');
var keyword = $(this).val();
table.setData("transactions/all?keyword=" + keyword);
});
</script>
@endsection