0) {
$pct_harian = round(($diff_harian / $row['omset_kemarin']) * 100, 1);
} elseif($row['omset_harian'] > 0) {
$pct_harian = 100;
}
if($pct_harian > 0) { $cls_harian='text-success'; $ico_harian='fa-caret-up'; }
if($pct_harian < 0) { $cls_harian='text-danger'; $ico_harian='fa-caret-down'; }
// 2. Bulanan (Bulan Ini vs Bulan Lalu)
$diff_bulan = $row['omset_bulan_ini'] - $row['omset_bulan_lalu'];
$pct_bulan = 0;
$cls_bulan = 'text-muted';
$ico_bulan = 'fa-minus';
if($row['omset_bulan_lalu'] > 0) {
$pct_bulan = round(($diff_bulan / $row['omset_bulan_lalu']) * 100, 1);
} elseif($row['omset_bulan_ini'] > 0) {
$pct_bulan = 100;
}
if($pct_bulan > 0) { $cls_bulan='text-success'; $ico_bulan='fa-caret-up'; }
if($pct_bulan < 0) { $cls_bulan='text-danger'; $ico_bulan='fa-caret-down'; }
?>
result_array() : $cabang_stats;
foreach($data_cabang as $c):
$diff_g_harian = $gt_harian - $gt_kemarin;
$pct_g_harian = 0;
$cls_g_harian = 'text-muted';
$ico_g_harian = 'fa-minus';
if($gt_kemarin > 0) {
$pct_g_harian = round(($diff_g_harian / $gt_kemarin) * 100, 1);
} elseif($gt_harian > 0) {
$pct_g_harian = 100;
}
if($pct_g_harian > 0) { $cls_g_harian='text-success'; $ico_g_harian='fa-caret-up'; }
if($pct_g_harian < 0) { $cls_g_harian='text-danger'; $ico_g_harian='fa-caret-down'; }
// Global Bulanan (Total Bulan Ini vs Total Bulan Lalu)
$diff_g_bulan = $gt_bulan - $gt_lalu;
$pct_g_bulan = 0;
$cls_g_bulan = 'text-muted';
$ico_g_bulan = 'fa-minus';
if($gt_lalu > 0) {
$pct_g_bulan = round(($diff_g_bulan / $gt_lalu) * 100, 1);
} elseif($gt_bulan > 0) {
$pct_g_bulan = 100;
}
if($pct_g_bulan > 0) { $cls_g_bulan='text-success'; $ico_g_bulan='fa-caret-up'; }
if($pct_g_bulan < 0) { $cls_g_bulan='text-danger'; $ico_g_bulan='fa-caret-down'; }
?>
π
Rp
% vs kmrn
Kemarin
k
Bln
Jt
%
Bln
Jt
TOTAL HARI INI
Rp
% vs kmrn
Kemarin
k
Jt
%
Jt
πΊοΈ Sebaran Outlet
π° Status Order
Total
Selesai (selesai)?$status_live->selesai:0; ?>)
Proses (pending)?$status_live->pending:0; ?>)
Baru (baru)?$status_live->baru:0; ?>)
Batal (batal)?$status_live->batal:0; ?>)
0) {
$pct = round(($diff / $old) * 100, 1);
} elseif($now > 0) {
$pct = 100;
}
if($pct > 0) { $cls='text-success'; $ico='fa-arrow-up'; }
if($pct < 0) { $cls='text-danger'; $ico='fa-arrow-down'; }
return '
'.abs($pct).'%
';
}
// Pisahkan Data (Reguler vs Ojol List)
$data_reguler = ['today'=>0, 'yesterday'=>0];
$data_ojol_list = [];
if(isset($stats['types'])){
foreach($stats['types'] as $t){
if(strtolower($t['keter']) == 'reguler'){
$data_reguler = $t;
} else {
$data_ojol_list[] = $t;
}
}
}
?>
π― Ringkasan Penjualan Hari Ini
Kemarin:
REGULER
Kemarin:
TOTAL PORSI
Kemarin:
TOTAL STRUK
Kemarin:
π Statistik Penjualan
Total Omset: Rp
π Order Masuk
num_rows() : 0; ?>
num_rows() > 0): ?>
Belum ada order hari ini
result() as $o):
// Warna Icon Cabang
$color = '#'.substr(md5($o->kdcabang), 0, 6);
$st_cls = "st-3";
$st_txt = "Proses";
$alasan_batal = "";
if($o->selesai == '1') {
$st_cls = "st-1";
$st_txt = "Selesai";
}
elseif($o->selesai == '0') {
$st_cls = "st-3";
$st_txt = "Baru";
}
elseif($o->selesai == '3') {
$st_cls = "st-3";
$st_txt = "Proses";
}
elseif($o->selesai == '4') {
$st_cls = "st-4";
$st_txt = "Batal";
$alasan_batal = '
"'.$o->keter.'"
';
}
$jam_icon = !empty($o->tglbayar) ? date('H:i', strtotime($o->tglbayar)) : date('H:i', strtotime($o->waktu));
$pelanggan = !empty($o->npelanggan) ? $o->npelanggan : 'Umum';
$badge_style = "";
if($o->selesai == '0') $badge_style = "background:#4e73df; color:#fff;";
?>
#no_faktur_penjualan; ?>
nm_toko; ?>
Rp netto, 0, ',', '.'); ?>
selesai != '4'): ?>
keter; ?>
Belum ada order hari ini
π Top 5 Mie (Hari Ini)
100) ? 100 : $m['qty'];
?>
Belum ada penjualan mie hari ini
';
endif;
?>
Porsi