<?php

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

class Notification_controller extends CI_Controller {
    
    public function __construct() {
        parent::__construct();
        $this->load->model('Staffapp_model');
        
        $this->load->library('session');
    }
    
    
    public function sendNotifications(){
        
        $staff = $this->Staffapp_model->get_staff_for_notifications();
        $a=false;
        foreach($staff as $s){
            $a = $this->sendStaffNotif($s['staff_id']);
            echo $s['staff_name'].' '.$a;
        }
        
    }
    
    public function sendStaffNotif($staffid){
        
        $a = $this->Staffapp_model->sentNotif('Skedwise Staff Schedule', $staffid);
        
        if($a == true){
            return 'sent';
        } else {
            return 'not sent';
        }
    }
}