application/modules/vehicle/models/Notifikasi_vehicle.php
// count notifikasi unit yang habis surat menyurat
count notifikasi unit yang habis surat menyurat
count notifikasi unit yang habis surat menyurat
public function notif_vehdoc()
        {
          $query = $this->db->query('
      select  COUNT(a.show_notif) AS notif FROM
(SELECT id_document, doc_no, nap, doc_type, valid_until, DATEDIFF(valid_until, CURDATE()) AS due_date, status, CASE
  WHEN DATEDIFF(valid_until, CURDATE()) <= 60 THEN "1"
  ELSE "0"
  END AS show_notif FROM document_vehicle
  WHERE STATUS not in ("closed","approve")
  AND DATEDIFF(valid_until, CURDATE()) > 0) a
  WHERE a.show_notif = 1');
          return $query->result();
        }
public function notif_vehdoc ( ) { $ query = $ this -> db -> query ( '
      select  COUNT(a.show_notif) AS notif FROM
(SELECT id_document, doc_no, nap, doc_type, valid_until, DATEDIFF(valid_until, CURDATE()) AS due_date, status, CASE
  WHEN DATEDIFF(valid_until, CURDATE()) <= 60 THEN "1"
  ELSE "0"
  END AS show_notif FROM document_vehicle
  WHERE STATUS not in ("closed","approve")
  AND DATEDIFF(valid_until, CURDATE()) > 0) a
  WHERE a.show_notif = 1' ) ; return $ query -> result ( ) ; }
count notifikasi unit yang habis surat menyurat
count notifikasi unit yang habis surat menyurat
//SELECT COUNT(*) AS total FROM document_status /* query akan menampilkan kontrak karyawan selain status closed, dan hanya akan menampilkan status show_notif 1 jika due datenya <= 30 hari dari end_date contract
       untuk yang due date nya minus (-) diharuskan di closed statusnya agar tidak tampil di notifikasi*/