<?php
$active = 'home';
$pageTitle = 'New Hire — Employee Onboarding';
require __DIR__ . '/../layout/workspace_header.php';
?>
<div class="topbar">
  <div><h1>Add New Hire</h1><div class="crumbs"><a href="/onboarding" style="color:var(--blue-600);">Employee Onboarding</a> → New Hire</div></div>
</div>
<div class="card">
  <form method="POST" action="/onboarding/new/save">
    <div class="field-row" style="display:grid;grid-template-columns:1fr 1fr;gap:12px;">
      <div class="field"><label>First name</label><input type="text" name="first" required></div>
      <div class="field"><label>Last name</label><input type="text" name="last" required></div>
      <div class="field"><label>Middle name</label><input type="text" name="middle"></div>
      <div class="field"><label>Phone</label><input type="text" name="phone"></div>
      <div class="field" style="grid-column:1/3;"><label>Email</label><input type="email" name="email" required></div>
      <div class="field" style="grid-column:1/3;"><label>Address</label><input type="text" name="address"></div>
      <div class="field"><label>City</label><input type="text" name="city"></div>
      <div class="field"><label>State</label><input type="text" name="state" value="CA" maxlength="2"></div>
      <div class="field"><label>Zip</label><input type="text" name="zip"></div>
      <div class="field"><label>BSIS Guard Card #</label><input type="text" name="guard_card"></div>
      <div class="field"><label>Guard Card Expiry</label><input type="date" name="guard_card_exp"></div>
      <div class="field"><label>Driver's License #</label><input type="text" name="dl"></div>
      <div class="field"><label>DL Expiry</label><input type="date" name="dl_exp"></div>
      <div class="field"><label>Firearms Permit</label>
        <select name="firearms_permit" style="width:100%;padding:10px;border:1px solid var(--border);border-radius:10px;"><option>No</option><option>Yes</option></select>
      </div>
      <div class="field"><label>Job title</label><input type="text" name="position" value="Security Officer"></div>
      <div class="field"><label>Job site</label><input type="text" name="site"></div>
      <div class="field"><label>Hire type</label><input type="text" name="hire_type" value="New Hire" readonly></div>
      <div class="field"><label>Employment status</label>
        <select name="emp_status" style="width:100%;padding:10px;border:1px solid var(--border);border-radius:10px;"><option>Full-Time</option><option>Part-Time</option><option>On-Call / At-Will</option></select>
      </div>
      <div class="field"><label>Date of hire</label><input type="date" name="hire_date"></div>
      <div class="field"><label>Pay rate</label><input type="text" name="pay_rate" placeholder="e.g. 22.00/hr" required></div>
      <div class="field"><label>Pay frequency</label>
        <select name="pay_freq" style="width:100%;padding:10px;border:1px solid var(--border);border-radius:10px;"><option>Weekly</option><option>Bi-Weekly</option><option>Semi-Monthly</option><option>Monthly</option></select>
      </div>
      <div class="field"><label>HR representative</label><input type="text" name="hr_rep" value="<?= htmlspecialchars($user['name'] ?? '') ?>"></div>
    </div>
    <div class="modal-actions" style="margin-top:20px;">
      <a href="/onboarding" class="btn-secondary" style="text-decoration:none;">Cancel</a>
      <button type="submit" class="btn-primary">Save &amp; Continue</button>
    </div>
  </form>
</div>
<?php require __DIR__ . '/../layout/admin_footer.php'; ?>
