@extends('layouts.admin')

@section('title')

	Web Radio

@stop

@section('content')

	<div class="row">
        <div class="col-lg-12">
            <form action="/admin/home_radio" method="POST" enctype="multipart/form-data">
                {{csrf_field()}}
            <div class="box box-primary">
                <div class="box-header with-border">
                    <h3 class="box-title"></h3>
                </div>
            
                <div class="box-body">
                    
                    <div class="row">
                        <div class="col-md-4">
                            <div class="form-group">
                                {!! Form::label('radio1_title', 'Radio1 titolo:') !!}<br>
                                
                                @if(isset($_GET["edit"]))
                                    <input type="text" name="radio1_title" value="{{$home->radio1_title}}" class="form-control">
                                @else
                                    {{$home->radio1_title}}
                                @endif
                            </div>                
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                {!! Form::label('radio1_file', 'Radio1 MP3:') !!}<br>
                                @if(isset($_GET["edit"]))
                                    <input type="file" name="radio1_file">
                                    @if($home->image != '')
                                        <input type="checkbox" name="delete_radio1">Rimuovi file<br>
                                        <audio controls>
                                            <source src="/files/{{$home->radio1_file}}" type="audio/mpeg">
                                            Your browser does not support the audio tag.
                                        </audio>
                                    @endif
                                @else
                                    @if($home->radio1_file != '')
                                        <audio controls>
                                            <source src="/files/{{$home->radio1_file}}" type="audio/mpeg">
                                            Your browser does not support the audio tag.
                                        </audio>
                                    @endif
                                @endif
                            </div>                
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                {!! Form::label('radio1_url', 'Radio1 URL:') !!}<br>
                                
                                @if(isset($_GET["edit"]))
                                    <input type="text" name="radio1_url" value="{{$home->radio1_url}}" class="form-control">
                                @else
                                    @if($home->radio1_url != '')
                                        <audio controls>
                                            <source src="{{$home->radio1_url}}" type="audio/mpeg">
                                            Your browser does not support the audio tag.
                                        </audio>
                                    @endif
                                @endif
                            </div>                
                        </div>
                        
                    </div>
                    
                </div>

                <div class="box-body">
                    
                    <div class="row">
                        <div class="col-md-4">
                            <div class="form-group">
                                {!! Form::label('radio2_title', 'Radio2 titolo:') !!}<br>
                                
                                @if(isset($_GET["edit"]))
                                    <input type="text" name="radio2_title" value="{{$home->radio2_title}}" class="form-control">
                                @else
                                    {{$home->radio2_title}}
                                @endif
                            </div>                
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                {!! Form::label('radio2_file', 'Radio2 MP3:') !!}<br>
                                @if(isset($_GET["edit"]))
                                    <input type="file" name="radio2_file">
                                    @if($home->image != '')
                                        <input type="checkbox" name="delete_radio2">Rimuovi file<br>
                                        <audio controls>
                                            <source src="/files/{{$home->radio2_file}}" type="audio/mpeg">
                                            Your browser does not support the audio tag.
                                        </audio>
                                    @endif
                                @else
                                    @if($home->radio2_file != '')
                                        <audio controls>
                                            <source src="/files/{{$home->radio2_file}}" type="audio/mpeg">
                                            Your browser does not support the audio tag.
                                        </audio>
                                    @endif
                                @endif
                            </div>                
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                {!! Form::label('radio2_url', 'Radio2 URL:') !!}<br>
                                @if(isset($_GET["edit"]))
                                    <input type="text" name="radio2_url" value="{{$home->radio2_url}}" class="form-control">
                                @else
                                    @if($home->radio2_url != '')
                                        <audio controls>
                                            <source src="{{$home->radio2_url}}" type="audio/mpeg">
                                            Your browser does not support the audio tag.
                                        </audio>
                                    @endif
                                @endif
                            </div>                
                        </div>
                    </div>
                    
                </div>

                <div class="box-body">
                    
                    <div class="row">
                        <div class="col-md-4">
                            <div class="form-group">
                                {!! Form::label('radio3_title', 'Radio3 titolo:') !!}<br>
                                
                                @if(isset($_GET["edit"]))
                                    <input type="text" name="radio3_title" value="{{$home->radio3_title}}" class="form-control">
                                @else
                                    {{$home->radio3_title}}
                                @endif
                            </div>                
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                {!! Form::label('radio3_file', 'Radio3 MP3:') !!}<br>
                                @if(isset($_GET["edit"]))
                                    <input type="file" name="radio3_file">
                                    @if($home->image != '')
                                        <input type="checkbox" name="delete_radio3">Rimuovi file<br>
                                        <audio controls>
                                            <source src="/files/{{$home->radio3_file}}" type="audio/mpeg">
                                            Your browser does not support the audio tag.
                                        </audio>
                                    @endif
                                @else
                                    @if($home->radio3_file != '')
                                        <audio controls>
                                            <source src="/files/{{$home->radio3_file}}" type="audio/mpeg">
                                            Your browser does not support the audio tag.
                                        </audio>
                                    @endif
                                @endif
                            </div>                
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                {!! Form::label('radio3_url', 'Radio3 URL:') !!}<br>
                                @if(isset($_GET["edit"]))
                                    <input type="text" name="radio3_url" value="{{$home->radio3_url}}" class="form-control">
                                @else
                                    @if($home->radio3_url != '')
                                        <audio controls>
                                            <source src="{{$home->radio3_url}}" type="audio/mpeg">
                                            Your browser does not support the audio tag.
                                        </audio>
                                    @endif
                                @endif
                            </div>                
                        </div>
                    </div>
                    
                </div>
            
                <div class="box-footer">
                    @if(isset($_GET["edit"]))
                        {!! Form::submit('Salva', ['class'=>'btn btn-success']) !!}
                    @else
                        <a href="/admin/home_radio?edit=1" class="btn btn-info">Modifica</a>
                    @endif
                    {!! link_to_route('home_radio', 'Annulla', null, array('class' => 'btn btn-info')) !!}
                </div>
            </div>
            </form>

        </div>
    </div>

@stop
