@extends('backend.layouts.app')
@section('content')
<div class="row page-titles">
   <div class="col-md-5 align-self-center">
      <h4 class="text-themecolor">Edit SMTP</h4>
   </div>
   <div class="col-md-7 align-self-center text-right">
      <div class="d-flex justify-content-end align-items-center">
         <ol class="breadcrumb">
                       <li class="breadcrumb-item"><a href="{{route('dashboard')}}">Dashboard</a></li>
            <li class="breadcrumb-item active">State</li>
         </ol>
      </div>
   </div>
</div>
<div class="container-fluid">
@if (session('status'))
            <div class="alert alert-success alert-dismissible fade show" role="alert"><i class="far fa-check-circle"></i>
                {{ session('status') }}
                <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
        @endif
        @if (session('error'))
        <div class="alert alert-danger alert-dismissible fade show" role="alert"><i class="far fa-check-circle"></i>
            {{ session('error') }}
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
        </div>
    @endif
    <div class="row">
        <div class="col-md-12">
            <!-- general form elements -->
            <div class="card card-primary">
            <form action="{{ route('smtp_mails.update') }}" method="POST">
                    @csrf
                    @method('POST')
                    <div class="card-body">
                            <div class="col-sm-12">
                               
                            <div class="form-group">
                                <label for="host_name">Host Name</label>
                                <input type="text" name="host_name" id="host_name" class="form-control" value="{{ $smtpMail->host_name }}" required>
                                @error('host_name')
                                    <p style="color:red;">{{ $message }}</p>
                                @enderror
                            </div>
                            
                            
                            
                            
                          
                            </div>


                            <div class="col-sm-12">
                            <div class="form-group">
            <label for="username">Username</label>
            <input type="text" name="username" id="username" class="form-control" value="{{ $smtpMail->username }}" required>
            @error('username')
                <p style="color:red;">{{ $message }}</p>
            @enderror
        </div>
                            </div>

                            <div class="col-sm-12">
                            <div class="form-group">
            <label for="password">Password</label>
            <input type="password" name="password" id="password" class="form-control" value="{{ $smtpMail->password }}">
            @error('password')
                <p style="color:red;">{{ $message }}</p>
            @enderror
        </div>
                                </div>

                                <div class="col-sm-12">
                                <div class="form-group">
            <label for="port">Port</label>
            <input type="number" name="port" id="port" class="form-control" value="{{ $smtpMail->port }}" required>
            @error('port')
                <p style="color:red;">{{ $message }}</p>
            @enderror
        </div>
                                </div>


                                <div class="col-sm-6">
                                <div class="form-group">
            <div class="form-check">
                <input type="checkbox" name="smtp_tls" id="smtp_tls" class="form-check-input" {{ $smtpMail->smtp_tls ? 'checked' : '' }}>
                <label class="form-check-label" for="smtp_tls">Use TLS</label>
            </div>
        </div>
                                </div>
                                <div class="col-sm-12">
                                <div class="col-sm-6">
                                <div class="form-group">
            <div class="form-check">
                <input type="checkbox" name="status" id="status" class="form-check-input" {{ $smtpMail->status ? 'checked' : '' }}>
                <label class="form-check-label" for="status">Active</label>
            </div>
        </div>
                                </div>
                    </div>
                    
                    <div class="card-body">
                    <button type="submit" class="btn btn-primary">Update</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
@stop

