@extends('admin/layouts/default')
{{-- Page title --}}
@section('title')
Add Recent Trend Article
@parent
@stop
{{-- page level styles --}}
@section('header_styles')
@include('admin.layouts.css')
<link rel="stylesheet" href="{{ asset('assets/vendors/bootstrap-tagsinput/css/bootstrap-tagsinput.css') }}" />
<link rel="stylesheet" href="{{ asset('assets/vendors/bootstrap-tagsinput/css/app.css') }}" />
<script type="text/javascript" src="{!! asset('js/angular.js') !!}"></script>
<style>
    .modal-backdrop {
        display: none;
    }
</style>

<!-- end of page level css-->
@stop
{{-- Page content --}}
@section('content')
<section class="content-header">
    <!--section starts-->
    <h1>Add New Recent Trend Article</h1>
    <ol class="breadcrumb">
        <li>
            <a href="{{ route('admin.dashboard') }}">
                <i class="livicon" data-name="home" data-size="14" data-loop="true"></i>
                Dashboard
            </a>
        </li>
        <li><a href="{{ URL::to('admin/recenttrend') }}">Recent Trend Article List</a></li>
        <li class="active">
            Add New Recent Trend Article
        </li>
    </ol>
</section>
<!--section ends-->
<section class="content paddingleft_right15">
    <!--main content-->
    <div class="row">
        <div class="panel panel-primary ">
            <div class="panel-heading">
                <h3 class="panel-title">
                    Recent Trend Article Form
                </h3>
            </div>
            <div class="panel-body">
                @if ($message = Session::get('success'))
                <div class="alert alert-success alert-dismissable">
                    <p>{{ $message }}</p>
                </div>
                @endif
                @if ($message = Session::get('error'))
                <div class="alert alert-danger alert-dismissable">
                    <p>{{ $message }}</p>
                </div>
                @endif

                <form action="{{ route('recenttrend.create') }}" method="get" id="article_frm" enctype="multipart/form-data">
                    <div class="form-group col-md-10">
                        <label class="control-label" for="select21">DOI</label>

                        <input type="text" name="doi_search" class="form-control" placeholder="Search by DOI..." @isset($param) value="{{ $param['doi_search'] }}" @endisset>
                    </div>

                    <div class="form-group col-md-2" style="margin-top: 25px;">
                        <button type="submit" class="btn btn-primary" name="frm_search" value="true">
                            <span class="glyphicon glyphicon-search"></span> Search
                        </button>
                    </div>

                </form>
                @if (count($article) > 0)
                @foreach ($article as $articles)
                <div id="banner" class="panel">
                    <div class="panel-body">
                        <div class="form-group col-md-12">
                            <label for="e1" class="control-label">Journal Title: </label>
                            <p class="form-control input-md">{{$articles->journal_title}}</p>
                        </div>

                        <div class="form-group col-md-12">
                            <label for="e1" class="control-label">Article Title:</label>
                            <p class="form-control input-md">{{$articles->title}}</p>
                        </div>

                        <div class="form-group col-md-4">
                            <label for="e1" class="control-label">Volume:</label>
                            <p class="form-control input-md">{{$articles->volume_name}}</p>
                        </div>

                        <div class="form-group col-md-4">
                            <label for="e1" class="control-label">Issue:</label>
                            <p class="form-control input-md">{{$articles->issue_title}}</p>
                        </div>

                        <form name="myForm" method="post" action="{{ route('recenttrend.store') }}" enctype="multipart/form-data" onsubmit="return validateForm()">

                            <input type="hidden" name="_token" value="<?= csrf_token() ?>">
                            <input type="hidden" name="article_id" id="article_id" class="form-control input-md" value="{{$articles->article_id}}">

                            <div class="form-group col-md-4">
                                <label class="control-label" for="news_release_date">News Release Date: *</label>
                                <input type="date" class="form-control" name="news_release_date" required="required">
                            </div>

                            <div class="form-group col-md-12">
                                <label for="e1" class="control-label">Description: *</label>
                                <div class='box-body box_content'>
                                    <textarea class="textarea editor-cls" id="description" name="description" rows="5"></textarea>
                                </div>
                            </div>

                            <div class="form-group text-center col-md-12">
                                <button class="btn btn-primary text-center" type="submit">Submit</button>
                            </div>
                        </form>
                    </div>
                </div>
                @endforeach
                @endif
            </div>
        </div>
    </div>
    </div>
    <!--main content ends-->
</section>
<!-- content -->
@stop

{{-- page level scripts --}}
@section('footer_scripts')
@include('admin.layouts.js')
<script>
    function validateForm() {
        let x = document.forms["myForm"]["description"].value;
        if (x == "") {
            alert("Description must be filled out!");
            return false;
        }
    }
</script>
@stop