
@extends('layouts.master')

@section('style')


@endsection
@section('content')
@if (count($errors) > 0)
    <div class="alert alert-danger">
        <strong>Whoops!</strong> There were some problems with your input.<br><br>
        <ul>
                @foreach ($errors->all() as $error)
                        <li>{{ $error }}</li>
                @endforeach
        </ul>
    </div>
@endif
@if ($message = Session::get('success'))
    <div class="alert alert-success">
            <p>{{ $message }}</p>
    </div>
@endif
<div class="panel">
    <div class="panel-body" role="document">
        <div class="">
          <div class="modal-body">
            <h2 class="text-center" id="gridSystemModalLabel">{{$user_info->name}}'s Profile</h2>
            <form role="form" action="{{url('user/update_profile')}}" method="POST" enctype="multipart/form-data">
                {!! csrf_field() !!}
                <div class="row">
                    <div class="col-md-12">
                        <div class="form-group pull-right">
                            <label>Current User Image:</label>
                            <img class="img img-responsive" style="max-height: 100px;" 
                                @if(file_exists(public_path('user/'.$user_info->image)))
                                        src="{{ asset('/public/user/'.$user_info->image) }}"
                                @else
                                    src="{{ asset('/assets/others/default.jpg') }}"
                                @endif
                            >
                        </div>
                        <div class="form-group">
                            <label>Change User Image:</label><br><br>
                            <input type="file" name="user_image">
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <div class="col-md-6">
                            <div class="form-group">
                                <label>
                                    Present Address <span style="color:red">(required *)</span>
                                </label>
                                <textarea class="form-control" name="address" placeholder="Enter Your Present Address" required="">{{$user_info->address}}</textarea>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label>
                                    Permanent Address <span style="color:red">(required *)</span>
                                </label>
                                <textarea class="form-control" name="per_address" placeholder="Enter Your Permanent Address" required="">{{$user_info->per_address}}</textarea>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <div class="col-md-6">
                            <div class="form-group">
                                <label>
                                    Phone 1 <span style="color:red">(required *)</span>
                                </label>
                                <input name="mob" class="form-control"  placeholder="Enter Your Phone Number 1" value="{{$user_info->mob}}" required="" type="text">
                                
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label>
                                    Phone 2 
                                </label>
                                <input name="mob2" class="form-control"  placeholder="Enter Your Phone Number 2" value="{{$user_info->mob2}}"  type="text">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <div class="col-md-6">
                            <div class="form-group">
                                <label>
                                    Personal Email <span style="color:red">(required *)</span>
                                </label>
                                <input name="email" class="form-control"  placeholder="Enter Your Personal Email" value="{{$user_info->email}}" required="" type="email">
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label>
                                    Official Email 
                                </label>
                                <input name="email2" class="form-control"  placeholder="Official Email" value="{{$user_info->email2}}"  type="email">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <div class="col-md-6">
                            <div class="form-group">
                                <label>
                                    Joining Date <span style="color:red">(required *)</span>
                                </label>
                                <input type="text" id="test" name="joining_date" class="form-control" placeholder="Enter Your Joining Date" value="{{$user_info->joining_date}}" required="">
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label>
                                    Facebook <span style="color:red">(required *)</span>
                                </label>
                                <input name="fb" class="form-control"  placeholder="Your Facebook Address" value="{{$user_info->fb}}" required="" type="text">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <div class="col-md-6">
                            <div class="form-group">
                                <label>
                                    Skype 
                                </label>
                                <input type="text" name="skype" class="form-control" placeholder="Enter Your Skype Address" value="{{$user_info->skype}}" >
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label>
                                    LinkedIn <span style="color:red">(required *)</span>
                                </label>
                                <input name="linkedIn" class="form-control"  placeholder="Your LinkedIn Address" value="{{$user_info->linkedin}}" required="" type="text">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <div class="col-md-6">
                            <div class="form-group">
                                <label>
                                    Emergency Contact Person <span style="color:red">(required *)</span>
                                </label>
                                <input type="text" name="emrgncy_contact" class="form-control" placeholder="Enter Your Emergency Contact Person" value="{{$user_info->emrgncy_contact}}" required="">
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label>
                                    Emergency Contact Person's Phone <span style="color:red">(required *)</span>
                                </label>
                                <input name="emrgncy_contact_phone" class="form-control"  placeholder="Your Emergency Contact Person's Phone Number " value="{{$user_info->emrgncy_contact_phone}}" required="" type="text">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <button type="submit" class="btn btn-primary pull-right">Update Profile</button>
                    </div>
                </div>
          
            
          </div>
          </form>  
        </div>
    </div>
</div>
@endsection
@section('script')
<link rel="stylesheet" href="{{ URL::asset('assets/css/jquery.datetimepicker.css') }}">
<script type="text/javascript" src="{{ URL::asset('assets/js/jquery.datetimepicker.full.min.js') }}"></script>
<!--<script src="{{URL::asset('assets/dropzone.js')}}" type="text/javascript"></script>
<script src="{{URL::asset('assets/ckeditor/ckeditor.js')}}"></script>-->
<script type="text/javascript">
    $(document).ready(function(){
        $( "#test" ).datetimepicker({

        });
        
        //CKEDITOR.replace( 'editor1' );
    });

</script>
@endsection