@extends('layouts.master')

@section('content')
@if (session()->has('message'))
<div class="row">
        <!-- left column -->
        <div class="col-md-2"></div>
<div class="col-md-4 alert alert-success alert-dismissible" style="font-size:18px;font-weight:bold;width:400px;margin-left:15px">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                {!! session('message') !!}
              </div>
              </div> 
@endif

<div class="row">
        <!-- left column -->
        <div class="col-md-2"></div>
        <div class="col-md-8">
          <!-- general form elements -->
          <div class="box box-primary">
            <div class="box-header with-border">
              <h3 class="box-title">Edit message  </h3>
            </div>
            <!-- /.box-header -->
            <!-- form start -->
            <form   role="form" method="POST" action="{{ url('/message/edit') }}">
                        {{ csrf_field() }}
              <div class="box-body">
                
                
                
                

                 

                <div class="form-group">
                  <label for="exampleInputPassword1">message title  </label>
                  <input type="text" name="title" value="{{$message->title}}" class="form-control"  placeholder="message title" required>
                </div>


                <div class="form-group">
                  <label for="exampleInputPassword1">message body  </label>
                  <input type="text" name="body" value="{{$message->body}}" class="form-control"  placeholder="message body " required>
                </div>


                <div class="form-group">
                <label>Status   
                  <span style="background-color: #bae6fd;margin-left: 10px;border-width: 5px;border-style: solid;border-color: #bae6fd;border-radius: 22%;"> info   </span>
                  <span style="background-color: #bbf7d0;margin-left: 10px;border-width: 5px;border-style: solid;border-color: #bbf7d0;border-radius: 22%;"> success </span>
                  <span style="background-color: #fed7aa;margin-left: 10px;border-width: 5px;border-style: solid;border-color: #fed7aa;border-radius: 22%;"> warning </span>
                  <span style="background-color: #fecaca;margin-left: 10px;border-width: 5px;border-style: solid;border-color: #fecaca;border-radius: 22%;"> error </span>
              </label>
                <select class="form-control select2"  style="width: 100%;" name="status" id="status" required>
                 
                  <option value="info" {{ $message->status == 'info' ? 'selected' : ''}}> info</option>
                  <option value="success" {{ $message->status == 'success' ? 'selected' : ''}} > success</option>
                  <option value="warning" {{ $message->status == 'warning' ? 'selected' : ''}} > warning</option>
                  <option value="error" {{ $message->status == 'error' ? 'selected' : ''}}> error</option>
                  
                </select>
                </div>



               <input type="hidden" name="message_id" value="{{$message->id}}" class="form-control"  placeholder="" required>
              </div>
              <!-- /.box-body -->

              <div class="box-footer">
                <button type="submit" class="btn btn-success">Save</button>
              </div>
            </form>
          </div>    
</div>
         
      </div>

@endsection