function send_notification($pdo, $type, $title, $message, $link = null, $to_user = null, $to_vendor = null, $to_staff = null) { $stmt = $pdo->prepare(" INSERT INTO notifications (user_id, vendor_id, staff_id, type, title, message, link, is_read) VALUES (?, ?, ?, ?, ?, ?, ?, 0) "); $stmt->execute([ $to_user, $to_vendor, $to_staff, $type, $title, $message, $link ]); }