157 lines
7.2 KiB
PHP
157 lines
7.2 KiB
PHP
@extends('layouts.master')
|
|
@section('page-title')
|
|
{{ $page_title }}
|
|
@endsection
|
|
@section('page-css')
|
|
<!-- <link href="https://unpkg.com/tabulator-tables@6.4.0/dist/css/tabulator.min.css" rel="stylesheet"> -->
|
|
<link href="{{ url('public/libs/tabulator-master/dist/css/tabulator_bootstrap5.css') }}" rel="stylesheet">
|
|
|
|
@endsection
|
|
@section('content')
|
|
<section class="traffic-hero mb-4">
|
|
<div class="row g-4 align-items-end">
|
|
<div class="col-lg-8">
|
|
<div class="text-uppercase small fw-semibold opacity-75 mb-2">SMS Traffic Monitoring</div>
|
|
<!-- <h1 class="display-6 fw-semibold mb-3">Track every message your team sends.</h1>
|
|
<p class="fs-5 opacity-75 mb-0">
|
|
Search sent SMS, review delivery outcomes, inspect failed attempts, and give clients a fast audit trail for every campaign.
|
|
</p> -->
|
|
</div>
|
|
<div class="col-lg-4"></div>
|
|
</div>
|
|
</section>
|
|
<section class="row g-4">
|
|
<div class="col-xl-12">
|
|
<div class="filter-card mb-4">
|
|
<div class="d-flex flex-column flex-lg-row align-items-lg-center justify-content-between gap-3 mb-3">
|
|
<div>
|
|
<h2 class="h4 mb-1">Sent SMS list</h2>
|
|
<!-- <p class="text-secondary mb-0">Filter messages by date, sender, recipient, or delivery state.</p> -->
|
|
</div>
|
|
<!-- <div class="d-flex flex-wrap gap-2">
|
|
<button class="btn btn-ghost px-4"><i class="bi bi-download me-2"></i>Export CSV</button>
|
|
<button class="btn btn-click px-4"><i class="bi bi-funnel me-2"></i>Apply filters</button>
|
|
</div> -->
|
|
</div>
|
|
|
|
<div class="row g-3">
|
|
<div class="col-md-12">
|
|
<div class="float-end">
|
|
|
|
|
|
<!-- <label for="search" class="form-label fw-semibold">Search</label> -->
|
|
<!-- <input id="search" type="text" class="form-control" placeholder="Phone, sender ID, text"> -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="traffic-table-card">
|
|
<div class="p-1">
|
|
<button id="download-pdf" class="btn btn-danger"><i class="bi bi-file-pdf-fill me-2"></i> Export PDF</button>
|
|
<button id="download-xlsx" class="btn btn-success"><i class="bi bi-file-excel-fill me-2"></i> Export Excel</button>
|
|
</div>
|
|
<div id="message-table"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- <div class="col-xl-2"> -->
|
|
|
|
|
|
<!-- <aside class="detail-card"> -->
|
|
<!-- <h2 class="h5 mb-3">Recent activity</h2> -->
|
|
|
|
<!-- <div class="timeline-item pt-0 mt-0 border-0">
|
|
<div class="fw-semibold">Sender ID approved</div>
|
|
<div class="muted-label">CLICKINFO added </div>
|
|
<div class="small text-secondary mt-1">09:04</div>
|
|
</div> -->
|
|
<!-- <div class="timeline-item">
|
|
<div class="fw-semibold">Campaign completed</div>
|
|
<div class="muted-label">[campaign name] batch finished</div>
|
|
<div class="small text-secondary mt-1">08:41</div>
|
|
</div> -->
|
|
<!-- </aside> -->
|
|
<!-- </div> -->
|
|
</section>
|
|
@endsection
|
|
@section('page-js')
|
|
<!-- <script src="https://unpkg.com/tabulator-tables@6.4.0/dist/js/tabulator.min.js"></script> -->
|
|
<script src="{{ url('public/libs/tabulator-master/dist/js/tabulator.min.js') }}"></script>
|
|
|
|
<script src="https://unpkg.com/jspdf@latest/dist/jspdf.umd.min.js"></script>
|
|
<script type="text/javascript" src="https://cdn.sheetjs.com/xlsx-0.20.3/package/dist/xlsx.full.min.js"></script>
|
|
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/luxon@2.3.1/build/global/luxon.min.js"></script>
|
|
<script src="{{ url('public/libs/tabulator-master/dist/js/autotable.min.js') }}"></script>
|
|
<script>
|
|
console.log(base_url);
|
|
function statusDesign (cell, formatterParams){
|
|
var value = cell.getValue();
|
|
// if(value === 'Approved'){
|
|
// console.log(value !== null);
|
|
if (value !== null) {
|
|
if(value.includes('SENT')){
|
|
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("#message-table", {
|
|
ajaxURL: base_url + "/client-traffic-tabulator/",
|
|
ajaxConfig: {
|
|
method: "GET",
|
|
headers: {
|
|
"Content-type": "application/json; charset=utf-8",
|
|
},
|
|
},
|
|
ajaxParams: {size: 1000},
|
|
pagination: "remote",
|
|
paginationSize: 20,
|
|
paginationDataSent: {
|
|
"page": "page",
|
|
"size": "size"
|
|
},
|
|
paginationDataReceived: {
|
|
"last_page": "totalPages",
|
|
"data": "content",
|
|
"current_page": "number",
|
|
"total": "totalElements"
|
|
},
|
|
ajaxResponse: function(url, params, response) {
|
|
return response.content;
|
|
},
|
|
columns: [
|
|
|
|
{title: "Sender", field: "from", width:150, headerFilter:"input"},
|
|
{title: "Msisdn", field: "to", width:150, headerFilter:"input"},
|
|
// {title: "Message", field: "message"},
|
|
{title:"Message", field:"message", width:650, formatter:"textarea", headerFilter:"input"},
|
|
// {title: "Status", field: "status"},
|
|
// {title: "Delivery Status", field: "deliveryStatus", width:100, headerFilter:"input", formatter: statusDesign},
|
|
// {title: "Created At", field: "createdAt"},
|
|
{title:"Date Created ", field:"createdAt", width:200, formatter:"datetime", headerFilter:"input", formatterParams:{
|
|
inputFormat: "iso",
|
|
outputFormat: "dd-MM-yyyy HH:mm:ss",
|
|
invalidPlaceholder: "(invalid date)"
|
|
}}
|
|
],
|
|
});
|
|
|
|
document.getElementById("download-pdf").addEventListener("click", function(){
|
|
table.download("pdf", "messages.pdf", {
|
|
orientation:"portrait", // portrait or landscape
|
|
title:"Messages Export", // document title
|
|
});
|
|
});
|
|
|
|
document.getElementById("download-xlsx").addEventListener("click", function(){
|
|
table.download("xlsx", "messages.xlsx", {sheetName:"Messages"});
|
|
});
|
|
</script>
|
|
|
|
@endsection |