# Sys Admin Panel - Kaabil Recruiter ATS

**Created:** December 12, 2025
**Location:** `/public/sysadmin/`

## Access

- **URL:** `https://recruiter:8890/public/sysadmin/`
- **Login:** `sysadmin` / `t@lkb@ck`

## Features

### 1. Dashboard (`dashboard.php`)
- Key metrics overview: Verified Companies, Active Jobs, Applications (30 days), Recruiters
- Applications Today & Selected This Month quick stats
- Recent 10 applications with status
- Top 5 companies by applications (last 30 days)

### 2. Applicant Tracker (`applicant-tracker.php`)
- Full applicant listing with server-side pagination
- **Filters:**
  - Company dropdown (verified companies only)
  - Application stage (Applied, Shortlisted, Waitlist, Rejected, Selected)
  - Date range (7/30/90 days or custom)
- **Export:** CSV and Excel with UTF-8 support
- Click-through stats cards to filter by stage

### 3. Job Reports (`job-reports.php`)
- Complete job listing with application stats
- **Filters:**
  - Company dropdown
  - Status (Active, Paused, Expired)
  - Date range
- **Job Actions:**
  - View full job details (click title or eye icon)
  - Extend job (7/14/30/60/90 days) - preserves same Job ID
  - Pause active jobs
  - Activate paused jobs
- **Job Details Modal:** Shows all fields including:
  - Job info (location, department, salary, experience, positions)
  - Dates (posted, created, expiry)
  - Posted by (name + mobile)
  - Share URL (`https://kaabilprogram.org/job/{encrypted_id}`)
  - Live application stats (Applied, Shortlisted, Selected, Rejected)
- **Export:** CSV and Excel

### 4. Companies (`companies.php`)
- Grid view of all verified companies
- Stats per company: Admin count, Active Jobs, Total Applications
- Search filter
- Shows Verified and Marquee badges

### 5. Admins (`admins.php`)
- List of all recruiters with company access
- Shows role type (Admin, Co-Admin, Sub-Admin)
- Company association

## Technical Notes

### Verified Companies Logic
All pages use consistent company verification:
```sql
WHERE status = 1 AND (is_company_verified_by_admin = 1 OR is_marquee_company = 1)
```
This returns **62 verified companies** (matching main dashboard).

### Job Status Values
- `2` = Active
- `3` = Paused
- `4` = Expired

### Application Status Values
- `0, 1` = Applied
- `2` = Shortlisted
- `3` = Rejected
- `6` = Waitlist
- `7` = Selected

### Job Extension
- Updates `status = 2` and `job_expiry` only
- **Same Job ID is preserved** - no new job post created
- Works for both expired and active jobs

### Share URL Format
```
https://kaabilprogram.org/job/{ENCRYPTED_JOB_ID}
```
Example: `https://kaabilprogram.org/job/F1T2uRRUl6GkpMz3jyOzew==`

## File Structure

```
/public/sysadmin/
├── includes/
│   ├── auth.php        # Session auth (sysadmin / t@lkb@ck)
│   ├── header.php      # Purple neumorphic theme, sidebar nav
│   └── footer.php      # jQuery, Bootstrap, DataTables, Toastr
├── login.php           # Login page
├── logout.php          # Logout handler
├── dashboard.php       # Main dashboard
├── applicant-tracker.php  # Applicant management
├── job-reports.php     # Job management with extend/pause
├── companies.php       # Company listing
├── admins.php          # Recruiter admin listing
└── README.md           # This file
```

## Styling

- Purple neumorphic theme matching main ATS (`#8b5cf6`, `#6c49b8`)
- Compact DataTables with 50 rows default
- Responsive sidebar navigation
- Status badges with color coding

## Database

Uses production AWS RDS:
- **Host:** `kaabil-prod-db.c1asckcosor2.ap-south-1.rds.amazonaws.com`
- **Database:** `me_prod`
- **Config:** `../../app/config/database.php`

## Dependencies

- Bootstrap 5.3
- jQuery 3.7
- DataTables 1.13.7
- Font Awesome 6
- Toastr (notifications)
