multiple bug fixes including sender ID filtering

This commit is contained in:
Kwesi Banson Jnr
2026-04-16 14:22:04 +00:00
parent 72180de8e4
commit 5dbe76dbd4
380 changed files with 175085 additions and 203 deletions

View File

@@ -28,38 +28,16 @@
<div class="x_content">
<br>
{!! Form::open(['url' => 'dailyquotes', 'id' => 'dailyQuoteCreateForm', 'class' => 'form-horizontal form-label-left']) !!}
<div class="row">
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="quoteIDD">dailyquote ID</label>
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="quoteIDD">Quote</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('quote') ? 'has-error' : ''}}">
{!! Form::text('quote', old('quote'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter quote , 'id' => 'quoteIDD', 'required' => 'true']) !!}
{!! Form::textarea('quote', old('quote'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter quote', 'id' => 'quoteIDD', 'required' => 'true']) !!}
{!! $errors->first('quote', '<p class="help-block">:message</p>') !!}
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="directMno">Direct MNO</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('direct_mno') ? 'has-error' : ''}}">
{!! Form::select('direct_mno', $direct_mno_arr ,old('direct_mno'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Select one ' , 'id' => 'directMno', 'required' => 'true']) !!}
{!! $errors->first('direct_mno', '<p class="help-block">:message</p>') !!}
</div>
</div>
<div class="form-group " id="mnoDiv">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="networkName">MNO Name</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('network') ? 'has-error' : ''}}">
{!! Form::select('mno_name', $network_arr, old('mno_name'), ['class' => 'form-control col-md-7 col-xs-12', 'id' => 'networkName', 'placeholder' => '-- Select --', 'required' => 'true', 'style' => 'width:100%;']) !!}
{!! $errors->first('network', '<p class="help-block">:message</p>') !!}
</div>
</div>
<div class="form-group " id="supplierDiv">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="supplierName">Supplier Name</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('name') ? 'has-error' : ''}}">
<!-- 'required' => 'true', -->
{!! Form::select('supplier_name', $clients, old('supplier_name'), ['class' => 'form-control', 'id' => 'supplierName', 'placeholder' => '-- Select --', 'style' => 'width:100%;']) !!}
{!! $errors->first('client_id', '<p class="help-block">:message</p>') !!}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="status">Status</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('status') ? 'has-error' : ''}}">
@@ -68,10 +46,17 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="remarks">Remarks</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('remarks') ? 'has-error' : ''}}">
{!! Form::text('remarks', old('remarks'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter remarks here' , 'id' => 'remarks']) !!}
{!! $errors->first('remarks', '<p class="help-block">:message</p>') !!}
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="author">Author</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('author') ? 'has-error' : ''}}">
{!! Form::text('author', old('author'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter author name' , 'id' => 'author']) !!}
{!! $errors->first('author', '<p class="help-block">:message</p>') !!}
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="quoteDate">Quote Date</label>
<div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('quote_date') ? 'has-error' : ''}}">
{!! Form::text('quote_date', old('quote_date'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Select date' , 'id' => 'quoteDate']) !!}
{!! $errors->first('quote_date', '<p class="help-block">:message</p>') !!}
</div>
</div>
@@ -80,7 +65,7 @@
<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
<button type="submit" class="btn btn-success btn-block"><i class="fa fa-save"></i> Submit</button>
&nbsp;
<button type="button" class="btn btn-warning btn-block" id="resetBtn"><i class="fa fa-save"></i> Reset</button>
<button type="reset" class="btn btn-warning btn-block" id="resetBtn"><i class="fa fa-save"></i> Reset</button>
</div>
</div>

View File

@@ -0,0 +1,146 @@
@extends('layouts.master')
@section('page_title')
@if(isset($page_title))
{{ $page_title }}
@endif
@endsection
@section('css')
<link href="{!! url('public/assets/vendors/tabulator/css/bootstrap/tabulator_bootstrap.css') !!}" type="text/css" rel="stylesheet">
@endsection
@section('content')
<div class="">
<div class="page-title">
<div class="title_left">
<div class="title_left">
<ol class="breadcrumb">
<li><a href="{!! url('dashboard') !!}">Dashboard</a></li>
<li class="active">Daily Quotess</li>
</ol>
</div>
</div>
<div class="title_right">
<div class="row">
<form method="GET" action="{!! url('dailyquotes') !!}">
<div class="col-md-5 col-sm-5 col-xs-12 form-group">
<div style="margin-top:1px; margin-right:-90px;" class="top_search">
</div>
</div>
<div class="col-md-5 col-sm-5 col-xs-12 form-group pull-right top_search" style="margin-top: -2px;">
<div class="input-group">
<input type="text" name="keyword" class="form-control" id="keywordField" placeholder="Keyword here...">
<span class="input-group-btn">
<button type="submit" class="btn btn-primary" style="color: #fff;" type="button">Go!</button>
</span>
</div>
</div>
</form>
</div>
<div class="row">
<div class="col-sm-12">
<div class="pull-right"></div>
</div>
</div>
</div>
</div>
<div class="clearfix"></div>
<div class="row">
@include('commons.notifications')
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2> Daily Quotess </h2>
<div class="pull-right">
<a class="btn btn-warning btn-sm" href="{!! url('dailyquotes') !!}"><i class="fa fa-refresh"></i> Reset Filter</a>
<a class="btn btn-primary btn-sm" href="{!! url('dailyquotes/create') !!}"><i class="fa fa-plus-circle"></i> New Daily Quotes</a>
</div>
<div class="clearfix"></div>
</div>
<div class="x_content">
<div id="">
<table class="table table-striped projects">
<thead>
<tr>
<th style="width: 35%">Quote</th>
<th>Author </th>
<th>Quote Date </th>
<th>Status</th>
<th style="width: 15%">#Action</th>
</tr>
</thead>
<tbody>
@if(count($quote_arr) > 0)
@foreach($quote_arr as $row)
<tr>
<td>
{{ $row->quote }}
</td>
<td>
{{ $row->author }}
</td>
<td>
{{ $row->quote_date }}
</td>
<td>
<button type="button" class="btn btn-<?php echo ($row->status == 'active') ? 'success' : 'warning'; ?> btn-xs">{{ ucfirst($row->status) }}</button>
</td>
<td>
<a href="#" class="btn btn-info btn-xs"><i class="fa fa-pencil"></i> Edit </a>
<a href="#" class="btn btn-danger btn-xs"><i class="fa fa-trash-o"></i> Delete </a>
</td>
</tr>
@endforeach
@else
<tr>
<td colspan="5">No records</td>
</tr>
@endif
</tbody>
</table>
{{-- Pagination Links --}}
<div class="pagination-links">
{{ $quote_arr->links() }} {{-- This will render Bootstrap compatible links by default in L5 --}}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@section('javascript')
<script src="{!! url('public/assets/vendors/tabulator/js/tabulator.js') !!}"></script>
<script type="text/javascript" src="{!! url('public/assets/vendors/tabulator/js/xlsx.full.min.js') !!}"></script>
<script type="text/javascript" src="{!! url('public/assets/vendors/tabulator/js/jspdf.min.js') !!}"></script>
<script type="text/javascript" src="{!! url('public/assets/vendors/tabulator/js/jspdf.plugin.autotable.js') !!}"></script>
<script type="text/javascript">
$(document).ready(function(){
document.getElementById("dailyquotes-download-xlsx").addEventListener("click", function(){
table.download("xlsx", "dailyquotes-list.xlsx", {sheetName:"Sheet 1"});
});
//trigger download of data.pdf file
document.getElementById("dailyquotes-download-pdf").addEventListener("click", function(){
table.download("pdf", "client-list.pdf", {
orientation:"portrait", //set page orientation to portrait
title:"Click Mobile - Daily Quotes", //add title to report
});
});
$('#keywordField').on('keyup', function(){
console.log('up');
var keyword = $(this).val();
table.setData("dailyquotes/all?keyword=" + keyword);
});
});
</script>
@endsection

View File

@@ -14,14 +14,14 @@
<div class="title_left">
<ol class="breadcrumb">
<li><a href="{!! url('dashboard') !!}">Dashboard</a></li>
<li class="active">Sender IDs</li>
<li class="active">Daily Quotess</li>
</ol>
</div>
</div>
<div class="title_right">
<div class="row">
<form method="GET" action="{!! url('senderids') !!}">
<form method="GET" action="{!! url('dailyquotes') !!}">
<div class="col-md-5 col-sm-5 col-xs-12 form-group">
<div style="margin-top:1px; margin-right:-90px;" class="top_search">
</div>
@@ -50,29 +50,19 @@
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2> Sender IDs </h2>
<h2> Daily Quotess </h2>
<div class="pull-right">
<a class="btn btn-warning btn-sm" href="{!! url('senderids/upload') !!}"><i class="fa fa-cloud-upload"></i> Upload Sender IDs</a>
<a class="btn btn-primary btn-sm" href="{!! url('senderids/create') !!}"><i class="fa fa-plus-circle"></i> New Sender ID</a>
<a class="btn btn-success btn-sm" href="{!! url('senderids/exportall') !!}"><i class="fa fa-plus-circle"></i> Download All</a>
<a class="btn btn-warning btn-sm" href="{!! url('dailyquotes/upload') !!}"><i class="fa fa-cloud-upload"></i> Upload Daily Quotess</a>
<a class="btn btn-primary btn-sm" href="{!! url('dailyquotes/create') !!}"><i class="fa fa-plus-circle"></i> New Daily Quotes</a>
<a class="btn btn-success btn-sm" href="{!! url('dailyquotes/exportall') !!}"><i class="fa fa-plus-circle"></i> Download All</a>
</div>
<div class="clearfix"></div>
</div>
<div class="x_content">
@if(session('current_user.rejected_rows_filename') !== null)
<div class=" well" >
<?php $url = session('current_user.rejected_rows_filename');?>
<a href="{{ url('senderids/uploadreportdownload', $url) }}" class="btn btn-link">View Sender ID Bulk Upload Report</a>
</div>
@endif
<div class="x_content">
<div>
<!-- <button id="senderid-download-xlsx" class="btn btn-success btn-sm"><i class="fa fa-file-excel-o"></i> Download XLSX</button>
<button id="senderid-download-pdf" class="btn btn-danger btn-sm"><i class="fa fa-file-pdf-o"></i> Download PDF</button> -->
</div>
<div id="senderIdsTable"></div>
<div id="dailyQuotesTable"></div>
</div>
</div>
</div>
@@ -92,7 +82,7 @@
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>";
return "<a href='"+ base_url + "/dailyquotes/"+rowID+"/edit' class='btn btn-link'>"+url+"</a>";
}
function cellDesign (cell, formatterParams){
var value = cell.getValue();
@@ -103,10 +93,10 @@
// if(value === 'Approved'){
// console.log(value !== null);
if (value !== null) {
if(value.includes('Approved')){
if(value.includes('inactive')){
return "<span style='color:#3FB449; font-weight:bold;'>" + value + "</span>";
}
else if(value.includes('Active')){
else if(value.includes('active')){
return "<span style='color:#3FB449; font-weight:bold;'>" + value + "</span>";
}
else{
@@ -114,8 +104,8 @@
}
}
}
var table = new Tabulator("#senderIdsTable", {
ajaxURL: "senderids/all",
var table = new Tabulator("#dailyQuotesTable", {
ajaxURL: "dailyquotes/all",
paginationSize: 15,
layout: "fitColumns",
pagination: "remote",
@@ -125,49 +115,34 @@
columns: [
{
title: "Sender ID",
field: "senderid",
title: "Quotes",
field: "quote",
sorter: "string",
formatter: cellDesign,
formatter:link,
// formatter: cellDesign,
// formatter:link,
},
{
title: "Direct MNO",
field: "direct_mno",
title: "Author",
field: "author",
sorter: "string",
},
{
title: "Network",
field: "mno_name",
sorter: "string",
},
{
title: "Supplier",
field: "supplier_name",
title: "Quote Date",
field: "quote_date",
sorter: "string",
},
{
title: "Status",
field: "status",
sorter: "string",
formatter: statusDesign,
},
},
{
title: "Remarks",
field: "remarks",
sorter: "string",
formatter: statusDesign,
},
{
title: "Created By",
field: "createdBy",
title: "Added By",
field: "addedBy",
sorter: "string",
},
// {
// title: "Last Modified By",
// field: "modifiedBy",
// sorter: "string",
// }
],
rowClick:function(e, row){
@@ -176,20 +151,20 @@
//$('#userEditModal').modal('show');
},
});
document.getElementById("senderid-download-xlsx").addEventListener("click", function(){
table.download("xlsx", "senderid-list.xlsx", {sheetName:"Sheet 1"});
document.getElementById("dailyquotes-download-xlsx").addEventListener("click", function(){
table.download("xlsx", "dailyquotes-list.xlsx", {sheetName:"Sheet 1"});
});
//trigger download of data.pdf file
document.getElementById("senderid-download-pdf").addEventListener("click", function(){
document.getElementById("dailyquotes-download-pdf").addEventListener("click", function(){
table.download("pdf", "client-list.pdf", {
orientation:"portrait", //set page orientation to portrait
title:"Click Mobile - Sender ID", //add title to report
title:"Click Mobile - Daily Quotes", //add title to report
});
});
$('#keywordField').on('keyup', function(){
console.log('up');
var keyword = $(this).val();
table.setData("senderids/all?keyword=" + keyword);
table.setData("dailyquotes/all?keyword=" + keyword);
});