{% extends 'base.html' %} {% load static %} {% block title %}Staff Dashboard - Optinet Global Links{% endblock %} {% block extra_css %} {% endblock %} {% block content %}

{% if employee_profile.department.name == 'Marketing' %} Marketing Dashboard {% elif employee_profile.department.name == 'Technician' %} Technician Dashboard {% elif employee_profile.department.name == 'HR Staff' %} HR Dashboard {% elif employee_profile.department.name == 'Billing Staff' %} Billing Dashboard {% else %} Staff Dashboard {% endif %}

{% if employee_profile %}

{{ employee_profile.full_name }} - {{ employee_profile.job_title }} {{ employee_profile.department.name|default:"No Department" }}

{% endif %}
{% if employee_profile.department.name == 'Marketing' %}
Marketing Performance
This Week
{{ reports_this_week|default:0 }}
Reports
Leads
{{ leads_generated|default:0 }}
Generated
Conversion
{{ conversion_rate|default:0 }}%
Rate
{% endif %} {% if employee_profile.department.name == 'Technician' %}
Technician Performance
Today
{{ scheduled_today|default:0 }}
Scheduled
Completed
{{ completed_today|default:0 }}
Today
Pending
{{ pending_tasks|default:0 }}
Tasks
{% endif %} {% if employee_profile.department.name == 'HR Staff' %}
HR Performance
Employees
{{ total_employees|default:0 }}
Active
Payroll
{{ pending_payslips|default:0 }}
Pending
{% endif %} {% if employee_profile.department.name == 'Billing Staff' %}
Billing Performance
Today
KSh {{ daily_collections|default:0|floatformat:0 }}
Collections
Overdue
{{ overdue_invoices|default:0 }}
Invoices
Quick Billing Actions
{% endif %}
Pending
{{ pending_tasks|default:0 }}
Open tasks
In Progress
{{ in_progress_tasks|default:0 }}
Working on
Completed
{{ completed_today|default:0 }}
Today
{{ completion_rate|default:0 }}%
Efficiency
{% if employee_profile.department.name == 'Marketing' %} Today's Marketing Tasks {% elif employee_profile.department.name == 'Technician' %} Today's Service Schedule {% else %} Today's Priority Tasks {% endif %}
View All
{% if todays_schedule %}
{% for ticket in todays_schedule %} {% endfor %}
Time Task Customer Priority Action
{{ ticket.scheduled_date|time:"H:i" }} {% if ticket.scheduled_end_time %}
{{ ticket.scheduled_end_time|time:"H:i" }} {% endif %}
{{ ticket.title|truncatechars:40 }} {% if ticket.location %}
{{ ticket.location|truncatechars:30 }} {% endif %}
{{ ticket.customer_name }} {% if ticket.contact_phone %}
{{ ticket.contact_phone }} {% endif %}
{{ ticket.get_priority_display|upper }} {% if ticket.ticket_id %} {% else %} No ID {% endif %}
{% else %}
No tasks scheduled for today

Check your schedule or pending assignments

{% endif %}
Performance Summary

{{ total_tickets|default:0 }}

Total Assigned

{% if total_tickets > 0 %} {% widthratio closed_tickets total_tickets 100 %}% {% else %} 0% {% endif %}

Completion Rate

This Week {{ completed_week|default:0 }} completed
Monthly Target {{ monthly_progress|default:0 }}%
{% if employee_profile %}
Employee ID: {{ employee_profile.employee_id }}
Department: {{ employee_profile.department.name }}
Hire Date: {{ employee_profile.hire_date|date:"M Y" }}
{% endif %}
Recent Activity
{% if recent_assignments %}
{% for ticket in recent_assignments|slice:":8" %} {% endfor %}
Task Customer Status Updated Action
{{ ticket.ticket.title|truncatechars:30 }} {% if ticket.ticket.priority == 'urgent' %} URGENT {% endif %} {{ ticket.customer_name|truncatechars:20 }} {{ ticket.ticket.get_status_display }} {{ ticket.ticket.updated_at|timesince }} ago {% if ticket.ticket.ticket_id %} {% else %} No ID {% endif %}
{% else %}
No recent activity
{% endif %}
{% if employee_profile.department.name == 'Marketing' %}
{% endif %}
{% endblock %}