@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('systemcreds') !!}">Credentials List</a></li>
          <li class="active">Add Credentials</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">
                Add Credentials
                <div class="clearfix"></div>
              </div>
                {{-- start of content --}}
                <div class="x_content">
                  <br>
                      {!! Form::open(['url' => 'systemcreds', 'class' => 'form-horizontal form-label-left']) !!}
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="serviceName">Service *</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('service') ? 'has-error' : ''}}">
                          {!! Form::select('service', $services, old('service'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Select Service Type' , 'id' => 'serviceName']) !!}
                          {!! $errors->first('service', '<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="clientID">Client Name *</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('client') ? 'has-error' : ''}}">
                          {!! Form::select('client_id', $clients, old('client_id'),  ['class' => 'form-control', 'placeholder'=>'Select Client' , 'id' => 'clientID', 'required' => 'true']) !!}
                          {!! $errors->first('client_id', '<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="networkOpsID">Network Operator *</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('network_operator_id') ? 'has-error' : ''}}">
                          {!! Form::select('network_operator_id', $network_arr, old('network_operator_id'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Select Network ' , 'id' => 'networkOpsID', 'required' => 'true']) !!}
                          {!! $errors->first('network_operator_id', '<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="UrlEndpoint">URL/Endpoint *</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('url_endpoint') ? 'has-error' : ''}}">
                          {!! Form::text('url_endpoint', old('url_endpoint'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter url/endpoint' , 'id' => 'UrlEndpoint']) !!}
                          {!! $errors->first('url_endpoint', '<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="credentials">Credentials *</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('main_use') ? 'has-error' : ''}}">
                          {!! Form::textarea('credentials', old('credentials'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter main credentials' ,  'rows' => '4', 'id' => 'credentials']) !!}
                          {!! $errors->first('credentials', '<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="expiryDate">Expiry Date *</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('main_use') ? 'has-error' : ''}}">
                          {!! Form::text('expiry_date', old('expiry_date'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Select date' , 'id' => 'expiryDate']) !!}
                          {!! $errors->first('expiry_date', '<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::textarea('remarks', old('remarks'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter remarks' ,  'rows' => '3', 'id' => 'remarks']) !!}
                          {!! $errors->first('remarks', '<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();
    $('#expiryDate').datetimepicker({
        format: 'YYYY-MM-DD'
    });
  });
</script>
@endsection
