@extends('layouts.master')
@section('page_title')
    @if(isset($page_title))
        {{ $page_title }}
    @endif
@endsection
@section('content')
  <div class="">
    <div class="page-title">
      <div class="title_left" style="width:800px !important;">
        <ol class="breadcrumb">
          <li><a href="{!! url('dashboard') !!}">Dashboard</a></li>
          <li><a href="{!! url('infrastructure/server-list') !!}">Server List</a></li>
          <li class="active">Updating Server</li>
        </ol>
      </div>
    </div>
    <div class="clearfix"></div>
      <div class="row">
        @include('commons.notifications')
        <div class="col-md-12 col-sm-12 col-xs-12">
          <div class="x_panel">
              <div class="x_title">
                Updating Server Details {{ $server->friendly_name }} | {{ $server->public_ip_address}} ({{ $server->private_ip_address}} )
                <div class="clearfix"></div>
              </div>
                {{-- start of content --}}
                <div class="x_content">
                  <br>
                      {!! Form::open(['url' => 'infrastructure/updateserver', 'class' => 'form-horizontal form-label-left']) !!}
                      <input type="hidden" name="server_id" value="{{ $server->id }}">
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="friendlyName">Friendly Name *</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('friendly_name') ? 'has-error' : ''}}">
                          {!! Form::text('friendly_name', $server->friendly_name, ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter partner name' , 'id' => 'friendlyName']) !!}
                          {!! $errors->first('friendly_name', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="publicIpAddress">Public IP Address </label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('public_ip_address') ? 'has-error' : ''}}">
                          {!! Form::text('public_ip_address', $server->public_ip_address, ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter Public IP Address' , 'id' => 'publicIpAddress']) !!}
                          {!! $errors->first('public_ip_address', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="privateIpAddress">Private IP Address </label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('private_ip_address') ? 'has-error' : ''}}">
                          {!! Form::text('private_ip_address', $server->private_ip_address, ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter private ip address' , 'id' => 'privateIpAddress']) !!}
                          {!! $errors->first('private_ip_address', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="mainUse">Main Use</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('main_use') ? 'has-error' : ''}}">
                          {!! Form::text('main_use', $server->main_use, ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter port number' , 'id' => 'mainUse']) !!}
                          {!! $errors->first('main_use', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="remarks">Remarks </label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('remarks') ? 'has-error' : ''}}">
                          {!! Form::text('remarks', $server->remarks, ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter remarks' , 'id' => 'remarks']) !!}
                          {!! $errors->first('remarks', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="type">Root Password</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('password') ? 'has-error' : ''}}">
                          <?php $password = ($credentials !== null) ? decrypt($credentials->password) : null;  ?>
                          {!! Form::text('password',  $password, ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter password ' , 'id' => 'password']) !!}
                          {!! $errors->first('password', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      
                      <div class="ln_solid"></div>
                      <div class="form-group">
                        <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
                          <button type="submit" class="btn btn-success btn-block"><i class="fa fa-save"></i> Update</button>
                        </div>
                      </div>
                  {!! Form::close() !!}
                </div>
                {{-- end of x_content --}}
              </div>
              {{-- end of x_panel --}}
            </div>
          </div>
          
        </div>

@endsection

@section('javascript')
<script type="text/javascript">
  $(function(){
    $('select').select2();

  });
</script>
@endsection
