@extends('Admin.master_page')

@section('title') <h5 class="m-0 font-weight-bold text-primary" style="float: left;">Domain Update</h5> 

<a href="{{ route('DomainSale.index') }}" style="float: right;"><i class="fas fa-chevron-circle-left"></i></a>
@endsection

@section('content')

<div class="intro-y box"> 
        
        <form action="{{ route('DomainSale.update' , $domain->id) }}" method="POST">
            @csrf


            <input type="hidden" name="_method" value="put">
        <label for="Name" >Name:</label>
        <div class="input-group" style="margin-top: 10px;">
           <input type="text" name="name" value="{{ $domain->name }}" class="form-control" placeholder="Domain Name">
            @error('name')
            <span class="alert-danger">{{ $message }}</span>
            @enderror
        </div>

        <br>

        <label >Short Description:</label>
        <div class="input-group" style="margin-top: 10px;">
           <textarea name="short_description" id="editor">{{ $domain->short_description }}</textarea>
            @error('short_description')
            <span class="alert-danger">{{ $message }}</span>
            @enderror
        </div>

        <br>

        <label  >Full Description:</label>
        <div class="input-group" style="margin-top: 10px;">
           <textarea name="full_description" id="editor2">{{ $domain->full_description }}</textarea>
            @error('full_description')
            <span class="alert-danger">{{ $message }}</span>
            @enderror
        </div>

        <br>

        <label>Price:</label>
        <div class="input-group" style="margin-top: 10px;">
           <input type="text" name="price" value="{{ $domain->price }}" class="form-control" placeholder="Price $">
            @error('price')
            <span class="alert-danger">{{ $message }}</span>
            @enderror
        </div>

        <br>

        <label>Registrar Name:</label>
        <div class="input-group" style="margin-top: 10px;">
           <input type="text" name="registrar" value="{{ $domain->registrar }}" class="form-control" placeholder="Registrar">
            @error('registrar')
            <span class="alert-danger">{{ $message }}</span>
            @enderror
        </div>

        <br>
        

        <label>Registrar Date:</label>
        <div class="input-group" style="margin-top: 10px;">
           <input type="date" name="registrar_date" value="{{ $domain->registrar_date }}" class="form-control" placeholder="Registrar Date">
            @error('registrar_date')
            <span class="alert-danger">{{ $message }}</span>
            @enderror
        </div>

        <br>

        <label >Status:</label>
        <div class="input-group" style="margin-top: 10px;">
           <select class="form-control" name="status" >
               <option value="">Please Select one</option>
               <option value="1" @if($domain->status == 1) selected @endif>Available</option>
               <option value="2" @if($domain->status == 2) selected @endif>Sold</option>
           </select>
            @error('status')
            <span class="alert-danger">{{ $message }}</span>
            @enderror
        </div>

        <br>
        
        <label>URL:</label>
        <div class="input-group" style="margin-top: 10px;">
           <input type="text" name="url" value="{{ $domain->url }}"  class="form-control" placeholder="Domain URL">
            @error('url')
            <span class="alert-danger">{{ $message }}</span>
            @enderror
        </div>

        <br>

        <button type="submit" class="btn btn-primary">Update</button>
        </form>
    </div>



@endsection