<?php

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

if (!function_exists('user_save_notification')) {
    function user_save_notification($description, $staff_id, $user_name, $user_id)
    {
        $data = array(
            'isread' => 0,
            'isread_inline' => 0,
            'date' => date('Y-m-d H:i:s'),
            'description' => $description,
            'fromuserid' => $user_id,
            'fromclientid' => 0,
            'from_fullname' => $user_name,
            'touserid' => $staff_id,
            'fromcompany' => '',
        );
        return $data;
    }
}
if (!function_exists('staff_save_notification')) {
    function staff_save_notification($description, $staff_id, $user_name, $user_id)
    {
        $data = array(
            'isread' => 0,
            'isread_inline' => 0,
            'date' => date('Y-m-d H:i:s'),
            'description' => $description,
            'fromuserid' => $staff_id,
            'fromclientid' => 0,
            'from_fullname' => $user_name,
            'touserid' => $user_id,
            'fromcompany' => '',
        );
        return $data;
    }
}
if (!function_exists('response_save_notification')) {
    function response_save_notification($data)
    {
        $data = array(
            'is_read' => $data->isread,
            'isread_inline' => $data->isread_inline,
            'date' => strtotime($data->date),
            'description' => $data->description,
            'from_userid' => $data->fromuserid,
            'from_clientid' => $data->fromclientid,
            'from_fullname' => $data->from_fullname,
            'to_userid' => $data->touserid,
            'from_company' => $data->fromcompany,
        );
        return $data;
    }
}