nhance/app/Views/bds_dash.php

355 lines
10 KiB
PHP

<style>
.order-card {
color: #fff;
}
.bg-c-blue {
background: linear-gradient(45deg,#4099ff,#73b4ff);
}
.bg-c-green {
background: linear-gradient(45deg,#2ed8b6,#59e0c5);
}
.bg-c-yellow {
background: linear-gradient(45deg,#FFB64D,#ffcb80);
}
.bg-c-pink {
background: linear-gradient(45deg,#FF5370,#ff869a);
}
.bg-c-red {
background: linear-gradient(45deg,#FF4E50,#F9D423);
}
.bg-c-purple {
background: linear-gradient(45deg,#9D50BB,#6E48AA);
}
.bg-c-orange {
background: linear-gradient(45deg,#F2994A,#F2C94C);
}
.bg-c-teal {
background: linear-gradient(45deg,#1ABC9C,#16A085);
}
.bg-c-cyan {
background: linear-gradient(45deg,#00C9FF,#92FE9D);
}
.bg-c-lime {
background: linear-gradient(45deg,#A8E063,#56AB2F);
}
.bg-c-indigo {
background: linear-gradient(45deg,#3F51B5,#5A55AE);
}
.bg-c-Pelorous {
background: linear-gradient(45deg, #00d6db, #00a8b5);
}
.bg-c-Pelorous2 {
background: linear-gradient(45deg, #02a8b5, #017f8b);
}
.bg-c-Pelorous3 {
background: linear-gradient(45deg, #098895, #046063);
}
.bg-c-Grenadier {
background: linear-gradient(45deg, #ff9d37, #ff7a10);
}
.bg-c-Grenadier2 {
background: linear-gradient(45deg, #ff8010, #ff4c00);
}
.bg-c-Grenadier3 {
background: linear-gradient(45deg, #f06306, #cc4b05);
}
.bg-c-SilverChalice {
background: linear-gradient(45deg, #a3a8a8, #8f9494);
}
.bg-c-SilverChalice2 {
background: linear-gradient(45deg, #7e8484, #686e6e);
}
.bg-c-SilverChalice3 {
background: linear-gradient(45deg, #5c6363, #434949);
}
.card {
border-radius: 5px;
-webkit-box-shadow: 0 1px 2.94px 0.06px rgba(4,26,55,0.16);
box-shadow: 0 1px 2.94px 0.06px rgba(4,26,55,0.16);
border: none;
margin-bottom: 30px;
-webkit-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
.card .card-block {
padding-top: 10px;
padding-bottom: 10px;
padding-left: 25px;
padding-right: 25px;
font-size: small;
}
.order-card i {
font-size: 26px;
}
.f-left {
float: left;
}
.f-right {
float: right;
}
.m-b-1{
margin-top: 0;
margin-bottom: 5px;
}
.inside-tab-content-div{
display:flex;
justify-content:flex-start !important;
flex-flow: row wrap;
}
.dash-card{
background-color:#F4FBFB !important;
border-radius: 15px !important;
border:2px solid #09B9BF;
box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.1), 0px 4px 8px rgba(0, 0, 0, 0.2);
min-width: 250px;
}
#bds-dash-tab{
padding-right: 20px;
}
.span-color{
color:#09B9BF !important;
}
.financeStatusTile{margin-left:20px;}
.financePendingTile{margin-left:20px;}
.businessPendingTile{margin-left:20px;}
.businessStatusTile{margin-left:20px;}
</style>
<?php if((get_role_id() == 4 ) && (in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(FINANCE_TEAM_ID, user_team()) || in_array(BUSINESS_TEAM_ID, user_team()))) { ?>
<?php $add_active_calss = "active show" ?>
<?php } ?>
<div class="tab-pane <?= isset($add_active_calss) ? $add_active_calss : 'fade' ?>" id="bds-dash-tab" >
<div class="row">
<div class="StatusTileHide" style="display: none; padding-bottom: 10px;padding-left: 17px">
<a href="#" onclick="hide_status_show_pending_tile()" ><i class="fas fa-arrow-left"></i> Back to Overview</a>
</div>
<div class="StatusTileHide" style="display: none;padding-left: 30px;">
<a href="#" id="mainMenuTiles">Current Tile : </a>
</div>
</div>
<div class="row">
<div class="col inside-tab-content-div">
<?php if (in_array(BUSINESS_TEAM_ID, user_team()) || in_array(MANAGEMENT_TEAM_ID, user_team())) { ?>
<div class=" businessPendingTile">
<div class="card dash-card" onclick="show_business_status_tile(this)">
<div class="card-block">
<h4 class="mb-3" style="color:black;">Business Team Pending</h4>
<h2>
<span class="mb-3 span-color"><?= $businessTeamCount ?>
</h2>
<h6 >&nbsp;<span class="text-danger"> Team Action</span></h6>
</div>
</div>
</div>
<?php
// Array of colors with different shades (each array represents a color set)
$colorSetCount = count($colorShades); // Number of color sets
$shadeCount = count($colorShades[0]); // Number of shades per set
$index = 0;
foreach ($businessTeamStatusData as $status => $value) {
$colorSetIndex = floor($index / $shadeCount) % $colorSetCount; // Reset color set after each set
$shadeIndex = $index % $shadeCount; // Cycle through shades within the set
// Get the background color for the current tile
$bgColor = $colorShades[$colorSetIndex][$shadeIndex];
?>
<div class=" businessStatusTile" style="display: none;">
<div class="card dash-card">
<div class="card-block" onclick="linkRedirectForBDS(this, 'B')">
<h5 class="text-right">
<span class="f-left" style="color:black;"><?= $policyStatus[$status] ?></span>
<span class="span-color"><?= count($value) ?></span>
</h5>
</div>
</div>
</div>
<?php
$index++; // Increment index for the next tile
}
?>
<?php } ?>
<?php if (in_array(FINANCE_TEAM_ID, user_team()) || in_array(MANAGEMENT_TEAM_ID, user_team())) { ?>
<div class=" financePendingTile">
<div class="card dash-card" onclick="show_finance_status_tile(this, 'F')">
<div class="card-block">
<h4 class="mb-3" style="color:black;">Finance Team Pending</h4>
<h2>
<span class="mb-3 span-color"><?= $financeTeamCount ?>
</h2>
<h6 >&nbsp;<span class="text-danger">Team Action</span></h6>
</div>
</div>
</div>
<?php
// Array of colors with different shades (each array represents a color set)
$colorSetCount = count($colorShades); // Number of color sets
$shadeCount = count($colorShades[0]); // Number of shades per set
$index = 0;
foreach ($financeTeamStatusData as $status => $value) {
$colorSetIndex = floor($index / $shadeCount) % $colorSetCount; // Reset color set after each set
$shadeIndex = $index % $shadeCount; // Cycle through shades within the set
// Get the background color for the current tile
$bgColor = $colorShades[$colorSetIndex][$shadeIndex];
?>
<div class=" financeStatusTile" style="display: none;">
<div class="card dash-card">
<div class="card-block" onclick="linkRedirectForBDS(this, 'F')">
<h5 class="text-right p-0">
<span class="f-left" style="color:black;"><?= $policyStatus[$status] ?></span>
<span class="span-color"><?= count($value) ?></span>
</h5>
</div>
</div>
</div>
<?php
$index++; // Increment index for the next tile
}
?>
<?php } ?>
</div>
</div>
</div>
<script>
$(document).ready(function(){
$(".StatusTileHide").hide();
})
function linkRedirectForBDS(input, team)
{
var link = "";
if(team == 'B'){
link = '<?= base_url('/policy_tranction/report/report-business-list') ?>'
}else if(team == 'F'){
link = '<?= base_url('/policy_tranction/report/report-finance-list') ?>'
}
console.log(link);
if(link){
window.location.href = link;
}
}
function show_business_status_tile(){
let dashboardHistoryString = localStorage.getItem('dashboardHistory');
if (dashboardHistoryString){
let dashboardHistory = JSON.parse(dashboardHistoryString);
dashboardHistory['tile_params'] = { majorType: 0, minorType: 0 };
dashboardHistory['function_name'] = 'show_business_status_tile';
localStorage.setItem('dashboardHistory', JSON.stringify(dashboardHistory));
}
$('.businessStatusTile').show()
$('.StatusTileHide').show()
$("#mainMenuTiles").text("Viewing Details of Business Team Pending");
$('.businessPendingTile').hide()
$('.financePendingTile').hide()
}
function show_finance_status_tile(){
let dashboardHistoryString = localStorage.getItem('dashboardHistory');
if (dashboardHistoryString){
let dashboardHistory = JSON.parse(dashboardHistoryString);
dashboardHistory['tile_params'] = { majorType: 0, minorType: 0 };
dashboardHistory['function_name'] = 'show_finance_status_tile';
localStorage.setItem('dashboardHistory', JSON.stringify(dashboardHistory));
}
$('.financeStatusTile').show()
$('.StatusTileHide').show()
$('.financePendingTile').hide()
$('.businessPendingTile').hide()
$("#mainMenuTiles").text("Viewing Details of Finance Team Pending");
}
function hide_status_show_pending_tile(){
$('.StatusTileHide').hide()
$('.financeStatusTile').hide()
$('.businessStatusTile').hide()
$('.financePendingTile').show()
$('.businessPendingTile').show()
}
</script>