@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 class="active">Add Direct Connection</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 Direct Connection {{ $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/storedirect', 'class' => 'form-horizontal form-label-left', 'files' => 'true']) !!}
                      <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="directPartner">Partner Name *</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('direct_partner') ? 'has-error' : ''}}">
                          {!! Form::text('direct_partner', old('direct_partner'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter partner name' , 'id' => 'directPartner']) !!}
                          {!! $errors->first('direct_partner', '<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="email">Connection Type *</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('name') ? 'has-error' : ''}}">
                          {!! Form::select('connection_type', $connection_types ,old('connection_type'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Select one' , 'id' => 'connectionType']) !!}
                          
                          {!! $errors->first('emaconnection_typeil', '<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="mainIpAddress">IP Address </label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('main_ip_address') ? 'has-error' : ''}}">
                          {!! Form::text('main_ip_address', old('main_ip_address'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter main_ip_address' , 'id' => 'mainIpAddress']) !!}
                          {!! $errors->first('main_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="portNumber">Port Number</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('port') ? 'has-error' : ''}}">
                          {!! Form::text('port', old('port'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter port number' , 'id' => 'portNumber']) !!}
                          {!! $errors->first('port', '<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="peerVpnIp">VPN Peer IP </label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('vpn_peer_ip') ? 'has-error' : ''}}">
                          {!! Form::text('vpn_peer_ip', old('vpn_peer_ip'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter peer vps ip' , 'id' => 'peerVpnIp']) !!}
                          {!! $errors->first('vpn_peer_ip', '<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">Domain Name</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('domain_name') ? 'has-error' : ''}}">
                          {!! Form::text('domain_name', old('domain_name'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter domain name ' , 'id' => 'domainName']) !!}
                          {!! $errors->first('domain_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="connectionForm">VPN Form</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('connection_form') ? 'has-error' : ''}}">
                          {!! Form::file('connection_form', null, ['class' => 'form-control col-md-7 col-xs-12' , 'id' => 'connectionForm']) !!}
                          {!! $errors->first('connection_form', '<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"><i class="fa fa-save"></i> Submit</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
