Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

84 lignes
3.6KB

  1. <section class="section-panel">
  2. <div class="panel-header">
  3. <h2>Add Employee</h2>
  4. <p>Store a clean employee record with basic contact and role details.</p>
  5. </div>
  6. <?php if ($model->saved): ?>
  7. <div class="alert alert-success" x-data="{ open: true }" x-show="open" x-transition.opacity x-init="setTimeout(() => open = false, 3500)">
  8. Employee information was saved to SQLite successfully.
  9. </div>
  10. <?php endif; ?>
  11. <?php if (isset($model->errors['_token'])): ?>
  12. <div class="alert alert-error"><?= e($model->errors['_token'][0]) ?></div>
  13. <?php endif; ?>
  14. <form
  15. method="post"
  16. action="/employees"
  17. class="employee-form"
  18. novalidate
  19. hx-post="/employees"
  20. hx-target="#employee-form-panel"
  21. hx-swap="outerHTML"
  22. >
  23. <?= csrf_field() ?>
  24. <div class="form-grid">
  25. <label class="field">
  26. <span>First name</span>
  27. <input class="input" type="text" name="first_name" maxlength="100" value="<?= e($model->form['first_name']) ?>" required>
  28. <?php if (isset($model->errors['first_name'])): ?>
  29. <small class="field-error"><?= e($model->errors['first_name'][0]) ?></small>
  30. <?php endif; ?>
  31. </label>
  32. <label class="field">
  33. <span>Last name</span>
  34. <input class="input" type="text" name="last_name" maxlength="100" value="<?= e($model->form['last_name']) ?>" required>
  35. <?php if (isset($model->errors['last_name'])): ?>
  36. <small class="field-error"><?= e($model->errors['last_name'][0]) ?></small>
  37. <?php endif; ?>
  38. </label>
  39. <label class="field">
  40. <span>Email</span>
  41. <input class="input" type="email" name="email" maxlength="255" value="<?= e($model->form['email']) ?>" required>
  42. <?php if (isset($model->errors['email'])): ?>
  43. <small class="field-error"><?= e($model->errors['email'][0]) ?></small>
  44. <?php endif; ?>
  45. </label>
  46. <label class="field">
  47. <span>Department</span>
  48. <input class="input" type="text" name="department" maxlength="100" value="<?= e($model->form['department']) ?>" required>
  49. <?php if (isset($model->errors['department'])): ?>
  50. <small class="field-error"><?= e($model->errors['department'][0]) ?></small>
  51. <?php endif; ?>
  52. </label>
  53. <label class="field">
  54. <span>Job title</span>
  55. <input class="input" type="text" name="job_title" maxlength="150" value="<?= e($model->form['job_title']) ?>" required>
  56. <?php if (isset($model->errors['job_title'])): ?>
  57. <small class="field-error"><?= e($model->errors['job_title'][0]) ?></small>
  58. <?php endif; ?>
  59. </label>
  60. <label class="field">
  61. <span>Start date</span>
  62. <input class="input" type="date" name="start_date" value="<?= e($model->form['start_date']) ?>" required>
  63. <?php if (isset($model->errors['start_date'])): ?>
  64. <small class="field-error"><?= e($model->errors['start_date'][0]) ?></small>
  65. <?php endif; ?>
  66. </label>
  67. </div>
  68. <div class="form-actions">
  69. <button class="button button-primary" type="submit">Save Employee</button>
  70. <span class="inline-indicator htmx-indicator">Saving employee...</span>
  71. </div>
  72. </form>
  73. </section>

Powered by TurnKey Linux.