@extends('admin.head')
@section('middle')
<section class="content">
@if(Session::has('msg'))
<div class="alert alert-success" id="success-alert">
<button type="button" class="close" data-dismiss="alert">x</button>
<p align="center" style="font-weight: bold; font-size: 13px; color: white"> Success: {{ Session::get('msg') }} </p>
</div>
<br>
@endif
@if(Session::has('msg2'))
<div class="alert alert-danger" id="success-alert">
<button type="button" class="close" data-dismiss="alert">x</button>
<p align="center" style="font-weight: bold; font-size: 13px; color: white"> Success: {{ Session::get('msg2') }} </p>
</div>
<br>
@endif
<a href="{{ url('add_gallery') }}"><button class="btn btn-primary" style="float: right"><i class="glyphicon glyphicon-plus"></i>Add New Album</button></a>
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title">Album List</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<table id="example1" class="table table-bordered table-striped">
<thead>
<tr>
<th>SR #</th>
<th>Title</th>
<th>Total Images</th>
<th>Cover Image</th>
<th>Edit/Delete Images</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php $count=1; ?>
@foreach($galleries as $gallery)
<tr>
<td>{{ $count }}</td>
<td>{{ $gallery->title }}</td>
@php
$images_count = DB::table('galleries_attachments')->where('gallery_id',$gallery->gallery_id)->get();
@endphp
@php
$images = DB::table('galleries_attachments')->where('gallery_id',$gallery->gallery_id)->take(1)->get();
@endphp
<td><span style="font-weight: bold; color: #0000ff">{{ count($images_count) }}</span></td>
<td>
@if(count($images)>0)
@if($images[0]->type=='Image')
<img style="width: 150px; width: 150px" src="{{ url('public/uploads/gallery') }}/{{ $images[0]->image_name }}">
@else
<video width="200" height="120" controls>
<source src="{{ url('public/uploads/gallery') }}/{{ $images[0]->image_name }}" type="video/mp4">
</video>
@endif
@endif
</td>
<td style="width: 15%;">
<a style="margin: 5px;" href="{{ url('edit_gallery_images') }}/{{ $gallery->gallery_id }}" class="btn btn-primary"><i class="glyphicon glyphicon-eye-open"></i></a>
</td>
<td style="width: 20%">
<a style="margin: 5px;" href="{{ url('edit_gallery') }}/{{ $gallery->gallery_id }}" class="btn btn-primary"><i class="glyphicon glyphicon-pencil"></i></a>
<a data-toggle="modal" data-target="#confirm-delete" data-href="{{ url('delete_gallery') }}/{{ $gallery->gallery_id }}" class="btn btn-danger"><i class="glyphicon glyphicon-trash"></i></a>
</td>
</tr>
<?php $count=$count+1; ?>
@endforeach
</tbody>
</table>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<script>
$(document).ready(function(){
$('.stock_checkbox').on('change',function(){
var value=$(this).val();
if ($(this).prop('checked')) {
$.get("{{ url('product_is_in_stock') }}"+'/'+value,function(response){
});
}
else {
$.get("{{ url('product_not_in_stock') }}"+'/'+value,function(response){
});
}
});
});
</script>
@endsection
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]