| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- @extends('layouts.admin')
- @section('title')
- Pubblicità Pagina {{$page->name}}
- @stop
- @section('content')
- @foreach($aDatas as $idx => $data)
- <div class="row">
- <div class="col-xs-2">
- <h2>{{$idx}}</h2>
- </div>
- <div class="col-xs-10 text-right">
- <br><a href="{{ route('pages.advs.create', $page) }}?position={{$idx}}" class="btn btn-success">Aggiungi</a>
- </div>
- </div>
- <div class="row">
- <div class="col-xs-2">
- <img src="/images/{{str_replace(" ", "", $idx)}}.png" style="max-width:180px">
- </div>
- <div class="col-xs-10">
- <div class="col-xs-12">
- <div class="box">
- <div class="box-body table-responsive no-padding">
- <table class="table table-striped table-hover">
- <tr>
- <th>Nome</th>
- <th>Google</th>
- <th>Immagine</th>
- <th>Online</th>
- <th width="50"></th>
- <th width="50"></th>
- </tr>
- <tbody>
- @foreach($data as $adv)
- <tr class="adv_row" data-id="{{$adv->id}}" style="cursor:move">
- <td>{{$adv->name}}</td>
- <td>{{$adv->google_code}}</td>
- <td>
- @if($adv->image != '')
- <img src="/files/adv/{{$adv->image}}" style="max-width:250px" />
- @endif
- </td>
- <td>{{$adv->online ? 'Si' : 'No'}}</td>
- <td>
- <a href="{{ route('pages.advs.edit', array($page, $adv)) }}" type="button" class="btn btn-w-m btn-primary">Modifica</a>
- </td>
- <td>
- <form class="form-inline" method="POST" action="{{ route('pages.advs.destroy', [$page, $adv]) }}">
- @csrf
- @method('DELETE')
- <button type="submit" class="btn btn-w-m btn-danger" onclick="return confirm('Sei sicuro?')">Elimina</button>
- </form>
- </td>
- </tr>
- @endforeach
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- </div>
- @endforeach
- <div class="col-xs-2" style="margin-top:50px">
- <a href="{{ route('pages.index') }}" class="btn btn-info">Elenco pagine</a>
- </div>
- @stop
- @section('extra_js')
- <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
- <script>
- $(function () {
- $('tbody').sortable({
- cursor: "move",
- stop: function( ) {
- var ids = '';
- $(".adv_row").each(function() {
- var id = $(this).attr("data-id");
- ids += (ids != '' ? ',' : '') + id;
- });
- $.ajax('/admin/adv/sort/' + ids, {
- success: function (data, status, xhr) {
- $('p').append(data);
- }
- });
- }
- });
- });
- </script>
- @stop
|