<?php
echo "<h2>DEBUG SESSION KASIR</h2>";
echo "<pre>";
echo "iduser    : " . $this->session->userdata('iduser') . "\n";
echo "role_name : " . $this->session->userdata('role_name') . "\n";
echo "idoutlet  : " . $this->session->userdata('idoutlet') . "\n";
echo "outlet_name: " . $this->session->userdata('outlet_name') . "\n";
echo "</pre>";

// Cek DSTB di database untuk outlet ini
$idoutlet = $this->session->userdata('idoutlet');
if ($idoutlet) {
    $this->db->where('idoutlet', $idoutlet);
    $this->db->order_by('iddstb_clean', 'DESC');
    $this->db->limit(10);
    $q = $this->db->get('dstb_clean');
    echo "<h3>DSTB untuk outlet $idoutlet:</h3>";
    echo "<pre>";
    print_r($q->result());
    echo "</pre>";
} else {
    echo "<h3 style='color:red'>idoutlet KOSONG! Ini penyebab DSTB tidak muncul.</h3>";
}
?>