Mini Shell
<div class="row row-cols-1 row-cols-xl-3">
<div class="col d-flex">
<div class="card bg-gradient radius-10 w-100 animated <?= $kbilgi['animasyon']?>">
<div class="card-body">
<div class="d-flex align-items-center">
<div>
<h5 class="mb-1">ÇOK SATAN ÜRÜNLER</h5>
<p class="mb-0 font-13"><i class='bx bxs-calendar'></i>Genel Toplam</p>
</div>
</div>
</div>
<div class="coksatan p-3 mb-3">
<?php $satis = $baglanti->query("SELECT urunadi, SUM(adet) AS toplam FROM SatisFaturasi GROUP BY urunadi order by toplam desc LIMIT 25")->fetchAll();
foreach ($satis as $satisim) {
$satistoplam=$satisim['toplam'];
?>
<?php $urun = $baglanti->query("SELECT * FROM Urunler where id='$satisim[urunadi]'")->fetchAll();
foreach ($urun as $urunum) {
?>
<div class="row border mx-0 mb-3 py-2 radius-10 cursor-pointer">
<div class="col-sm-6">
<div class="d-flex align-items-center">
<div class="product-img">
<img src="<?= $urunum['resmi']?>" alt="" />
</div>
<div class="ms-2">
<h6 class="mb-1"><?= $urunum['urunadi']?></h6>
<p class="mb-0"><?php
$stokgrup = $baglanti->query("SELECT * FROM StokGruplar where id=".$urunum["stokgrubu"])->fetchAll(PDO::FETCH_ASSOC);
if(count($stokgrup)>0){
?>
<?php foreach($stokgrup as $grubu){?>
<?php echo $grubu['stokgrupadi']; ?>
<?php } ?>
<?php } ?></p>
</div>
</div>
</div>
<div class="col-sm">
<h6 class="mb-1"><?= $satistoplam; ?></h6>
<p class="mb-0"><?php $birim = $baglanti->query("SELECT * FROM Birim where id=".$urunum["birimadi"])->fetchAll(PDO::FETCH_ASSOC);
if(count($birim)>0){?>
<?php foreach($birim as $birimi){
?>
<?php echo $birimi['kisaltma']; ?>
<?php }?>
<?php } ?></p>
</div>
<div class="col-sm">
<div id="coksatan<?= $urunum['id']?>"></div>
<?php $satislar = $baglanti->query("SELECT * FROM SatisFaturasi WHERE urunadi='$urunum[id]' GROUP BY tarih order by tarih asc")->fetchAll(PDO::FETCH_ASSOC);
?>
<script>
$(function() {
"use strict";
var
e = {
series: [{
name: "Revenue",
data: [<?php
foreach($satislar as $satislarim){ ?>'<?= $satislarim['adet']?>',
<?php } ?>]
}],
chart: {
type: "area",
height: 45,
toolbar: {
show: !1
},
zoom: {
enabled: !1
},
dropShadow: {
enabled: !1,
top: 3,
left: 14,
blur: 4,
opacity: .12,
color: "#0d6efd"
},
sparkline: {
enabled: !0
}
},
markers: {
size: 0,
colors: ["#128e0a"],
strokeColors: "#ff0000",
strokeWidth: 2,
hover: {
size: 7
}
},
dataLabels: {
enabled: !1
},
stroke: {
show: !0,
width: 2,
curve: "smooth"
},
fill: {
type: 'gradient',
gradient: {
shade: 'light',
type: "vertical",
shadeIntensity: 0.5,
gradientToColors: ["#fff"],
inverseColors: true,
opacityFrom: 0.2,
opacityTo: 0.5,
stops: [0, 50, 100],
colorStops: []
}
},
colors: ["#fff"],
xaxis: {
categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
},
tooltip: {
theme: "dark",
fixed: {
enabled: !1
},
x: {
show: !1
},
y: {
title: {
formatter: function(e) {
return ""
}
}
},
marker: {
show: !1
}
}
};
new ApexCharts(document.querySelector("#coksatan<?= $urunum['id']?>"), e).render();
});
</script>
</div>
</div>
<?php } ?>
<?php } ?>
</div>
</div>
</div>
<div class="col d-flex">
<div class="card bg-gradient radius-10 w-100 animated <?= $kbilgi['animasyon']?> delay-1s">
<div class="card-body">
<div class="d-flex align-items-center">
<div>
<h5 class="mb-0">ÇOK SATAN GRUPLAR</h5>
<p class="mb-0 font-13"><i class='bx bxs-calendar'></i>Genel Toplam</p>
</div>
</div>
<div class="mt-5" id="coksatangrup"></div>
<script>
$(function() {
"use strict";
var
e = {
series: [ <?php $grupsatis1 = $baglanti->query("SELECT stokgrup, SUM(adet) AS toplam FROM SatisFaturasi GROUP BY stokgrup order by toplam desc LIMIT 4")->fetchAll();
foreach ($grupsatis1 as $grupsatisim1) {
$grupsatistoplam1=$grupsatisim1['toplam'];
if($grupsatistoplam1>0){
$grupsatistoplamim1 = $grupsatistoplam1;
}else {
$grupsatistoplamim1 = "0";
}
?>
<?php $grup1 = $baglanti->query("SELECT * FROM StokGruplar where id='$grupsatisim1[stokgrup]'")->fetchAll();
foreach ($grup1 as $grubum1) {
?><?= $grupsatistoplamim1; ?>,<?php }?>
<?php } ?>],
chart: {
foreColor: 'rgba(255, 255, 255, 0.65)',
height: 240,
type: "donut"
},
legend: {
position: "bottom",
show: 1
},
plotOptions: {
pie: {
donut: {
size: "80%"
}
}
},
colors: ["#e20e22","#128e0a","#0bb2d3","#e4ad07"],
dataLabels: {
enabled: 1
},
tooltip: {
enabled:false,
theme: "dark",
y: {
formatter: function(e) {
return "$ " + e + " thousands"
}
}
},
labels: [<?php $grupsatis2 = $baglanti->query("SELECT stokgrup, SUM(adet) AS toplam FROM SatisFaturasi GROUP BY stokgrup order by toplam desc LIMIT 4")->fetchAll();
foreach ($grupsatis2 as $grupsatisim2) {
$grupsatistoplam2=$grupsatisim2['toplam'];
if($grupsatistoplam2>0){
$grupsatistoplamim2 = $grupsatistoplam2;
}else {
$grupsatistoplamim2 = "0";
}
?>
<?php $grup2 = $baglanti->query("SELECT * FROM StokGruplar where id='$grupsatisim2[stokgrup]'")->fetchAll();
foreach ($grup2 as $grubum2) {
?>'<?= $grubum2['stokgrupadi']?> ',<?php }?>
<?php } ?>],
responsive: [{
breakpoint: 480,
options: {
chart: {
height: 200
},
legend: {
position: "bottom"
}
}
}]
};
new ApexCharts(document.querySelector("#coksatangrup"), e).render();
});
</script>
</div>
<ul class="list-group list-group-flush">
<?php $grupsatis = $baglanti->query("SELECT stokgrup, SUM(adet) AS toplam FROM SatisFaturasi GROUP BY stokgrup order by toplam desc LIMIT 4")->fetchAll();
foreach ($grupsatis as $grupsatisim) {
$grupsatistoplam=$grupsatisim['toplam'];
if($grupsatistoplam>0){
$grupsatistoplamim = $grupsatistoplam;
}else {
$grupsatistoplamim = "0";
}
?>
<?php $grup = $baglanti->query("SELECT * FROM StokGruplar where id='$grupsatisim[stokgrup]'")->fetchAll();
foreach ($grup as $grubum) {
?>
<li class="list-group-item d-flex bg-transparent justify-content-between align-items-center"><?= $grubum['stokgrupadi']?> <span class="badge bg-dark bg-gradient rounded-pill"><?= $grupsatistoplamim; ?></span>
</li>
<?php }?>
<?php } ?>
</ul>
</div>
</div>
<div class="col d-flex">
<div class="card bg-gradient radius-10 w-100 animated <?= $kbilgi['animasyon']?> delay-2s">
<div class="card-body">
<div class="d-flex align-items-center">
<div>
<h5 class="mb-0">ÇOK SATIŞ YAPILAN CARİLER</h5>
<p class="mb-0 font-13"><i class='bx bxs-calendar'></i>Genel Toplam</p>
</div>
</div>
<div class="chart-container1">
<canvas id="coksatancari"></canvas>
</div>
<script>
$(function () {
"use strict";
new Chart(document.getElementById("coksatancari"), {
type: 'horizontalBar',
data: {
labels: [<?php $carisatis2 = $baglanti->query("SELECT cariadi, SUM(geneltoplam) AS toplam FROM SatFatBilgi GROUP BY cariadi order by toplam desc LIMIT 10")->fetchAll();
foreach ($carisatis2 as $carisatisim2) {
$carisatistoplam2=$carisatisim2['toplam'];
if($carisatistoplam2>0){
$carisatistoplamim2 = $carisatistoplam2;
}else {
$carisatistoplamim2 = "0";
}
?>
<?php $cari2 = $baglanti->query("SELECT * FROM Cariler where id='$carisatisim2[cariadi]'")->fetchAll();
foreach ($cari2 as $carim2) {
$kisacarim2 = substr($carim2["unvani"],0,20);
?>'<?= $kisacarim2; ?>',<?php }?>
<?php } ?>],
datasets: [{
label: "TOPLAM",
backgroundColor: ["#128e0a","#0bb2d3","#e20e22","#e4ad07","#515a62","#0c62e0","#128e0a","#0bb2d3","#e20e22","#e4ad07"],
data: [<?php $carisatis1 = $baglanti->query("SELECT cariadi, SUM(geneltoplam) AS toplam FROM SatFatBilgi GROUP BY cariadi order by toplam desc LIMIT 10")->fetchAll();
foreach ($carisatis1 as $carisatisim1) {
$carisatistoplam1=$carisatisim1['toplam'];
if($carisatistoplam1>0){
$carisatistoplamim1 = $carisatistoplam1;
}else {
$carisatistoplamim1 = "0";
}
?>
<?php $cari1 = $baglanti->query("SELECT * FROM Cariler where id='$carisatisim1[cariadi]'")->fetchAll();
foreach ($cari1 as $carim1) {
?><?= $carisatistoplamim1; ?>,<?php }?>
<?php } ?>]
}]
},
options: {
maintainAspectRatio: false,
legend: {
display: false
},
scales: {
xAxes: [{
ticks: {
beginAtZero: true,
fontColor: '#fff'
},
gridLines: {
display: true,
color: "rgba(255, 255, 255, 0.24)"
},
}],
yAxes: [{
ticks: {
beginAtZero: true,
fontColor: 'rgba(255, 255, 255, 0.64)'
},
gridLines: {
display: true,
color: "rgba(255, 255, 255, 0.24)"
},
}]
}
}
});
});
</script>
</div>
</div>
</div>
</div>