@include('common.modalHead')
<div class="row">
    <div class="col-sm-12 col-md-6">
        <div class="form-group">
            <label>Nombre</label>
            <input type="text" wire:model.lazy="name" class="form-control" placeholder="ej: Alira" maxlength="99">
            @error('name')
                <span class="text-danger er">{{ $message }}</span>
            @enderror
        </div>
    </div>
    <div class="col-sm-12 col-md-6">
        <div class="form-group">
            <label>NIT</label>
            <input type="text" wire:model.lazy="nit" class="form-control" placeholder="ej: 123-456-789-1" maxlength="15">
            @error('nit')
                <span class="text-danger er">{{ $message }}</span>
            @enderror
        </div>
    </div>
    <div class="col-sm-12 col-md-6">
        <div class="form-group">
            <label>Email</label>
            <input type="email" wire:model.lazy="email" class="form-control" placeholder="ej: info@empresa.com" maxlength="99">
            @error('email')
                <span class="text-danger er">{{ $message }}</span>
            @enderror
        </div>
    </div>
    <div class="col-sm-12 col-md-6">
        <div class="form-group">
            <label>Dirección</label>
            <input type="text" wire:model.lazy="address" class="form-control" placeholder="ej: Carrera 2 #15 - 80" maxlength="99">
            @error('address')
                <span class="text-danger er">{{ $message }}</span>
            @enderror
        </div>
    </div>
    <div class="col-sm-6 col-md-6">
        <div class="mb-3">

            <div class="mb-3">
                <label class="form-label">Departamento</label>
                <select class="form-control btn-square form-select" wire:model.lazy="selectedState" name="selectedState">
                    <option value="Seleccionar" selected>Seleccionar</option>
                    @foreach ($states as $state)
                        <option value="{{ $state->code }}">{{ $state->name }}</option>
                    @endforeach
                </select>
                @error('selectedState')
                    <span class="text-danger er">{{ $message }}</span>
                @enderror

            </div>
        </div>
    </div>
    <div class="col-sm-6 col-md-6">
            <div class="mb-3">
                <label class="form-label">Ciudad</label>
                <select class="form-control btn-square form-select" wire:model.lazy="city" name="city" >
                    <option value="Seleccionar">Seleccionar</option>
                    @if (!is_null($selectedState))
                        @foreach ($cities as $city)
                            <option value="{{ $city->code }}">{{ $city->name }}</option>
                        @endforeach
                    @endif
                </select>
                @error('city_residence')
                    <span class="text-danger er">{{ $message }}</span>
                @enderror
            </div>
    </div>
    <div class="col-sm-12 col-md-6">
        <div class="form-group">
            <label>Teléfono</label>
            <input type="text" wire:model.lazy="phone" class="form-control" placeholder="ej: 3202568745"
                maxlength="15">
            @error('phone')
                <span class="text-danger er">{{ $message }}</span>
            @enderror
        </div>
    </div>
    <div class="col-sm-12 col-md-6">
        <div class="form-group">
            <label>Logo</label>
            <small class="text-muted">(Formatos: .jpg | .png )</small>
            <input type="file" wire:model="image" class="form-control" accept=".png, .jpg">
            @error('image')
                <span class="text-danger er">{{ $message }}</span>
            @enderror
        </div>
    </div>
    <div class="col-sm-12 col-md-12">
        <hr class="mb-2">
    </div>
    <div class="col-sm-12 col-md-6">
        <div class="form-group">
            <label>Nombre del Representante Legal</label>
            <input type="text" wire:model.lazy="legal_representative" class="form-control" placeholder="ej: Pedro Perez" maxlength="100">
            @error('legal_representative')
                <span class="text-danger er">{{ $message }}</span>
            @enderror
        </div>
    </div>
    <div class="col-sm-12 col-md-6">
        <div class="form-group">
            <label class="form-label">Tipo documento</label>
                <select class="form-control form-select" wire:model.lazy="document_type_representative" name="document_type_representative">
                    <option value="Seleccionar">Seleccionar</option>
                    @foreach (DataTypeDocument() as $key => $value)
                        <option value="{{ $key }}">{{ $value }}</option>
                    @endforeach
                </select>
                @error('document_type_representative')
                    <span class="text-danger er">{{ $message }}</span>
                @enderror
        </div>
    </div>
    <div class="col-sm-12 col-md-6">
        <div class="form-group">
            <label>Documento</label>
            <input type="text" wire:model.lazy="document_representative" class="form-control" placeholder="ej: 123456789" maxlength="15">
            @error('document_representative')
                <span class="text-danger er">{{ $message }}</span>
            @enderror
        </div>
    </div>
    <div class="col-sm-12 col-md-6">
        <div class="form-group">
            <label>Lugar de Expedición </label>
            <input type="text" wire:model.lazy="document_expedition_representative" class="form-control" placeholder="ej: Bogotá" maxlength="100">
            @error('document_expedition_representative')
                <span class="text-danger er">{{ $message }}</span>
            @enderror
        </div>
    </div>
    <div class="col-sm-12 col-md-6">
        <div class="form-group">
            <label>Firma</label>
            <small class="text-muted">(Formatos: .jpg | .png ) Tamaño (350px x 180px)</small>
            <input type="file" wire:model="signature" class="form-control" accept=".png, .jpg">
            @error('signature')
                <span class="text-danger er">{{ $message }}</span>
            @enderror
        </div>
    </div>
    <div class="col-sm-12 col-md-12">
        <hr class="my-4">
        <h5 class="text-center text-muted mb-4">Información del Plan</h5>
    </div>
    <div class="col-sm-12 col-md-6">
        <div class="form-group">
            <label>Tipo de Plan</label>
            <select class="form-control btn-square form-select" wire:model.lazy="plan_id" name="plan_id">
                <option value="Seleccionar" selected>Seleccionar</option>
                @foreach ($plans as $plan_type)
                    <option value="{{ $plan_type->id }}">{{ $plan_type->name }}</option>
                @endforeach
            </select>
            @error('plan_id')
                <span class="text-danger er">{{ $message }}</span>
            @enderror
        </div>
    </div>
    <div class="col-sm-12 col-md-6">
        <div class="form-group">
            <label>Estado del Plan</label>
            <select class="form-control btn-square form-select" wire:model.lazy="plan_payment_status" name="plan_payment_status">
                <option value="Seleccionar" selected>Seleccionar</option>
                <option value="1">Activo</option>
                <option value="0">Inactivo</option>
            </select>
            @error('plan_payment_status')
                <span class="text-danger er">{{ $message }}</span>
            @enderror
        </div>
    </div>

</div>
@include('common.modalFooter')
