Initial commit
This commit is contained in:
63
resources/views/merchants/activity.blade.php
Normal file
63
resources/views/merchants/activity.blade.php
Normal file
@@ -0,0 +1,63 @@
|
||||
@extends('merch_layouts.merch_master')
|
||||
@section('page-title')
|
||||
Merchant | 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 {{ $merchant->fullname }}</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 $flat = \Arr::flatten($content['data']); ?>
|
||||
{{ implode(' - ', $flat) }}
|
||||
</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')
|
||||
<script>
|
||||
// $(fddd)
|
||||
console.log('foo bar');
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
124
resources/views/merchants/dealer-list.blade.php
Normal file
124
resources/views/merchants/dealer-list.blade.php
Normal file
@@ -0,0 +1,124 @@
|
||||
@extends('merch_layouts.merch_master')
|
||||
@section('page-title')
|
||||
Merchant | Dealer Top Ups
|
||||
@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">Dealer List</div>
|
||||
<div class="panel-body">
|
||||
<div class="" style="padding-bottom: 10px;">
|
||||
<button id="dealertopups-download-xlsx" class="btn btn-success btn-sm"><i class="fa fa-file-excel-o"></i> Download XLSX</button>
|
||||
<button id="dealertopups-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('merchant/dealertransactions') !!}">
|
||||
<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="dealerListTable"></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("#dealerListTable", {
|
||||
ajaxURL: "dealerlist/all",
|
||||
paginationSize: 15,
|
||||
layout: "fitColumns",
|
||||
pagination: "remote",
|
||||
selectable: false,
|
||||
printAsHtml: true,
|
||||
ajaxLoaderLoading: $('#logo_spinner').html(),
|
||||
columns: [
|
||||
|
||||
{
|
||||
title: "Dealer",
|
||||
field: "name",
|
||||
sorter: "string",
|
||||
},
|
||||
{
|
||||
title: "Dealer Phone",
|
||||
field: "phone",
|
||||
sorter: "string",
|
||||
},
|
||||
{
|
||||
title: "Dealer Email",
|
||||
field: "email",
|
||||
sorter: "string",
|
||||
},
|
||||
{
|
||||
title: "Status",
|
||||
field: "status",
|
||||
sorter: "string",
|
||||
},
|
||||
{
|
||||
title: "Date",
|
||||
field: "created_at",
|
||||
sorter: "string",
|
||||
},
|
||||
],
|
||||
|
||||
rowClick:function(e, row){
|
||||
var userID = row.getData().id;
|
||||
console.log(userID);
|
||||
//$('#modalHere').modal('show');
|
||||
},
|
||||
});
|
||||
document.getElementById("dealerlist-download-xlsx").addEventListener("click", function(){
|
||||
table.download("xlsx", "dealerlist.xlsx", {sheetName:"Sheet 1"});
|
||||
});
|
||||
//trigger download of data.pdf file
|
||||
document.getElementById("dealer-download-pdf").addEventListener("click", function(){
|
||||
table.download("pdf", "dealer-list.pdf", {
|
||||
orientation:"portrait", //set page orientation to portrait
|
||||
title:"Click Mobile - Dealer List", //add title to report
|
||||
});
|
||||
});
|
||||
$('#keywordField').on('keyup', function(){
|
||||
console.log('up');
|
||||
var keyword = $(this).val();
|
||||
table.setData("dealertransactions/all?keyword=" + keyword);
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
125
resources/views/merchants/dealer-transactions.blade copy.php
Normal file
125
resources/views/merchants/dealer-transactions.blade copy.php
Normal file
@@ -0,0 +1,125 @@
|
||||
@extends('merch_layouts.merch_master')
|
||||
@section('page-title')
|
||||
Merchant | Dealer Top Ups
|
||||
@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">Top Ups received from Dealers</div>
|
||||
<div class="panel-body">
|
||||
<div class="" style="padding-bottom: 10px;">
|
||||
<button id="dealertopups-download-xlsx" class="btn btn-success btn-sm"><i class="fa fa-file-excel-o"></i> Download XLSX</button>
|
||||
<button id="dealertopups-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('merchant/dealertransactions') !!}">
|
||||
<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="dealerTopsTable"></div>
|
||||
</div>
|
||||
<div class="panel-footer"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@endsection
|
||||
@section('page-js')
|
||||
|
||||
<script src="{!! url('public/vendor/tabulator-master/dist/js/tabulator.min.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("#dealerTopsTable", {
|
||||
ajaxURL: "dealertransactions/all",
|
||||
paginationSize: 15,
|
||||
layout: "fitColumns",
|
||||
pagination: "remote",
|
||||
selectable: false,
|
||||
printAsHtml: true,
|
||||
ajaxLoaderLoading: $('#logo_spinner').html(),
|
||||
columns: [
|
||||
|
||||
{
|
||||
title: "Dealer",
|
||||
field: "name",
|
||||
sorter: "string",
|
||||
},
|
||||
{
|
||||
title: "Dealer Phone",
|
||||
field: "phone",
|
||||
sorter: "string",
|
||||
},
|
||||
{
|
||||
title: "Amount",
|
||||
field: "amount",
|
||||
sorter: "number",
|
||||
},
|
||||
|
||||
{
|
||||
title: "Status",
|
||||
field: "status",
|
||||
sorter: "string",
|
||||
formatter: statusDesign,
|
||||
},
|
||||
|
||||
{
|
||||
title: "Date",
|
||||
field: "created_at",
|
||||
sorter: "string",
|
||||
},
|
||||
],
|
||||
|
||||
rowClick:function(e, row){
|
||||
var userID = row.getData().id;
|
||||
},
|
||||
});
|
||||
document.getElementById("dealertopups-download-xlsx").addEventListener("click", function(){
|
||||
table.download("xlsx", "dealertopups-list.xlsx", {sheetName:"Sheet 1"});
|
||||
});
|
||||
//trigger download of data.pdf file
|
||||
document.getElementById("dealertopups-download-pdf").addEventListener("click", function(){
|
||||
table.download("pdf", "dealertopups-list.pdf", {
|
||||
orientation:"portrait", //set page orientation to portrait
|
||||
title:"Click Mobile - Dealer Top Ups", //add title to report
|
||||
});
|
||||
});
|
||||
$('#keywordField').on('keyup', function(){
|
||||
console.log('up');
|
||||
var keyword = $(this).val();
|
||||
table.setData("dealertransactions/all?keyword=" + keyword);
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
328
resources/views/merchants/dealer-transactions.blade.php
Normal file
328
resources/views/merchants/dealer-transactions.blade.php
Normal file
@@ -0,0 +1,328 @@
|
||||
@extends('merch_layouts.merch_master')
|
||||
@section('page-title')
|
||||
Merchant | Dealer Top Ups
|
||||
@endsection
|
||||
@section('page-css')
|
||||
<link href="{!! url('public/vendor/tabulator-master/dist/css/tabulator_bootstrap3.min.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">Top Ups received from Dealers</div>
|
||||
<div class="panel-body">
|
||||
<div class="" style="padding-bottom: 10px;">
|
||||
<button id="dealertopups-download-xlsx" class="btn btn-success btn-sm"><i class="fa fa-file-excel-o"></i> Download XLSX</button>
|
||||
<button id="dealertopups-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('merchant/dealertransactions') !!}">
|
||||
<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="dealerTopsTable"></div>
|
||||
</div>
|
||||
<div class="panel-footer"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="col-md-12">
|
||||
<div class="hpanel hblue">
|
||||
|
||||
<div class="panel-heading hbuilt">
|
||||
Top Ups received from Dealers
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
|
||||
<!-- Action Buttons and Search -->
|
||||
<div class="row" style="margin-bottom:15px;">
|
||||
|
||||
<!-- Download Buttons -->
|
||||
<div class="col-md-6">
|
||||
<button id="dealertopups-download-xlsx" class="btn btn-success btn-sm">
|
||||
<i class="fa fa-file-excel-o"></i> Download XLSX
|
||||
</button>
|
||||
|
||||
<button id="dealertopups-download-pdf" class="btn btn-danger btn-sm">
|
||||
<i class="fa fa-file-pdf-o"></i> Download PDF
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Search Box -->
|
||||
<div class="col-md-6 text-right">
|
||||
<form method="GET" action="{!! url('merchant/dealertransactions') !!}" class="form-inline">
|
||||
|
||||
<div class="input-group" style="width:300px; display:inline-flex;">
|
||||
<input
|
||||
type="text"
|
||||
name="keyword"
|
||||
id="keywordField"
|
||||
class="form-control"
|
||||
placeholder="Search by keyword..."
|
||||
value="{{ request('keyword') }}">
|
||||
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-primary" type="submit">
|
||||
<i class="fa fa-search"></i>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Dealer Topups Table -->
|
||||
<div id="dealerTopsTable"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="panel-footer"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
@endsection
|
||||
@section('page-js')
|
||||
|
||||
<!-- <script src="{!! url('public/theme_assets/vendor/tabulator/js/tabulator.js') !!}"></script> -->
|
||||
<script src="{!! url('public/vendor/tabulator-master/dist/js/tabulator.min.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>
|
||||
// Status formatter
|
||||
function statusDesign(cell) {
|
||||
const value = cell.getValue() || "";
|
||||
|
||||
if (value.includes("Success")) {
|
||||
return "<span style='color:#3FB449;font-weight:bold'>" + value + "</span>";
|
||||
}
|
||||
|
||||
if (value.includes("Failed")) {
|
||||
return "<span style='color:#dc3545;font-weight:bold'>" + value + "</span>";
|
||||
}
|
||||
|
||||
return "<span style='color:#E4A11B'>" + value + "</span>";
|
||||
}
|
||||
|
||||
// Initialize Tabulator
|
||||
var table = new Tabulator("#dealerTopsTable", {
|
||||
|
||||
ajaxURL: "dealertransactions/all",
|
||||
|
||||
ajaxConfig: "GET",
|
||||
|
||||
layout: "fitColumns",
|
||||
|
||||
index: "id",
|
||||
|
||||
pagination: true,
|
||||
paginationMode: "remote",
|
||||
paginationSize: 15,
|
||||
|
||||
selectableRows: false,
|
||||
|
||||
printAsHtml: true,
|
||||
|
||||
ajaxLoader: true,
|
||||
ajaxLoaderLoading: $("#logo_spinner").html(),
|
||||
|
||||
columns: [
|
||||
{
|
||||
title: "Dealer",
|
||||
field: "name",
|
||||
sorter: "string",
|
||||
},
|
||||
{
|
||||
title: "Dealer Phone",
|
||||
field: "phone",
|
||||
sorter: "string",
|
||||
},
|
||||
{
|
||||
title: "Amount",
|
||||
field: "amount",
|
||||
sorter: "number",
|
||||
hozAlign: "right",
|
||||
},
|
||||
{
|
||||
title: "Status",
|
||||
field: "status",
|
||||
sorter: "string",
|
||||
formatter: statusDesign,
|
||||
},
|
||||
{
|
||||
title: "Date",
|
||||
field: "created_at",
|
||||
sorter: "string",
|
||||
},
|
||||
// {
|
||||
// title: "Action",
|
||||
// formatter: function (cell) {
|
||||
// const data = cell.getRow().getData();
|
||||
// const transaction_id = data.transaction_id;
|
||||
// return `<button class="btn btn-sm btn-danger" type="button" onclick="refundDealerTopUp('${transaction_id}')" >Refund</button>`;
|
||||
// },
|
||||
// hozAlign: "center",
|
||||
// headerSort: false,
|
||||
// }
|
||||
{
|
||||
title: "Action",
|
||||
formatter: function (cell) {
|
||||
const data = cell.getRow().getData();
|
||||
if (!data.status || !data.status.includes("Success")) return "No Action needed";
|
||||
const transaction_id = data.transaction_id;
|
||||
return `<button class="btn btn-sm btn-danger" type="button" onclick="refundDealerTopUp(${transaction_id})">Refund</button>`;
|
||||
},
|
||||
hozAlign: "center",
|
||||
headerSort: false,
|
||||
}
|
||||
|
||||
|
||||
],
|
||||
|
||||
rowClick: function (e, row) {
|
||||
const data = row.getData();
|
||||
console.log("Selected ID:", data.id);
|
||||
|
||||
// Example:
|
||||
// window.location = "/dealertransactions/" + data.id;
|
||||
},
|
||||
|
||||
ajaxError: function (xhr, textStatus, errorThrown) {
|
||||
console.error("Tabulator AJAX Error:", errorThrown);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// Excel Download
|
||||
const excelBtn = document.getElementById("dealertopups-download-xlsx");
|
||||
|
||||
if (excelBtn) {
|
||||
excelBtn.addEventListener("click", function () {
|
||||
table.download("xlsx", "dealertopups-list.xlsx", {
|
||||
sheetName: "Sheet 1"
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// PDF Download
|
||||
const pdfBtn = document.getElementById("dealertopups-download-pdf");
|
||||
|
||||
if (pdfBtn) {
|
||||
pdfBtn.addEventListener("click", function () {
|
||||
table.download("pdf", "dealertopups-list.pdf", {
|
||||
orientation: "portrait",
|
||||
title: "Click Mobile - Dealer Top Ups"
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Search with debounce
|
||||
let searchTimer;
|
||||
|
||||
$("#keywordField").on("keyup", function () {
|
||||
|
||||
clearTimeout(searchTimer);
|
||||
|
||||
searchTimer = setTimeout(function () {
|
||||
|
||||
table.setData("dealertransactions/all", {
|
||||
keyword: $("#keywordField").val()
|
||||
});
|
||||
|
||||
}, 300);
|
||||
|
||||
});
|
||||
|
||||
function refundDealerTopUpOld(transaction_id) {
|
||||
if (!confirm("Are you sure you want to refund this transaction?")) return;
|
||||
|
||||
$.ajax({
|
||||
url: "/pushrefunds",
|
||||
method: "POST",
|
||||
data: { transaction_id: transaction_id },
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content")
|
||||
},
|
||||
success: function (res) {
|
||||
alert(res?.message || "Refund requested successfully.");
|
||||
table.setData("dealertransactions/all", {
|
||||
keyword: $("#keywordField").val()
|
||||
});
|
||||
},
|
||||
error: function (xhr) {
|
||||
console.error(xhr.responseText);
|
||||
alert("Refund failed: " + (xhr.responseJSON?.message || "Unknown error"));
|
||||
}
|
||||
});
|
||||
}
|
||||
function refundDealerTopUp(transaction_id) {
|
||||
$.confirm({
|
||||
title: 'Refund top up',
|
||||
content: '' +
|
||||
'<form id="refundForm">' +
|
||||
' <div class="form-group">' +
|
||||
' <label>Reason</label>' +
|
||||
' <input type="text" class="form-control" name="reason" placeholder="Enter refund reason" required />' +
|
||||
' </div>' +
|
||||
'</form>',
|
||||
type: 'red',
|
||||
columnClass: 'medium',
|
||||
buttons: {
|
||||
cancel: function () {},
|
||||
confirm: {
|
||||
text: 'Confirm Refund',
|
||||
btnClass: 'btn-danger',
|
||||
action: function () {
|
||||
const reason = this.$content.find('input[name="reason"]').val();
|
||||
|
||||
return $.ajax({
|
||||
url: "/merchant/pushrefunds",
|
||||
method: "POST",
|
||||
data: { transaction_id: transaction_id, reason: reason },
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content")
|
||||
}
|
||||
}).done(function (res) {
|
||||
$.alert(res?.message || "Refund requested successfully.");
|
||||
table.setData("dealertransactions/all", {
|
||||
keyword: $("#keywordField").val()
|
||||
});
|
||||
}).fail(function (xhr) {
|
||||
console.log('status:', xhr.status);
|
||||
console.log(xhr.responseText);
|
||||
let msg = 'Request failed.';
|
||||
try {
|
||||
const res = JSON.parse(xhr.responseText);
|
||||
if (res && typeof res.message === 'string') msg = res.message;
|
||||
}
|
||||
catch (e) {}
|
||||
|
||||
$.alert(msg);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
|
||||
|
||||
168
resources/views/merchants/landing.blade.php
Normal file
168
resources/views/merchants/landing.blade.php
Normal file
@@ -0,0 +1,168 @@
|
||||
@extends('merch_layouts.merch_master')
|
||||
@section('page-title')
|
||||
Merchant | {{ $page_title }}
|
||||
@endsection
|
||||
@section('page-content')
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="hpanel">
|
||||
<div class="panel-heading">
|
||||
Dashboard information and statistics
|
||||
</div>
|
||||
<!-- style="height: 150px !important;" -->
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-md-3 text-center">
|
||||
<div class="small">
|
||||
<i class="fa fa-bolt"></i> Current Balanace
|
||||
</div>
|
||||
<div>
|
||||
<h1 class="font-extra-bold m-t-xl m-b-xs text-<?php echo ($current_balance > 2000) ? "success" : "danger"; ?> ">
|
||||
{{ $merchant->currency }} {{ number_format($current_balance) }}
|
||||
</h1>
|
||||
<small></small>
|
||||
</div>
|
||||
<div class="small m-t-xl">
|
||||
<!-- <i class="fa fa-clock-o"></i> Data from January -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<!-- <div class="text-center small">
|
||||
<i class="fa fa-laptop"></i> Transactions in current month ({{ date("F") }})
|
||||
</div>
|
||||
<div class="flot-chart" style="height: 160px">
|
||||
<div class="flot-chart-content" id="flot-line-chart"></div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="col-md-3 text-center">
|
||||
<div class="small">
|
||||
<i class="fa fa-clock-o"></i> Total Sales (Overall)
|
||||
</div>
|
||||
<div>
|
||||
<h1 class="font-extra-bold m-t-xl m-b-xs text-info">
|
||||
{{ number_format($transaction_sum) }}
|
||||
</h1>
|
||||
<!-- <small>And four weeks</small> -->
|
||||
</div>
|
||||
<div class="small m-t-xl">
|
||||
<!-- <i class="fa fa-clock-o"></i> Last active in 12.10.2015 -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="hpanel">
|
||||
<div class="panel-heading">Customer Top Up</div>
|
||||
<div class="panel-body">
|
||||
<form action="{{ url('merchant/topup') }}" method="POST" class="form-horizontal" id="merchantTopForm">
|
||||
{{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">Phone Number</label>
|
||||
<div class="col-md-7">
|
||||
<input type="number" class="form-control" name="phone_number" placeholder="phone number" required>
|
||||
<!-- <p class="text-warning" style="padding-top: 10px;">Minimum Amounts - TNM: 1MWK | Airtel : 10MWK </p> -->
|
||||
</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" type="submit"><i class="fa fa-send"></i> Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="hpanel">
|
||||
<div class="panel-heading">Recent Transactions</div>
|
||||
<div class="panel-body">
|
||||
<div class="table-responsive" style="height:550px; overflow: scroll; ">
|
||||
<table cellpadding="1" cellspacing="1" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr class="bg-info">
|
||||
<th>Phone</th>
|
||||
<th>Amount ({{ $merchant->currency }})</th>
|
||||
<th>Status</th>
|
||||
<th>Sale Date </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($transactions as $row)
|
||||
<tr>
|
||||
<td>{{ $row->msisdn }}</td>
|
||||
<td>{{ number_format($row->amount) }}</td>
|
||||
<td>{{ $row->status }}</td>
|
||||
<td>{{ Carbon\Carbon::parse($row->created_at)->format('F d, Y') }}</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="4">No Data</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
@section('page-js')
|
||||
|
||||
<script src="{{ url('public/theme_assets/vendor/jquery-flot/jquery.flot.js') }}"></script>
|
||||
<script src="{{ url('public/theme_assets/vendor/jquery-flot/jquery.flot.resize.js') }}"></script>
|
||||
<script src="{{ url('public/theme_assets/vendor/jquery-flot/jquery.flot.pie.js') }}"></script>
|
||||
<script src="{{ url('public/theme_assets/vendor/flot.curvedlines/curvedLines.js') }}"></script>
|
||||
<script src="{{ url('public/theme_assets/vendor/jquery.flot.spline/index.js') }}"></script>
|
||||
|
||||
<script src="{{ url('public/js/merchant_landing.js') }}"></script>
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
/**
|
||||
* Flot charts data and options
|
||||
*/
|
||||
/*
|
||||
var data1 = [ [0, 55], [1, 48], [2, 40], [3, 36], [4, 40], [5, 60], [6, 50], [7, 51] ];
|
||||
|
||||
var chartUsersOptions = {
|
||||
series: {
|
||||
splines: {
|
||||
show: true,
|
||||
tension: 0.4,
|
||||
lineWidth: 1,
|
||||
fill: 0.4
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
tickColor: "#f0f0f0",
|
||||
borderWidth: 1,
|
||||
borderColor: 'f0f0f0',
|
||||
color: '#6a6c6f'
|
||||
},
|
||||
colors: [ "#62cb31", "#efefef"],
|
||||
};
|
||||
|
||||
$.plot($("#flot-line-chart"), [data1], chartUsersOptions);
|
||||
*/
|
||||
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
153
resources/views/merchants/refund.blade.php
Normal file
153
resources/views/merchants/refund.blade.php
Normal file
@@ -0,0 +1,153 @@
|
||||
@extends('merch_layouts.merch_master')
|
||||
@section('page-title')
|
||||
Merchant | Refunds
|
||||
@endsection
|
||||
@section('page-content')
|
||||
<div class="row">
|
||||
<div class="col-md-5">
|
||||
<div class="hpanel hblue">
|
||||
<div class="panel-heading hbuilt">Dealer Refund 44</div>
|
||||
<div class="panel-body">
|
||||
<!-- -->
|
||||
<form action="{{ url('merchant/pushrefunds') }}" method="POST" class="form-horizontal" id="dealerRefundForm">
|
||||
{{csrf_field()}}
|
||||
<input type="hidden" id="merchantId" name="merchant_id" value="{!! $merchant->id !!}">
|
||||
<div class="col-md-12" style="padding-bottom: 10px;">
|
||||
@include('commons.notifications')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label" for="dealerID">Select Dealer</label>
|
||||
<div class="col-md-7">
|
||||
<select required class="form-control" name="dealer_id" id="dealerID" placeholder="Merchant" >
|
||||
<option>-- Select Account --</option>
|
||||
<?php foreach ($dealers_arr as $row): ?>
|
||||
<option value="{{ $row->id }}">{{ $row->name }} ({{ $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</label>
|
||||
<div class="col-md-7">
|
||||
<input type="number" name="amount" class="form-control" id="amount" placeholder="Refund Amount" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">Transaction ID</label>
|
||||
<div class="col-md-7">
|
||||
<input type="number" name="transaction_id" class="form-control" id="transactionId" placeholder="Reference Transaction ID" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">Reason</label>
|
||||
<div class="col-md-7">
|
||||
<input type="text" name="reason" class="form-control" id="reason" placeholder="Brief text as Reason" 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="refundFormBtn" type="submit"><i class="fa fa-money"></i> Refund Dealer</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<div class="hpanel hblue">
|
||||
<div class="panel-heading hbuilt">Recent Dealer Refunds</div>
|
||||
<div class="panel-body">
|
||||
<div class="table-responsive">
|
||||
<table cellpadding="1" cellspacing="1" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Dealer Name</th>
|
||||
<th>Dealer Phone</th>
|
||||
<th>Refund Amount</th>
|
||||
<th>Transaction ID</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($recent_refunds as $row)
|
||||
<tr>
|
||||
<td>{{ $row->orgInfo->name }}</td>
|
||||
<td>{{ $row->orgInfo->phone }}</td>
|
||||
<td>{{ $row->amount }}</td>
|
||||
<td>{{ $row->transaction_id ?? 'N/A' }}</td>
|
||||
<td>{{ $row->created_at }}</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="4">No Data</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{ $recent_refunds->links() }}
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
Page : {{ $recent_refunds->currentPage() }} of {{ $recent_refunds->lastPage() }} |
|
||||
Total Records : <span id="totalRecords">{{ $recent_refunds->total() }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@endsection
|
||||
@section('page-js')
|
||||
<script>
|
||||
|
||||
$(document).ready(function(){
|
||||
console.log('foo');
|
||||
$('#dealerID').select2({
|
||||
// tags : true
|
||||
});
|
||||
$('#dealerRefundFormZZZ').on('submit', function(evt) {
|
||||
evt.preventDefault();
|
||||
$('#successArea').addClass('hidden');
|
||||
$('#errorArea').addClass('hidden');
|
||||
var merchID = $('#merchantId').val();
|
||||
var dealerID = $('#dealerID').val();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: base_url + '/merchant/lukers',
|
||||
// data: formdata, //a $(this).serialize(),
|
||||
data: { merchant_id: merchID, dealer_id: dealerID, amount: $('#amount').val(), reason : $('#reason').val() },
|
||||
headers: { "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content") },
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
if (response.status == 'failed') {
|
||||
$('#errorArea').removeClass('hidden');
|
||||
$('#errorArea').html(response.message);
|
||||
}
|
||||
else{
|
||||
$('#successArea').removeClass('hidden');
|
||||
$('#successArea').html(response.message);
|
||||
setTimeout(function() {
|
||||
location.reload();
|
||||
}, 3000);
|
||||
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
$('#errorArea').removeClass('hidden');
|
||||
// $('#errorArea').html(response.message);
|
||||
xhr.responseJSON.errors.forEach(function(value, index) {
|
||||
console.log(index + ': ' + value);
|
||||
$('#errorArea').html(index + ': ' + value);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
153
resources/views/merchants/refund_backup29-06-2026.blade.php
Normal file
153
resources/views/merchants/refund_backup29-06-2026.blade.php
Normal file
@@ -0,0 +1,153 @@
|
||||
@extends('merch_layouts.merch_master')
|
||||
@section('page-title')
|
||||
Merchant | Refunds
|
||||
@endsection
|
||||
@section('page-content')
|
||||
<div class="row">
|
||||
<div class="col-md-5">
|
||||
<div class="hpanel hblue">
|
||||
<div class="panel-heading hbuilt">Dealer Refund 44</div>
|
||||
<div class="panel-body">
|
||||
<!-- -->
|
||||
<form action="{{ url('merchant/pushrefunds') }}" method="POST" class="form-horizontal" id="dealerRefundForm">
|
||||
{{csrf_field()}}
|
||||
<input type="hidden" id="merchantId" name="merchant_id" value="{!! $merchant->id !!}">
|
||||
<div class="col-md-12" style="padding-bottom: 10px;">
|
||||
@include('commons.notifications')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label" for="dealerID">Select Dealer</label>
|
||||
<div class="col-md-7">
|
||||
<select required class="form-control" name="dealer_id" id="dealerID" placeholder="Merchant" >
|
||||
<option>-- Select Account --</option>
|
||||
<?php foreach ($dealers_arr as $row): ?>
|
||||
<option value="{{ $row->id }}">{{ $row->name }} ({{ $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</label>
|
||||
<div class="col-md-7">
|
||||
<input type="number" name="amount" class="form-control" id="amount" placeholder="Refund Amount" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">Transaction ID</label>
|
||||
<div class="col-md-7">
|
||||
<input type="number" name="transaction_id" class="form-control" id="transactionId" placeholder="Reference Transaction ID" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">Reason</label>
|
||||
<div class="col-md-7">
|
||||
<input type="text" name="reason" class="form-control" id="reason" placeholder="Brief text as Reason" 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="refundFormBtn" type="submit"><i class="fa fa-money"></i> Refund Dealer</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<div class="hpanel hblue">
|
||||
<div class="panel-heading hbuilt">Recent Dealer Refunds</div>
|
||||
<div class="panel-body">
|
||||
<div class="table-responsive">
|
||||
<table cellpadding="1" cellspacing="1" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Dealer Name</th>
|
||||
<th>Dealer Phone</th>
|
||||
<th>Refund Amount</th>
|
||||
<th>Transaction ID</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($recent_refunds as $row)
|
||||
<tr>
|
||||
<td>{{ $row->orgInfo->name }}</td>
|
||||
<td>{{ $row->orgInfo->phone }}</td>
|
||||
<td>{{ $row->amount }}</td>
|
||||
<td>{{ $row->transaction_id or 'N/A' }}</td>
|
||||
<td>{{ $row->created_at }}</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="4">No Data</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{ $recent_refunds->links() }}
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
Page : {{ $recent_refunds->currentPage() }} of {{ $recent_refunds->lastPage() }} |
|
||||
Total Records : <span id="totalRecords">{{ $recent_refunds->total() }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@endsection
|
||||
@section('page-js')
|
||||
<script>
|
||||
|
||||
$(document).ready(function(){
|
||||
console.log('foo');
|
||||
$('#dealerID').select2({
|
||||
// tags : true
|
||||
});
|
||||
$('#dealerRefundFormZZZ').on('submit', function(evt) {
|
||||
evt.preventDefault();
|
||||
$('#successArea').addClass('hidden');
|
||||
$('#errorArea').addClass('hidden');
|
||||
var merchID = $('#merchantId').val();
|
||||
var dealerID = $('#dealerID').val();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: base_url + '/merchant/lukers',
|
||||
// data: formdata, //a $(this).serialize(),
|
||||
data: { merchant_id: merchID, dealer_id: dealerID, amount: $('#amount').val(), reason : $('#reason').val() },
|
||||
headers: { "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content") },
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
if (response.status == 'failed') {
|
||||
$('#errorArea').removeClass('hidden');
|
||||
$('#errorArea').html(response.message);
|
||||
}
|
||||
else{
|
||||
$('#successArea').removeClass('hidden');
|
||||
$('#successArea').html(response.message);
|
||||
setTimeout(function() {
|
||||
location.reload();
|
||||
}, 3000);
|
||||
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
$('#errorArea').removeClass('hidden');
|
||||
// $('#errorArea').html(response.message);
|
||||
xhr.responseJSON.errors.forEach(function(value, index) {
|
||||
console.log(index + ': ' + value);
|
||||
$('#errorArea').html(index + ': ' + value);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
143
resources/views/merchants/refunds_old.blade.php
Normal file
143
resources/views/merchants/refunds_old.blade.php
Normal file
@@ -0,0 +1,143 @@
|
||||
@extends('merch_layouts.merch_master')
|
||||
@section('page-title')
|
||||
Merchant | Refunds
|
||||
@endsection
|
||||
@section('page-js')
|
||||
@endsection
|
||||
@section('page-content')
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="hpanel hblue">
|
||||
<div class="panel-heading hbuilt">Dealer Refund</div>
|
||||
<div class="panel-body">
|
||||
<!-- -->
|
||||
<form action="{{ route('pushrefunds') }}" method="POST" class="form-horizontal" id="dealerRefundForm">
|
||||
{{csrf_field()}}
|
||||
<input type="hidden" id="merchantId" name="merchant_id" value="{!! $merchant->id !!}">
|
||||
<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 Dealer</label>
|
||||
<div class="col-md-7">
|
||||
<select required class="form-control" name="dealer_id" id="dealerID" placeholder="Merchant" >
|
||||
<option>-- Select Account --</option>
|
||||
<?php foreach ($dealers_arr as $row): ?>
|
||||
<option value="{{ $row->id }}">{{ $row->name }} ({{ $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</label>
|
||||
<div class="col-md-7">
|
||||
<input type="number" name="amount" class="form-control" id="amount" placeholder="Refund Amount" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">Reason</label>
|
||||
<div class="col-md-7">
|
||||
<input type="text" name="reason" class="form-control" id="reason" placeholder="Brief text as Reason" 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="refundFormBtn" type="submit"><i class="fa fa-money"></i> Top Up Merchant</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="hpanel hblue">
|
||||
<div class="panel-heading hbuilt">Recent Dealer Refunds</div>
|
||||
<div class="panel-body">
|
||||
<div class="table-responsive">
|
||||
<table cellpadding="1" cellspacing="1" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Dealer Name</th>
|
||||
<th>Dealer Phone</th>
|
||||
<th>Refund Amount</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($recent_refunds as $row)
|
||||
<tr>
|
||||
<td>{{ $row->orgUserInfo->name }}</td>
|
||||
<td>{{ $row->orgUserInfo->phone }}</td>
|
||||
<td>{{ $row->amount }}</td>
|
||||
<td>{{ $row->created_at }}</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="4">No Data</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{ $recent_refunds->links() }}
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
Page : {{ $recent_refunds->currentPage() }} of {{ $recent_refunds->lastPage() }} |
|
||||
Total Records : <span id="totalRecords">{{ $recent_refunds->total() }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
@section('page-js')
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
console.log('foo');
|
||||
alert('foo');
|
||||
$('#dealerID').select2({
|
||||
// tags : true
|
||||
});
|
||||
$('#dealerRefundFormZZZ').on('submit', function(evt) {
|
||||
evt.preventDefault();
|
||||
$('#successArea').addClass('hidden');
|
||||
$('#errorArea').addClass('hidden');
|
||||
var merchID = $('#merchantId').val();
|
||||
var dealerID = $('#dealerID').val();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: base_url + '/merchant/lukers',
|
||||
// data: formdata, //a $(this).serialize(),
|
||||
data: { merchant_id: merchID, dealer_id: dealerID, amount: $('#amount').val(), reason : $('#reason').val() },
|
||||
headers: { "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content") },
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
if (response.status == 'failed') {
|
||||
$('#errorArea').removeClass('hidden');
|
||||
$('#errorArea').html(response.message);
|
||||
}
|
||||
else{
|
||||
$('#successArea').removeClass('hidden');
|
||||
$('#successArea').html(response.message);
|
||||
setTimeout(function() {
|
||||
location.reload();
|
||||
}, 3000);
|
||||
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
$('#errorArea').removeClass('hidden');
|
||||
// $('#errorArea').html(response.message);
|
||||
xhr.responseJSON.errors.forEach(function(value, index) {
|
||||
console.log(index + ': ' + value);
|
||||
$('#errorArea').html(index + ': ' + value);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
0
resources/views/merchants/show.blade.php
Normal file
0
resources/views/merchants/show.blade.php
Normal file
53
resources/views/merchants/showchangepin.blade.php
Normal file
53
resources/views/merchants/showchangepin.blade.php
Normal file
@@ -0,0 +1,53 @@
|
||||
@extends('merch_layouts.merch_master')
|
||||
@section('page-title')
|
||||
Merchant | Refunds
|
||||
@endsection
|
||||
@section('page-content')
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="hpanel hblue">
|
||||
<div class="panel-heading hbuilt">Dealer Refund</div>
|
||||
<div class="panel-body">
|
||||
<!-- -->
|
||||
<form action="{{ url('merchant/change-pin') }}" method="POST" class="form-horizontal" id="changePinForm">
|
||||
{{ csrf_field() }}
|
||||
<input type="hidden" name="merchant_id" value="{{ $merchant->id }}">
|
||||
<div class="col-md-12" style="padding-bottom: 10px;">
|
||||
@include('commons.notifications')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">Current PIN</label>
|
||||
<div class="col-md-7">
|
||||
<input type="password" class="form-control" name="current_pin" placeholder="Current PIN" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">New PIN</label>
|
||||
<div class="col-md-7">
|
||||
<input type="password" class="form-control" name="new_pin" placeholder="New PIN" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-12">
|
||||
<button class="btn btn-warning btn-block" type="submit"><i class="fa fa-save"></i> Change PIN</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@endsection
|
||||
@section('page-js')
|
||||
<script src="{{ url('public/js/merchant_landing.js') }}"></script>
|
||||
<script>
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
56
resources/views/merchants/transactions.blade copy.php
Normal file
56
resources/views/merchants/transactions.blade copy.php
Normal file
@@ -0,0 +1,56 @@
|
||||
@extends('merch_layouts.merch_master')
|
||||
@section('page-title')
|
||||
Merchant | Transactions
|
||||
@endsection
|
||||
@section('page-content')
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="hpanel hblue">
|
||||
<div class="panel-heading hbuilt">Sales from <strong><span class="text-success">{{ $merchant->fullname }}</span></strong> to Customers</div>
|
||||
<div class="panel-body">
|
||||
<div class="table-responsive">
|
||||
<table cellpadding="1" cellspacing="1" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Recipient Phone</th>
|
||||
<th>Amount</th>
|
||||
<th>Status</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($transactions as $row)
|
||||
<tr>
|
||||
<td>{{ $row->msisdn }}</td>
|
||||
<td>{{ number_format($row->amount) }}</td>
|
||||
<td>{{ $row->status }}</td>
|
||||
<td>{{ $row->created_at }}</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="4">No Data</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{ $transactions->links() }}
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
Page : {{ $transactions->currentPage() }} of {{ $transactions->lastPage() }} |
|
||||
Total Records : <span id="totalRecords">{{ $transactions->total() }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@endsection
|
||||
@section('page-js')
|
||||
|
||||
|
||||
@endsection
|
||||
134
resources/views/merchants/transactions.blade.php
Normal file
134
resources/views/merchants/transactions.blade.php
Normal file
@@ -0,0 +1,134 @@
|
||||
@extends('merch_layouts.merch_master')
|
||||
@section('page-title')
|
||||
Merchant | 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 <strong><span class="text-success">{{ $merchant->fullname }}</span></strong> to Customers</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('merchant/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",
|
||||
// },
|
||||
{
|
||||
title: "Merchant Phone",
|
||||
field: "msisdn",
|
||||
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
|
||||
Reference in New Issue
Block a user