<?php
defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * @property Receipt_model $Receipt_model
 */
class Menu_badge_notification extends MY_ApiController {

    public function index()
    {
        $this->load->model('Menu_badge_notification_model');
        $items = $this->Menu_badge_notification_model->getAll($this->Menu_badge_notification_model->database, $this->Menu_badge_notification_model->tbl);
        log_message('debug', json_encode($items));
        $res = [];
        
        foreach ($items as $item) {
            $res[$item['name']] = intval($item['unread']) == 1;
        }

        echo $this->respond($res);
    }
}
