edit.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php use App\Utils\Url, App\Utils\Html ?>
  2. <?php $app->render('layouts/header', ['title' => 'Profile']) ?>
  3. <?php $app->render('layouts/navbar', ['app' => $app]) ?>
  4. <h1>Profile</h1>
  5. <?php $app->render('layouts/alerts/error', ['error' => $error]) ?>
  6. <?php $app->render('layouts/alerts/success', ['success' => $success]) ?>
  7. <a href="<?= Url::build('notes') ?>">
  8. < Back
  9. </a>
  10. <form method="post" action="<?= Url::build('profile/update') ?>">
  11. <fieldset>
  12. <legend>Profile editing</legend>
  13. <div class="form-group">
  14. <label for="email">
  15. Email:
  16. </label>
  17. <input
  18. type="email"
  19. id="email"
  20. name="email"
  21. placeholder="Enter your email"
  22. minlength="4"
  23. maxlength="255"
  24. required
  25. value="<?= Html::escape($userAuth['email']) ?>">
  26. <small class="text-error"><?= Html::escape($validations['email']) ?></small>
  27. </div>
  28. <div class="form-group">
  29. <label for="username">
  30. Username:
  31. </label>
  32. <input
  33. type="text"
  34. id="username"
  35. name="username"
  36. placeholder="Enter your username"
  37. minlength="4"
  38. maxlength="32"
  39. required
  40. value="<?= Html::escape($userAuth['username']) ?>">
  41. <small class="text-error"><?= Html::escape($validations['username']) ?></small>
  42. </div>
  43. <div class="form-group">
  44. <label for="password">
  45. Password:
  46. </label>
  47. <input
  48. type="password"
  49. id="password"
  50. name="password"
  51. placeholder="Enter your password"
  52. minlength="8"
  53. maxlength="64"
  54. value="">
  55. <small class="text-error"><?= Html::escape($validations['password']) ?></small>
  56. </div>
  57. <div class="form-group">
  58. <label for="pass_confirm">
  59. Confirm password:
  60. </label>
  61. <input
  62. type="password"
  63. id="pass_confirm"
  64. name="pass_confirm"
  65. placeholder="Confirm your password"
  66. minlength="8"
  67. maxlength="64"
  68. value="">
  69. <small class="text-error"><?= Html::escape($validations['pass_confirm']) ?></small>
  70. </div>
  71. <input type="hidden" name="csrf_token" value="<?= Html::escape($app->local('csrf_token') ?? null) ?>">
  72. <input type="submit" name="submit" value="Save" class="btn btn-default">
  73. </fieldset>
  74. </form>
  75. <?php $app->render('layouts/footer') ?>