<?php
use App\Models\AlertsModel;

use CodeIgniter\CodeIgniter;

 function ci_version(): string
 {
    return CodeIgniter::CI_VERSION;
 }
 
 function adalert($gr , $ty , $tx){
  $alerts = new AlertsModel();
  $cache  = array(
   'group' => $gr,
   'user'  => session()->get('id'),
   'type'  => $ty,
   'text'  => $tx,
  );
  $alerts->insert($cache);
  session()->setFlashdata('message', $tx.' TEST');
  session()->setFlashdata('alert-class', 'alert-'.$ty);
 }