{% extends "layouts/app.twig" %}

{% block title %}Security{% endblock %}

{% block content %}
      <div class="page-wrapper">
        <!-- Page header -->
        <div class="page-header d-print-none">
          <div class="container-xl">
            <div class="row g-2 align-items-center">
              <div class="col">
                <!-- Page pre-title -->
                <div class="page-pretitle">
                  Overview
                </div>
                <h2 class="page-title">
                  Profile
                </h2>
              </div>
            </div>
          </div>
        </div>
        <!-- Page body -->
        <div class="page-body">
          <div class="container-xl">
            <div class="card">
              <div class="row g-0">
                <div class="col-3 d-none d-md-block border-end">
                  <div class="card-body">
                    <h4 class="subheader">Settings</h4>
                    <div class="list-group list-group-transparent">
                      <a href="{{route('profile')}}" class="list-group-item list-group-item-action d-flex align-items-center{% if route_is('profile') %} active{% endif %}">My Account</a>
                      <a href="{{route('notifications')}}" class="list-group-item list-group-item-action d-flex align-items-center{% if route_is('notifications') %} active{% endif %}">Notifications</a>
                      <a href="{{route('security')}}" class="list-group-item list-group-item-action d-flex align-items-center{% if route_is('security') %} active{% endif %}">Security</a>
                      <a href="{{route('plans')}}" class="list-group-item list-group-item-action d-flex align-items-center{% if route_is('plans') %} active{% endif %}">Plans</a>
                      <a href="{{route('invoices')}}" class="list-group-item list-group-item-action d-flex align-items-center{% if route_is('invoices') %} active{% endif %}">Invoices</a>
                    </div>
                  </div>
                </div>
                <div class="col d-flex flex-column">
                  <div class="card-body">
				<form action="{{route('change.password')}}" name="register" method="post">
					{{ csrf.field | raw }}
                    <h2 class="mb-4">Security</h2>
                    <h3 class="card-title">Profile Details</h3>
                    <div class="row g-3">
                      <div class="col-md">
                        <div class="form-label">User Name</div>
						<div class="form-control-plaintext">{{ username }}</div>
                      </div>
                      <div class="col-md">
                        <div class="form-label">Email</div>
						<div class="form-control-plaintext">{{ email }}</div>
                      </div>
                      <div class="col-md">
                        <div class="form-label">Status</div>
                        <span class="badge bg-green mt-2">{{ status }}</span>
                      </div>
                      <div class="col-md">
                        <div class="form-label">Role</div>
                        <span class="badge bg-blue mt-2">{{ role }}</span>
                      </div>
                    </div>
                    <h3 class="card-title mt-4">Change Password</h3>
                    <div class="row g-3">
                      <div class="col-md">
                        <div class="form-label required">Old Password</div>
                        <input type="password" class="form-control{{ errors.old_password ? ' is-invalid' : '' }}" name="old_password" placeholder="Enter old password" required>
						{% if errors.old_password %}
							<small class="form-hint">{{ errors.old_password | first }}</small>
						{% endif %}
                      </div>
                      <div class="col-md">
                        <div class="form-label required">New Password</div>
                        <input type="password" class="form-control{{ errors.new_password ? ' is-invalid' : '' }}" name="new_password" placeholder="Enter new password" required>
						{% if errors.new_password %}
							<small class="form-hint">{{ errors.new_password | first }}</small>
						{% endif %}
                      </div>
                    </div>
                  </div>
                  <div class="card-footer bg-transparent mt-auto">
                    <div class="btn-list justify-content-end">
                      <a href="{{route('home')}}" class="btn">
                        <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-arrow-back" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M9 11l-4 4l4 4m-4 -4h11a4 4 0 0 0 0 -8h-1"></path></svg> Back
                      </a>
                      <button type="submit" class="btn btn-primary">
                        <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-refresh" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"></path><path d="M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"></path></svg> Update
                      </button>
                    </div>
                  </div>
				  </form>
                </div>
              </div>
            </div>
          </div>
        </div>
        <footer class="footer footer-transparent d-print-none">
          <div class="container-xl">
              <div class="col-12 col-lg-auto mt-3 mt-lg-0">
                <ul class="list-inline list-inline-dots mb-0">
                  <li class="list-inline-item">
                    Copyright &copy; 2023
                    <a href="https://getpinga.com" class="link-secondary">Pinga</a>.
                  </li>
                </ul>
              </div>
            </div>
          </div>
        </footer>
      </div>
{% endblock %}
