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

{% block title %}{{ lang.settings }}{% endblock %}

{% block content %}
    <div class="page-wrapper">
        <div class="page-content">

            <!--breadcrumb-->
            <div class="page-breadcrumb d-none d-sm-flex align-items-center mb-3">
                <div class="breadcrumb-title pe-3"><a href="#" class="text-dark">{{ lang.settings }}</a></div>
                <div class="ps-3">
                    <nav aria-label="breadcrumb">
                        <ol class="breadcrumb mb-0 p-0">
                            <li class="breadcrumb-item active" aria-current="page">{{ lang.update }}</li>
                        </ol>
                    </nav>
                </div>
            </div>
            <!--end breadcrumb-->

            <div class="row">
                <div class="col-xl-7 mx-auto">
                    {% include'partials/flash.twig' %}
                    <div class="card border shadow-none">
                        {% if hasRole('super_admin') %}
                        <div class="card-body p-5">
                            <form class="row g-3" method="post" action="{{ route('settings') }}">
                                {{ csrf.field | raw }}
                                <div class="col-md-12">
                                    <label for="CPANEL_DOMAIN" class="form-label">Domain</label>
                                    <input type="text" value="{{ data.CPANEL_DOMAIN }}" class="form-control {{ errors.CPANEL_DOMAIN ? ' is-invalid' : '' }}" id="CPANEL_DOMAIN" name="CPANEL_DOMAIN">
                                    {% if errors.CPANEL_DOMAIN %}
                                        <div class="invalid-feedback">{{ errors.CPANEL_DOMAIN | first }}</div>
                                    {% endif %}
                                </div>
                                <div class="col-md-12">
                                    <label for="CPANEL_USERNAME" class="form-label">Cpanel Username</label>
                                    <input type="text" value="{{ data.CPANEL_USERNAME }}" class="form-control {{ errors.CPANEL_USERNAME ? ' is-invalid' : '' }}" id="CPANEL_USERNAME" name="CPANEL_USERNAME">
                                    {% if errors.CPANEL_USERNAME %}
                                        <div class="invalid-feedback">{{ errors.CPANEL_USERNAME | first }}</div>
                                    {% endif %}
                                </div>
                                <div class="col-md-12">
                                    <label for="CPANEL_PASSWORD" class="form-label">Cpanel Password</label>
                                    <input type="password" value="{{ data.CPANEL_PASSWORD }}" class="form-control {{ errors.CPANEL_PASSWORD ? ' is-invalid' : '' }}" id="CPANEL_PASSWORD" name="CPANEL_PASSWORD">
                                    {% if errors.name %}
                                        <div class="invalid-feedback">{{ errors.email | first }}</div>
                                    {% endif %}
                                </div>
                                <div class="col-md-12">
                                    <label for="CPANEL_QUOTA" class="form-label">Set General Disc Quota (MB)</label>
                                    <input type="text" value="{{ data.CPANEL_QUOTA }}" class="form-control {{ errors.CPANEL_QUOTA ? ' is-invalid' : '' }}" id="CPANEL_QUOTA" name="CPANEL_QUOTA">
                                    {% if errors.CPANEL_QUOTA %}
                                        <div class="invalid-feedback">{{ errors.CPANEL_QUOTA | first }}</div>
                                    {% endif %}
                                </div>

                                <div class="col-12">
                                    <button type="submit" class="btn btn-primary px-5">{{ lang.update }}</button>
                                </div>
                            </form>
                        </div>
                        {% endif %}
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}

