Initial commit
This commit is contained in:
147
resources/views/super_admin/admin-transactions.blade.php
Normal file
147
resources/views/super_admin/admin-transactions.blade.php
Normal file
@@ -0,0 +1,147 @@
|
||||
@extends('layouts.admin_master')
|
||||
@section('page-title')
|
||||
Admin | Dashboard
|
||||
@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">
|
||||
<div class="panel-heading">Sales from Super Admin to Dealers</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<div class="" id="adminTransactions"></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
@section('page-js')
|
||||
<!-- <script type="text/javascript" src="https://unpkg.com/tabulator-tables@6.4.0/dist/js/tabulator.min.js"></script> -->
|
||||
<script type="text/javascript" src="{!! url('public/vendor/tabulator-master/dist/js/tabulator.min.js') !!}"></script>
|
||||
<script type="text/javascript" src="{!! url('public/vendor/tabulator-master/dist/js/xlsx.full.min.js') !!}"></script>
|
||||
<script type="text/javascript" src="{!! url('public/vendor/tabulator-master/dist/js/jspdf.min.js') !!}"></script>
|
||||
<script type="text/javascript" src="{!! url('public/vendor/tabulator-master/dist/js/jspdf.plugin.autotable.js') !!}"></script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
function link(cell, formatterParams){
|
||||
var url = cell.getValue();
|
||||
var rowID = cell.getData().id
|
||||
return "<a href='"+ base_url + "/senderids/"+rowID+"/edit' class='btn btn-link'>"+url+"</a>";
|
||||
}
|
||||
function cellDesign (cell, formatterParams){
|
||||
var value = cell.getValue();
|
||||
return "<span style='color:#54B4D3; font-weight:bold;'>" + value + "</span>";
|
||||
}
|
||||
function statusDesign (cell, formatterParams){
|
||||
var value = cell.getValue();
|
||||
if (value !== null) {
|
||||
if(value.includes('Approved')){
|
||||
return "<span style='color:#3FB449; font-weight:bold;'>" + value + "</span>";
|
||||
}
|
||||
else if(value.includes('Active')){
|
||||
return "<span style='color:#3FB449; font-weight:bold;'>" + value + "</span>";
|
||||
}
|
||||
else{
|
||||
return "<span style='color:#E4A11B;'>" + value + "</span>";
|
||||
}
|
||||
}
|
||||
}
|
||||
var table = new Tabulator("#adminTransactions", {
|
||||
ajaxURL: "admin-dealer-transactions",
|
||||
paginationSize: 15,
|
||||
layout: "fitColumns",
|
||||
|
||||
// --- FIX 1: Correct Pagination Syntax ---
|
||||
pagination: true,
|
||||
paginationMode: "remote",
|
||||
// ----------------------------------------
|
||||
|
||||
filterMode: "remote",
|
||||
selectable: false,
|
||||
printAsHtml: true,
|
||||
ajaxLoaderLoading: $('#logo_spinner').html(),
|
||||
|
||||
ajaxResponse: function(url, params, response) {
|
||||
if (response.data) {
|
||||
return {
|
||||
"data": response.data,
|
||||
"last_page": response.last_page
|
||||
};
|
||||
}
|
||||
return response;
|
||||
},
|
||||
|
||||
columns: [
|
||||
{
|
||||
title: "Dealer Name",
|
||||
field: "dealer_name",
|
||||
sorter: "string",
|
||||
headerFilter:"input",
|
||||
},
|
||||
{
|
||||
title: "Top Up Amount",
|
||||
field: "amount",
|
||||
formatter: "money",
|
||||
formatterParams: {
|
||||
decimal: ".", // Decimal separator
|
||||
thousand: ",", // Thousands separator
|
||||
// symbol: "$", // Currency symbol
|
||||
symbolAfter: false, // Position symbol before number
|
||||
precision: 2, // Number of decimal places
|
||||
},
|
||||
sorter: "string",
|
||||
headerFilter:"input"
|
||||
},
|
||||
{
|
||||
title: "Balance Before",
|
||||
field: "current_balance",
|
||||
formatter: "money",
|
||||
sorter: "string",
|
||||
headerFilter:"input",
|
||||
},
|
||||
{
|
||||
title: "Current Balance",
|
||||
field: "balance",
|
||||
formatter: "money",
|
||||
sorter: "string",
|
||||
headerFilter:"input",
|
||||
},
|
||||
{
|
||||
title: "Admin Name",
|
||||
field: "admin_name",
|
||||
sorter: "string",
|
||||
headerFilter:"input",
|
||||
},
|
||||
{
|
||||
title: "Status",
|
||||
field: "status",
|
||||
sorter: "string",
|
||||
headerFilter:"input",
|
||||
formatter: statusDesign,
|
||||
},
|
||||
{
|
||||
title: "Date & Time",
|
||||
field: "created_at",
|
||||
sorter: "string",
|
||||
headerFilter:"input",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
$('#keywordField').on('keyup', function(){
|
||||
var keyword = $(this).val();
|
||||
table.setData("admin-dealer-transactions?keyword=" + keyword);
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
79
resources/views/super_admin/create-org.blade copy.php
Normal file
79
resources/views/super_admin/create-org.blade copy.php
Normal file
@@ -0,0 +1,79 @@
|
||||
@extends('layouts.admin_master')
|
||||
@section('page-title')
|
||||
Admin | {{ $page_title }}
|
||||
@endsection
|
||||
|
||||
@section('page-css')
|
||||
@endsection
|
||||
@section('page-content')
|
||||
<div class="row">
|
||||
<form action="{{ url('admin/organisation/store') }}" method="POST" >
|
||||
{{csrf_field()}}
|
||||
<div class="col-md-12">
|
||||
@include('commons.notifications')
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="hpanel">
|
||||
<div class="panel-heading">Main Organisation</div>
|
||||
<div class="panel-body">
|
||||
<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="name" placeholder="Full Name of Organisation (Dealer) " required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group"><label class="col-sm-2 control-label">Email</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="email" name="email" class="form-control" id="email" placeholder="Organisation's Email" 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" class="form-control" id="phone" placeholder="Organisation's Phone " required >
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="hpanel">
|
||||
<div class="panel-heading">Organisation User Account</div>
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">Username</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" name="user_name" placeholder="Full Name" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group"><label class="col-sm-2 control-label">Email</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="email" name="user_email" class="form-control" id="userEmail" placeholder="Enter User Email" 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="user_phone" class="form-control" id="userPhone" placeholder="Enter User Phone number " required >
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="com-md-12">
|
||||
<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>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
153
resources/views/super_admin/create-org.blade.php
Normal file
153
resources/views/super_admin/create-org.blade.php
Normal file
@@ -0,0 +1,153 @@
|
||||
@extends('layouts.admin_master')
|
||||
@section('page-title')
|
||||
Admin | {{ $page_title }}
|
||||
@endsection
|
||||
|
||||
@section('page-css')
|
||||
@endsection
|
||||
|
||||
@section('page-content')
|
||||
<div class="row">
|
||||
<form action="{{ url('admin/organisation/store') }}" method="POST">
|
||||
{{ csrf_field() }}
|
||||
<div class="col-md-12">
|
||||
@include('commons.notifications')
|
||||
</div>
|
||||
|
||||
<div class="col-md-10">
|
||||
<div class="hpanel">
|
||||
<div class="panel-heading">Organisation User Account</div>
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">Username</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" name="user_name" placeholder="Full Name" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">Email</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="email" name="user_email" class="form-control" id="userEmail" placeholder="Enter User Email" 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="user_phone" class="form-control" id="userPhone" placeholder="Enter User Phone number" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
|
||||
<!-- African Countries Select Field -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">Country</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="country" id="countrySelect" class="form-control" required>
|
||||
<option value="">-- Select Country --</option>
|
||||
<option value="Algeria" data-currency="DZD">Algeria (DZD)</option>
|
||||
<option value="Angola" data-currency="AOA">Angola (AOA)</option>
|
||||
<option value="Benin" data-currency="XOF">Benin (XOF)</option>
|
||||
<option value="Botswana" data-currency="BWP">Botswana (BWP)</option>
|
||||
<option value="Burkina Faso" data-currency="XOF">Burkina Faso (XOF)</option>
|
||||
<option value="Burundi" data-currency="BIF">Burundi (BIF)</option>
|
||||
<option value="Cameroon" data-currency="XAF">Cameroon (XAF)</option>
|
||||
<option value="Cape Verde" data-currency="CVE">Cape Verde (CVE)</option>
|
||||
<option value="Central African Republic" data-currency="XAF">Central African Republic (XAF)</option>
|
||||
<option value="Chad" data-currency="XAF">Chad (XAF)</option>
|
||||
<option value="Comoros" data-currency="KMF">Comoros (KMF)</option>
|
||||
<option value="Congo" data-currency="XAF">Congo (XAF)</option>
|
||||
<option value="Djibouti" data-currency="DJF">Djibouti (DJF)</option>
|
||||
<option value="Egypt" data-currency="EGP">Egypt (EGP)</option>
|
||||
<option value="Equatorial Guinea" data-currency="XAF">Equatorial Guinea (XAF)</option>
|
||||
<option value="Eritrea" data-currency="ERN">Eritrea (ERN)</option>
|
||||
<option value="Eswatini" data-currency="SZL">Eswatini (SZL)</option>
|
||||
<option value="Ethiopia" data-currency="ETB">Ethiopia (ETB)</option>
|
||||
<option value="Gabon" data-currency="XAF">Gabon (XAF)</option>
|
||||
<option value="Gambia" data-currency="GMD">Gambia (GMD)</option>
|
||||
<option value="Ghana" data-currency="GHS">Ghana (GHS)</option>
|
||||
<option value="Guinea" data-currency="GNF">Guinea (GNF)</option>
|
||||
<option value="Guinea-Bissau" data-currency="XOF">Guinea-Bissau (XOF)</option>
|
||||
<option value="Ivory Coast" data-currency="XOF">Ivory Coast (XOF)</option>
|
||||
<option value="Kenya" data-currency="KES">Kenya (KES)</option>
|
||||
<option value="Lesotho" data-currency="LSL">Lesotho (LSL)</option>
|
||||
<option value="Liberia" data-currency="LRD">Liberia (LRD)</option>
|
||||
<option value="Libya" data-currency="LYD">Libya (LYD)</option>
|
||||
<option value="Madagascar" data-currency="MGA">Madagascar (MGA)</option>
|
||||
<option value="Malawi" data-currency="MWK">Malawi (MWK)</option>
|
||||
<option value="Mali" data-currency="XOF">Mali (XOF)</option>
|
||||
<option value="Mauritania" data-currency="MRU">Mauritania (MRU)</option>
|
||||
<option value="Mauritius" data-currency="MUR">Mauritius (MUR)</option>
|
||||
<option value="Morocco" data-currency="MAD">Morocco (MAD)</option>
|
||||
<option value="Mozambique" data-currency="MZN">Mozambique (MZN)</option>
|
||||
<option value="Namibia" data-currency="NAD">Namibia (NAD)</option>
|
||||
<option value="Niger" data-currency="XOF">Niger (XOF)</option>
|
||||
<option value="Nigeria" data-currency="NGN">Nigeria (NGN)</option>
|
||||
<option value="Rwanda" data-currency="RWF">Rwanda (RWF)</option>
|
||||
<option value="Sao Tome and Principe" data-currency="STN">Sao Tome and Principe (STN)</option>
|
||||
<option value="Senegal" data-currency="XOF">Senegal (XOF)</option>
|
||||
<option value="Seychelles" data-currency="SCR">Seychelles (SCR)</option>
|
||||
<option value="Sierra Leone" data-currency="SLE">Sierra Leone (SLE)</option>
|
||||
<option value="Somalia" data-currency="SOS">Somalia (SOS)</option>
|
||||
<option value="South Africa" data-currency="ZAR">South Africa (ZAR)</option>
|
||||
<option value="South Sudan" data-currency="SSP">South Sudan (SSP)</option>
|
||||
<option value="Sudan" data-currency="SDG">Sudan (SDG)</option>
|
||||
<option value="Tanzania" data-currency="TZS">Tanzania (TZS)</option>
|
||||
<option value="Togo" data-currency="XOF">Togo (XOF)</option>
|
||||
<option value="Tunisia" data-currency="TND">Tunisia (TND)</option>
|
||||
<option value="Uganda" data-currency="UGX">Uganda (UGX)</option>
|
||||
<option value="Zambia" data-currency="ZMW">Zambia (ZMW)</option>
|
||||
<option value="Zimbabwe" data-currency="ZWL">Zimbabwe (ZWL)</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
|
||||
<!-- Currency Field -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">Currency</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="currency" id="currencyInput" class="form-control" readonly required placeholder="Auto-populated currency">
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-10">
|
||||
<div class="form-group">
|
||||
<div class="col-sm-10">
|
||||
<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>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('page-js')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Function to update currency based on selected option's data attribute
|
||||
function updateCurrency() {
|
||||
var selectedOption = $('#countrySelect').find(':selected');
|
||||
var currencyCode = selectedOption.data('currency') || '';
|
||||
$('#currencyInput').val(currencyCode);
|
||||
}
|
||||
|
||||
// Run on page load in case a default is pre-selected
|
||||
updateCurrency();
|
||||
|
||||
// Run whenever the country dropdown changes
|
||||
$('#countrySelect').on('change', function() {
|
||||
updateCurrency();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
81
resources/views/super_admin/create.blade.php
Executable file
81
resources/views/super_admin/create.blade.php
Executable file
@@ -0,0 +1,81 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('page-title')
|
||||
Admin | Create User
|
||||
@endsection
|
||||
|
||||
@section('page-css')
|
||||
|
||||
<!-- Datatables css -->
|
||||
<link href="{{url('public/assets/css/vendor/buttons.bootstrap4.css')}}" rel="stylesheet" type="text/css" />
|
||||
|
||||
@endsection
|
||||
|
||||
@section('page-content')
|
||||
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="{{url('/')}}">Admin</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{url('admin/users')}}">Users</a></li>
|
||||
<li class="breadcrumb-item active">Add User</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title">Add User</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
{{-- Alert --}}
|
||||
@include('layouts.alert')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="header-title">Add User</h4>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane show active" id="form-row-preview">
|
||||
<form action="{{url('admin/users')}}" method="POST" >
|
||||
{{csrf_field()}}
|
||||
<div class="form-group">
|
||||
<label for="inputEmail4" class="col-form-label">Full Name</label>
|
||||
<input required type="text" class="form-control" name="name" placeholder="Full Name">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="email" class="col-form-label">Email</label>
|
||||
<input type="email" name="email" class="form-control" id="email" placeholder="Email" >
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password" class="col-form-label">Password</label>
|
||||
<input type="password" name="password" class="form-control" id="password" placeholder="Password" >
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="ConfirmPassword" class="col-form-label">Confirm Password</label>
|
||||
<input type="password" name="password_confirmation" class="form-control" id="ConfirmPassword" placeholder="Confirm Password" >
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Create </button>
|
||||
<button type="reset" class="btn btn-danger">Cancel</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<!-- end preview-->
|
||||
|
||||
|
||||
</div>
|
||||
<!-- end tab-content-->
|
||||
|
||||
</div>
|
||||
<!-- end card-body -->
|
||||
</div>
|
||||
<!-- end card-->
|
||||
</div>
|
||||
<!-- end col -->
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
57
resources/views/super_admin/dealer_sales.blade.php
Normal file
57
resources/views/super_admin/dealer_sales.blade.php
Normal file
@@ -0,0 +1,57 @@
|
||||
@extends('layouts.admin_master')
|
||||
@section('page-title')
|
||||
Admin | Dashboard
|
||||
@endsection
|
||||
@section('page-content')
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="hpanel">
|
||||
<div class="panel-heading">Sales from Dealers to Merchants</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>Merchant (Recipient) </th>
|
||||
<th>Amount</th>
|
||||
<th>Status</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($dealer_sales as $row)
|
||||
<tr>
|
||||
<td>{{ $row->orgInfo->name }}</td>
|
||||
<td>{{ $row->merchantInfo->fullname }}</td>
|
||||
<td>{{ number_format($row->amount) }}</td>
|
||||
<td>{{ $row->status }}</td>
|
||||
<td>{{ $row->created_at }}</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="">No Data</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{ $dealer_sales->links() }}
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
Page : {{ $dealer_sales->currentPage() }} of {{ $dealer_sales->lastPage() }} |
|
||||
Total Records : <span id="totalRecords">{{ $dealer_sales->total() }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@endsection
|
||||
@section('page-js')
|
||||
|
||||
|
||||
@endsection
|
||||
104
resources/views/super_admin/index.blade.php
Executable file
104
resources/views/super_admin/index.blade.php
Executable file
@@ -0,0 +1,104 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('page-title')
|
||||
Admin | All Admin Users
|
||||
@endsection
|
||||
|
||||
|
||||
@section('page-content')
|
||||
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="{{url('/')}}">Admin</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{url('admin/users')}}">Users</a></li>
|
||||
<li class="breadcrumb-item active">All Users</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title">Users</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
{{-- Alert --}}
|
||||
@include('layouts.alert')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-4">
|
||||
<a href="{{url('admin/users/create')}}" class="btn btn-success mb-2"><i class="mdi mdi-plus-circle mr-2"></i> Add User</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-centered table-borderless table-hover w-100 dt-responsive nowrap" id="products-datatable">
|
||||
<thead class="thead-light">
|
||||
<tr style="color: #000; background-color: #0008ff !important;" class="">
|
||||
<th>Name</th>
|
||||
<th>Email</th>
|
||||
<th>Status</th>
|
||||
<th>Date Created</th>
|
||||
<th >Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@forelse ($users as $user)
|
||||
<tr class="bg-<?php echo ($user->status == 'disabled') ? 'danger' : ''; ?>" style="color: #000;">
|
||||
|
||||
<td class="table-user">
|
||||
<a href="javascript:void(0);" class="text-bodys font-weight-semibold" style="color: #000;">{{ $user->name }}</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<span class="font-weight-semibold">{{ $user->email }}</span>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<span class="font-weight-semibold">{{ ucfirst($user->status) }}</span>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{{ Carbon\Carbon::parse($user->created_at)->format('F d, Y') }}
|
||||
</td>
|
||||
<td>
|
||||
@if ($user->id == Auth::user()->id)
|
||||
<a href="{{url('admin/users/'.$user->id.'/edit')}}" class="action-icon"> <i class="mdi mdi-square-edit-outline"></i></a>
|
||||
@endif
|
||||
@if ($user->status == 'Active')
|
||||
<a onclick="return confirm('Are you sue you want to disable {{ $user->name }}')" href="{{url('admin/users/disable/'.$user->id)}}" class="action-icon"> <i class="mdi mdi-delete"></i></a>
|
||||
@endif
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
@empty
|
||||
<td colspan="5">No Data</td>
|
||||
|
||||
@endforelse
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{{ $users->links() }}
|
||||
</div>
|
||||
</div> <!-- end card-body-->
|
||||
</div> <!-- end card-->
|
||||
</div> <!-- end col -->
|
||||
</div>
|
||||
<!-- end row -->
|
||||
|
||||
@endsection
|
||||
|
||||
|
||||
@section('page-js')
|
||||
|
||||
@endsection
|
||||
67
resources/views/super_admin/merchant_edit.blade.php
Normal file
67
resources/views/super_admin/merchant_edit.blade.php
Normal file
@@ -0,0 +1,67 @@
|
||||
@extends('layouts.admin_master')
|
||||
@section('page-title')
|
||||
Admin | {{ $page_title }}
|
||||
@endsection
|
||||
|
||||
@section('page-css')
|
||||
@endsection
|
||||
@section('page-content')
|
||||
<div class="row">
|
||||
<form action="{{ route('admin.merchant.update', ['id' => $merchant->id]) }}" method="POST">
|
||||
<input type="hidden" name="_method" value="PUT">
|
||||
<input type="hidden" name="id" value="{{ $merchant->id }}">
|
||||
{{ csrf_field() }}
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="hpanel">
|
||||
<div class="panel-heading">Merchant </div>
|
||||
<div class="panel-body">
|
||||
<div class="col-md-12">
|
||||
@include('commons.notifications')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="fulname">Fullname</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" name="fullname" value="{{ $merchant->fullname }}" id="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" for="phone">Phone</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="phone" class="form-control" value="{{ $merchant->phone }}" id="phone" placeholder="Merchant's Phone " required >
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="language">Language</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="language" id="language">
|
||||
<option value="active" @if($merchant->language == 'chichewa') {{ 'selected' }} @else {{ '' }} @endif>Chichewa</option>
|
||||
<option value="pending" @if($merchant->status == 'english') {{ 'selected' }} @else {{ '' }} @endif>English</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="status">Status</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="status" id="status">
|
||||
<option value="active" @if($merchant->status == 'active') {{ 'selected' }} @else {{ '' }} @endif>Active</option>
|
||||
<option value="pending" @if($merchant->status == 'pending') {{ 'selected' }} @else {{ '' }} @endif>Pending</option>
|
||||
<option value="inactive" @if($merchant->status == 'inactive') {{ 'selected' }} @else {{ '' }} @endif >Inactive</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-12" style="padding-top: 10px;">
|
||||
<button class="btn btn-success btn-block" type="submit">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
57
resources/views/super_admin/merchant_sales.blade.php
Normal file
57
resources/views/super_admin/merchant_sales.blade.php
Normal file
@@ -0,0 +1,57 @@
|
||||
@extends('layouts.admin_master')
|
||||
@section('page-title')
|
||||
Admin | Dashboard
|
||||
@endsection
|
||||
@section('page-content')
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="hpanel">
|
||||
<div class="panel-heading">Sales from Merchants to end users</div>
|
||||
<div class="panel-body">
|
||||
<div class="table-responsive">
|
||||
<table cellpadding="1" cellspacing="1" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Merchant Name</th>
|
||||
<th>Recipient Phone</th>
|
||||
<th>Amount</th>
|
||||
<th>Status</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($merchant_sales as $row)
|
||||
<tr>
|
||||
<td>{{ $row->merchant->fullname }}</td>
|
||||
<td>{{ $row->msisdn }}</td>
|
||||
<td>{{ number_format($row->amount) }}</td>
|
||||
<td>{{ $row->status }}</td>
|
||||
<td>{{ $row->created_at }}</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="5">No Data</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{ $merchant_sales->links() }}
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
Page : {{ $merchant_sales->currentPage() }} of {{ $merchant_sales->lastPage() }} |
|
||||
Total Records : <span id="totalRecords">{{ $merchant_sales->total() }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@endsection
|
||||
@section('page-js')
|
||||
|
||||
|
||||
@endsection
|
||||
73
resources/views/super_admin/merchants.blade.php
Normal file
73
resources/views/super_admin/merchants.blade.php
Normal file
@@ -0,0 +1,73 @@
|
||||
@extends('layouts.admin_master')
|
||||
@section('page-title')
|
||||
Admin | {{ $page_title }}
|
||||
@endsection
|
||||
@section('page-content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="hpanel">
|
||||
<div class="panel-heading">List of Merchants <br>
|
||||
<!-- <a class="btn btn-info btn-sm pull-right" href="{{ url('admin/merchants/create') }}"><i class="fa fa-plus-circle"></i> New Merchant</a> -->
|
||||
<div class="clearfix"></div>
|
||||
@include('commons.notifications')
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
|
||||
|
||||
<div class="table-responsive">
|
||||
<table cellpadding="1" cellspacing="1" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Balance (MWK)</th>
|
||||
<!-- <th>Email</th> -->
|
||||
<th>Phone</th>
|
||||
<th>Status</th>
|
||||
<th>Date Created</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($merchants as $row)
|
||||
<tr>
|
||||
<td>{{ $row->fullname }}</td>
|
||||
<td>{{ number_format($row->balance) }}</td>
|
||||
<td>@if($row->phone) {{ $row->phone }} @else {{ 'N/A' }} @endif</td>
|
||||
<td class="@if($row->status == 'active') {{ 'bg-success' }} @else {{ 'bg-danger' }} @endif">{{ ucfirst($row->status) }}</td>
|
||||
<td>{{ Carbon\Carbon::parse($row->created_at)->format('F d, Y') }}</td>
|
||||
<td>
|
||||
<input type="hidden" class='merchRowId' name="merchant_id" value="{{ $row->id }}">
|
||||
<input type="hidden" class='merchRowName' name="merch_name" value="{{ $row->name }}">
|
||||
<a class="btn btn-info btn-sm" title="Edit this entry" href="{{ url('admin/merchants/edit', $row->id) }}" ><i class="fa fa-pencil"></i></a>
|
||||
<!-- <button class="btn btn-success btn-sm merchTopUpBtn" title="Click to Top Up Balance" type="button"><i class="fa fa-plus"></i> <span class="bold"></span> Top Up</button> -->
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="8">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>
|
||||
$(document).ready(function() {
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
56
resources/views/super_admin/org_user_edit.blade.php
Normal file
56
resources/views/super_admin/org_user_edit.blade.php
Normal file
@@ -0,0 +1,56 @@
|
||||
@extends('layouts.admin_master')
|
||||
@section('page-title')
|
||||
Admin | {{ $page_title }}
|
||||
@endsection
|
||||
|
||||
@section('page-css')
|
||||
@endsection
|
||||
@section('page-content')
|
||||
<div class="row">
|
||||
<!-- <form action="{{ url('admin/organisation/store') }}" method="POST" > -->
|
||||
<form action="{{ route('admin.organisation.userupdate', $dealer->id) }}" method="POST">
|
||||
<!-- @csrf -->
|
||||
@method('PUT')
|
||||
{{ csrf_field() }}
|
||||
<div class="col-md-12">
|
||||
@include('commons.notifications')
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="hpanel">
|
||||
<div class="panel-heading">Dealer User Account</div>
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">Username</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" name="user_name" value="{{ $dealer->email }}" placeholder="Full Name" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group"><label class="col-sm-2 control-label">Email</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="email" name="user_email" class="form-control" value="{{ $dealer->email }}" id="userEmail" placeholder="Enter User Email" 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="user_phone" class="form-control" value="{{ $dealer->phone }}" id="userPhone" placeholder="Enter User Phone number " required >
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="com-md-12">
|
||||
<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>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
65
resources/views/super_admin/organisation_edit.blade.php
Normal file
65
resources/views/super_admin/organisation_edit.blade.php
Normal file
@@ -0,0 +1,65 @@
|
||||
@extends('layouts.admin_master')
|
||||
@section('page-title')
|
||||
Admin | {{ $page_title }}
|
||||
@endsection
|
||||
|
||||
@section('page-css')
|
||||
@endsection
|
||||
@section('page-content')
|
||||
<div class="row">
|
||||
<!-- <form action="{{ url('admin/organisation/store') }}" method="POST" > -->
|
||||
<form action="{{ route('admin.organisation.update', ['id' => $organisation->id]) }}" method="POST">
|
||||
<input type="hidden" name="_method" value="PUT">
|
||||
<input type="hidden" name="id" value="{{ $organisation->id }}">
|
||||
{{ csrf_field() }}
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="hpanel">
|
||||
<div class="panel-heading">Main Organisation (Dealer) </div>
|
||||
<div class="panel-body">
|
||||
<div class="col-md-12">
|
||||
@include('commons.notifications')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="fulname">Fullname</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" name="name" value="{{ $organisation->name }}" id="fullname" placeholder="Full Name of Organisation (Dealer)" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="email">Email</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="email" name="email" class="form-control" value="{{ $organisation->email }}" id="email" placeholder="Organisation's Email" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="phone">Phone</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="phone" class="form-control" value="{{ $organisation->phone }}" id="phone" placeholder="Organisation's Phone " required >
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="status">Status</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="status" id="status">
|
||||
<option value="active" @if($organisation->status == 'active') {{ 'selected' }} @else {{ '' }} @endif>Active</option>
|
||||
<option value="pending" @if($organisation->status == 'pending') {{ 'selected' }} @else {{ '' }} @endif>Pending</option>
|
||||
<option value="inactive" @if($organisation->status == 'inactive') {{ 'selected' }} @else {{ '' }} @endif >Inactive</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-12" style="padding-top: 10px;">
|
||||
<button class="btn btn-success btn-block" type="submit">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
137
resources/views/super_admin/organisations.blade.php
Normal file
137
resources/views/super_admin/organisations.blade.php
Normal file
@@ -0,0 +1,137 @@
|
||||
@extends('layouts.admin_master')
|
||||
@section('page-title')
|
||||
Admin | {{ $page_title }}
|
||||
@endsection
|
||||
@section('page-content')
|
||||
|
||||
<div class="row">
|
||||
@include('super_admin.partials.dealer_top_form')
|
||||
<div class="col-md-12">
|
||||
<div class="hpanel">
|
||||
<div class="panel-heading">List of Organisations (Dealers) <br>
|
||||
<a class="btn btn-info btn-sm pull-right" href="{{ url('admin/organisations/create') }}"><i class="fa fa-plus-circle"></i> New Dealer</a>
|
||||
<div class="clearfix"></div>
|
||||
@include('commons.notifications')
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
|
||||
|
||||
<div class="table-responsive">
|
||||
<table cellpadding="1" cellspacing="1" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Balance (MWK)</th>
|
||||
<th>Email</th>
|
||||
<th>Phone</th>
|
||||
<th>Status</th>
|
||||
<th>Date Created</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($organisations as $row)
|
||||
<tr>
|
||||
<td>{{ $row->name }}</td>
|
||||
<td>{{ number_format($row->balance) }}</td>
|
||||
<td>@if($row->email) {{ $row->email }} @else {{ 'N/A' }} @endif</td>
|
||||
<td>@if($row->phone) {{ $row->phone }} @else {{ 'N/A' }} @endif</td>
|
||||
<td class="@if($row->status == 'active') {{ 'bg-success' }} @else {{ 'bg-danger' }} @endif">{{ ucfirst($row->status) }}</td>
|
||||
<td>{{ Carbon\Carbon::parse($row->created_at)->format('F d, Y') }}</td>
|
||||
<td>
|
||||
<input type="hidden" class='orgRowId' name="org_id" value="{{ $row->id }}">
|
||||
<input type="hidden" class='orgRowName' name="org_name" value="{{ $row->name }}">
|
||||
<button class="btn btn-success btn-sm topUpBtn" title="Click to Top Up Balance" type="button"><i class="fa fa-plus"></i> <span class="bold">Top Up</span></button>
|
||||
<!-- <a class="btn btn-info btn-sm" title="View details" href="{{ url('admin/organisation/show', $row->id) }}" ><i class="fa fa-eye"></i></a> -->
|
||||
<a class="btn btn-info btn-sm" title="Edit this entry" href="{{ url('admin/organisation/edit', $row->id) }}" ><i class="fa fa-pencil"></i> <span class="bold">Edit</span></a>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="8">No Data</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{ $organisations->links() }}
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
Page : {{ $organisations->currentPage() }} of {{ $organisations->lastPage() }} |
|
||||
Total Records : <span id="totalRecords">{{ $organisations->total() }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
@section('page-js')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.topUpBtn').click(function() {
|
||||
var org_id = $(this).siblings('.orgRowId').val();
|
||||
var orgName = $(this).siblings('.orgRowName').val();
|
||||
console.log(org_id);
|
||||
$('#selectedOrgId').val(org_id);
|
||||
$('.titleHead').text('Top Up Balance for ' + orgName);
|
||||
$('#orgTopUpModal').modal('show');
|
||||
});
|
||||
|
||||
|
||||
$('#dealerTopForm').submit(function(evt){
|
||||
evt.preventDefault();
|
||||
var topUpAmount = $('#topUpAmount').val();
|
||||
var discountValue = $('#discount').val();
|
||||
var finalTopUpAmount = parseFloat(topUpAmount) + parseFloat((topUpAmount * discountValue)/100);
|
||||
$.confirm({
|
||||
title: 'Confirm Action',
|
||||
content: 'Final Top Up Amount is ' + finalTopUpAmount + '. Are you sure you want to proceed?',
|
||||
buttons: {
|
||||
confirm: function () {
|
||||
var formData = new FormData(this);
|
||||
$.ajax({
|
||||
url: base_url + '/admin/topups',
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
beforeSend: function() {
|
||||
$('#topupError').addClass('hidden');
|
||||
console.log('Sending data...');
|
||||
},
|
||||
success: function(data) {
|
||||
console.log('Success:', data);
|
||||
$('#topupError').addClass('hidden');
|
||||
$('#topupSuccess').removeClass('hidden');
|
||||
$('#topupSuccess').html('<p>' + data.message + '</p>');
|
||||
$('#dealerTopForm')[0].reset();
|
||||
$('#orgTopUpModal').modal('hide');
|
||||
$('#topupSuccess').delay(5000).fadeOut();
|
||||
$('#topupSuccess').html('');
|
||||
setTimeout(function() {
|
||||
location.reload();
|
||||
}, 2000);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error('Error:', error);
|
||||
if (xhr.status === 422) {
|
||||
$('#topupError').removeClass('hidden');
|
||||
//console.log(xhr.responseJSON.errors); // Display validation errors
|
||||
$.each(xhr.responseJSON.errors, function(key, value) {
|
||||
$('#topupError').append('<p>' + value[0] + '</p>');
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel: function () {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,48 @@
|
||||
<div class="modal fade" id="orgTopUpModal" 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">Complete the form for the 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('admin/topups')}}" id="dealerTopForm" method="POST">
|
||||
<input type="hidden" name="organisation" class="org_id" id="selectedOrgId" value="">
|
||||
{{csrf_field()}}
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="topUpAmount" class="col-form-label">Amount</label>
|
||||
<input required type="number" class="form-control" name="amount" id="topUpAmount" placeholder="Amount">
|
||||
</div>
|
||||
<div class="form-group col-md-12">
|
||||
<label for="paymentMethod" class="col-form-label">Payment Method</label>
|
||||
<select name="payment" id="paymentMethod" class="form-control select2" data-toggle="select2" data-placeholder="Select Payment Method">
|
||||
<option value="None">Select Payment Method</option>
|
||||
<option value="cash">Cash</option>
|
||||
<option value="Mobile Money">Mobile Money</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-12">
|
||||
<label for="discount" class="col-form-label">Commission (%)</label>
|
||||
<input type="text" name="discount" id="discount" class="form-control discountInput" required="">
|
||||
</div>
|
||||
<div class="form-group col-md-12">
|
||||
<label for="discount" class="col-form-label">Finanl Amount</label>
|
||||
<input type="text" name="final_amount" id="discount" class="form-control discountInput" required="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary btn-block">Add </button>
|
||||
<button type="reset" class="btn btn-danger btn-block" data-dismiss="modal">Close</button>
|
||||
</form>
|
||||
</div>
|
||||
<!-- <div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary">Save changes</button>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
0
resources/views/super_admin/profile.blade.php
Executable file
0
resources/views/super_admin/profile.blade.php
Executable file
194
resources/views/super_admin/settings.blade.php
Normal file
194
resources/views/super_admin/settings.blade.php
Normal file
@@ -0,0 +1,194 @@
|
||||
@extends('layouts.admin_master')
|
||||
@section('page-title')
|
||||
Admin | {{ $page_title }}
|
||||
@endsection
|
||||
@section('page-css')
|
||||
@endsection
|
||||
@section('page-content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="hpanel">
|
||||
<div class="panel-heading">
|
||||
{{ $page_title }}
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div>
|
||||
<h5>How to use</h5>
|
||||
<!-- <p>Click on the values to make changes</p> -->
|
||||
<table id="user" class="table table-bordered table-striped custom-fixed-table" style="clear: both">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Status</th>
|
||||
<th>Value</th>
|
||||
<th>Date Modified</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($settings as $row)
|
||||
<tr>
|
||||
<td width="35%">{{ $row->name }}</td>
|
||||
<td width="35%">{{ $row->status }}</td>
|
||||
<td width="65%">
|
||||
<a href="#" id="username" data-type="text" data-pk="1" data-title="Enter {{ $row->name }}" class="editable editable-click">{{ $row->value }}</a>
|
||||
</td>
|
||||
<td width="35%">{{ $row->updated_at }}</td>
|
||||
<td><a href="" class="btn btn-warning btn-sm"><i class="fa fa-pencil"></i> Edit</a></td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="4">No Data</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
@section('page-js')
|
||||
<script src="{{ url('public/theme_assets/vendor/xeditable/bootstrap3-editable/js/bootstrap-editable.min.js') }}"></script>
|
||||
<script>
|
||||
|
||||
$(document).ready(function() {
|
||||
$.fn.editable.defaults.url = '#';
|
||||
|
||||
//editables
|
||||
$('#username').editable({
|
||||
url: '#',
|
||||
type: 'text',
|
||||
pk: 1,
|
||||
name: 'username',
|
||||
title: 'Enter username'
|
||||
});
|
||||
|
||||
$('#firstname').editable({
|
||||
validate: function(value) {
|
||||
if($.trim(value) == '') return 'This field is required';
|
||||
}
|
||||
});
|
||||
|
||||
$('#sex').editable({
|
||||
prepend: "not selected",
|
||||
source: [
|
||||
{value: 1, text: 'Male'},
|
||||
{value: 2, text: 'Female'}
|
||||
],
|
||||
display: function(value, sourceData) {
|
||||
var colors = {"": "gray", 1: "green", 2: "blue"},
|
||||
elem = $.grep(sourceData, function(o){return o.value == value;});
|
||||
|
||||
if(elem.length) {
|
||||
$(this).text(elem[0].text).css("color", colors[value]);
|
||||
} else {
|
||||
$(this).empty();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#dob').editable();
|
||||
|
||||
$('#event').editable({
|
||||
placement: 'right',
|
||||
combodate: {
|
||||
firstItem: 'name'
|
||||
}
|
||||
});
|
||||
|
||||
$('#comments').editable({
|
||||
showbuttons: 'bottom'
|
||||
});
|
||||
|
||||
$('#fruits').editable({
|
||||
pk: 1,
|
||||
limit: 3,
|
||||
source: [
|
||||
{value: 1, text: 'banana'},
|
||||
{value: 2, text: 'peach'},
|
||||
{value: 3, text: 'apple'},
|
||||
{value: 4, text: 'watermelon'},
|
||||
{value: 5, text: 'orange'}
|
||||
]
|
||||
});
|
||||
|
||||
$('#user .editable').on('hidden', function(e, reason){
|
||||
if(reason === 'save' || reason === 'nochange') {
|
||||
var $next = $(this).closest('tr').next().find('.editable');
|
||||
if($('#autoopen').is(':checked')) {
|
||||
setTimeout(function() {
|
||||
$next.editable('show');
|
||||
}, 300);
|
||||
} else {
|
||||
$next.focus();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('.topUpBtn').click(function() {
|
||||
var org_id = $(this).siblings('.orgRowId').val();
|
||||
var orgName = $(this).siblings('.orgRowName').val();
|
||||
console.log(org_id);
|
||||
$('#selectedOrgId').val(org_id);
|
||||
$('.titleHead').text('Top Up Balance for ' + orgName);
|
||||
$('#orgTopUpModal').modal('show');
|
||||
});
|
||||
|
||||
|
||||
$('#dealerTopForm').submit(function(evt){
|
||||
evt.preventDefault();
|
||||
var formData = new FormData(this);
|
||||
/*
|
||||
formData.append('org_id', $('#selectedOrgId').val());
|
||||
formData.append('org_name', $('.titleHead').text());
|
||||
formData.append('amount', $('input[name="amount"]').val());
|
||||
formData.append('payment', $('select[name="payment"]').val());
|
||||
formData.append('discount', $('input[name="discount"]').val());
|
||||
formData.append('_token', '{{ csrf_token() }}');
|
||||
formData.append('action', 'topup');
|
||||
formData.append('org_id', $('#selectedOrgId').val());
|
||||
*/
|
||||
$.ajax({
|
||||
url: base_url + '/admin/topups',
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
beforeSend: function() {
|
||||
$('#topupError').addClass('hidden');
|
||||
console.log('Sending data...');
|
||||
},
|
||||
success: function(data) {
|
||||
console.log('Success:', data);
|
||||
$('#topupError').addClass('hidden');
|
||||
$('#topupSuccess').removeClass('hidden');
|
||||
$('#topupSuccess').html('<p>' + data.message + '</p>');
|
||||
$('#dealerTopForm')[0].reset();
|
||||
$('#orgTopUpModal').modal('hide');
|
||||
$('#topupSuccess').delay(5000).fadeOut();
|
||||
$('#topupSuccess').html('');
|
||||
setTimeout(function() {
|
||||
location.reload();
|
||||
}, 2000);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error('Error:', error);
|
||||
if (xhr.status === 422) {
|
||||
$('#topupError').removeClass('hidden');
|
||||
//console.log(xhr.responseJSON.errors); // Display validation errors
|
||||
$.each(xhr.responseJSON.errors, function(key, value) {
|
||||
$('#topupError').append('<p>' + value[0] + '</p>');
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
0
resources/views/super_admin/show.blade.php
Executable file
0
resources/views/super_admin/show.blade.php
Executable file
92
resources/views/super_admin/topups.blade.php
Normal file
92
resources/views/super_admin/topups.blade.php
Normal file
@@ -0,0 +1,92 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('page-title')
|
||||
Admin | Account Top Ups
|
||||
@endsection
|
||||
|
||||
@section('page-css')
|
||||
<!-- third party css -->
|
||||
<link href="{{ url('public/assets/css/vendor/dataTables.bootstrap4.css')}}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ url('public/assets/css/vendor/responsive.bootstrap4.css')}}" rel="stylesheet" type="text/css" />
|
||||
<!-- third party css end -->
|
||||
@endsection
|
||||
|
||||
@section('page-content')
|
||||
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="{{url('/')}}">Dashboard</a></li>
|
||||
<li class="breadcrumb-item active">Top Ups</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title">Organisation Top Ups</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{{-- Alert --}}
|
||||
@include('layouts.alert')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-4">
|
||||
<a href="{{url('admin/topups/create')}}" class="btn btn-success mb-2"><i class="mdi mdi-plus-circle mr-2"></i> Add Top Up</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-centered table-borderless table-hover w-100 dt-responsive nowrap" id="products-datatable">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>Organisation Name</th>
|
||||
<th>Balance Before Topup</th>
|
||||
<th>Amount</th>
|
||||
<th>Payment Method</th>
|
||||
<th>Status</th>
|
||||
<th>Admin Name</th>
|
||||
<th>Date Created</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@forelse ($topups as $topup)
|
||||
<tr>
|
||||
<td class="table-user"><a href="javascript:void(0);" class="text-body font-weight-semibold">{{ $topup->orgInfo->name }}</a></td>
|
||||
<td><span class="font-weight-semibold">K {{ $topup->current_balance }}</span></td>
|
||||
<td><span class="font-weight-semibold">K {{ $topup->amount }}</span></td>
|
||||
<td><span class="font-weight-semibold">{{ $topup->payment_method }}</span></td>
|
||||
<td><span class="font-weight-semibold">{{ $topup->status }}</span></td>
|
||||
<td><a href="javascript:void(0);" class="text-body font-weight-semibold"> {{ $topup->userInfo->name }}</a></td>
|
||||
<td>{{ Carbon\Carbon::parse($topup->created_at)->format('F dS Y') }}</td>
|
||||
</tr>
|
||||
@empty
|
||||
<td colspan="6">No Data</td>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
{{ $topups->links() }}
|
||||
</div>
|
||||
</div> <!-- end card-body-->
|
||||
</div> <!-- end card-->
|
||||
</div> <!-- end col -->
|
||||
</div>
|
||||
<!-- end row -->
|
||||
|
||||
@endsection
|
||||
|
||||
|
||||
@section('page-js')
|
||||
|
||||
@endsection
|
||||
75
resources/views/super_admin/update.blade.php
Executable file
75
resources/views/super_admin/update.blade.php
Executable file
@@ -0,0 +1,75 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('page-title')
|
||||
Admin | Create User
|
||||
@endsection
|
||||
|
||||
@section('page-css')
|
||||
|
||||
<!-- Datatables css -->
|
||||
<link href="{{url('public/assets/css/vendor/buttons.bootstrap4.css')}}" rel="stylesheet" type="text/css" />
|
||||
|
||||
@endsection
|
||||
|
||||
@section('page-content')
|
||||
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="{{url('/')}}">Admin</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{url('admin/users')}}">Users</a></li>
|
||||
<li class="breadcrumb-item active">Update User</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title">Update User</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
{{-- Alert --}}
|
||||
@include('layouts.alert')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="header-title">Update User</h4>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane show active" id="form-row-preview">
|
||||
<form action="{{url('admin/users')}}" method="POST" >
|
||||
{{ csrf_field() }}
|
||||
<div class="form-group">
|
||||
<label for="inputEmail4" class="col-form-label">Full Name</label>
|
||||
<input required type="text" class="form-control" name="name" value="{{ $user->name }}" placeholder="Full Name">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="emailAddress" class="col-form-label">Email</label>
|
||||
<input type="email" name="email" class="form-control" id="emailAddress" value="{{ $user->email }}" placeholder="Email" >
|
||||
</div>
|
||||
|
||||
|
||||
<button type="submit" class="btn btn-primary">Update </button>
|
||||
<button type="" class="btn btn-danger">Cancel</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<!-- end preview-->
|
||||
|
||||
|
||||
</div>
|
||||
<!-- end tab-content-->
|
||||
|
||||
</div>
|
||||
<!-- end card-body -->
|
||||
</div>
|
||||
<!-- end card-->
|
||||
</div>
|
||||
<!-- end col -->
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
Reference in New Issue
Block a user