File manager - Edit - /home/u300416816/domains/travelwithacam.com/public_html/resources/views/backend/games/edit.blade.php
Back
@extends('backend.layout') @section('content') <div class="content-header"> <div class="container-fluid"> <div class="row mb-2"> <div class="col-sm-6"> <h1 class="m-0">Add New Game</h1> </div><!-- /.col --> </div><!-- /.row --> </div><!-- /.container-fluid --> </div> <!-- /.content-header --> <!-- Main content --> <section class="content"> <div class="container-fluid"> <!-- Info boxes --> <form action="{{ route('admin.games.update') }}" method="POST" enctype="multipart/form-data"> @csrf <input type="hidden" name="id" id="id" value="{{$game->id}}"> <div class="row"> <!-- left column --> <div class="col-md-8"> <!-- general form elements --> <div class="card card-primary"> <div class="card-body"> <!-- Game Name field --> <div class="form-group"> <label for="name">Game Name</label> <input type="text" class="form-control" id="name" name="name" value="{{ $game->name }}" placeholder="Enter Game Name" required> </div> <!-- Category field --> <div class="form-group"> <label for="category_id">Category</label> <select class="form-control" name="category_id" id="category_id" required> <option value="">Select Category</option> @foreach ($categories as $category) <option value="{{ $category->id }}" @if($category->id == $game->category_id) selected @endif>{{ $category->name }}</option> @endforeach </select> </div> <!-- Description field --> <div class="form-group"> <label for="description">Description</label> <textarea class="form-control" id="description" name="description" placeholder="Enter Game Description" rows="4" required>{{ $game->description }}</textarea> </div> <!-- Game URL field --> <div class="form-group"> <label for="game_url">Game URL</label> <input type="text" class="form-control" id="game_url" name="game_url" value="{{ $game->game_url }}" placeholder="Enter Game URL" required> </div> <!-- Meta Title field --> <div class="form-group"> <label for="meta_title">Meta Title (Optional)</label> <input type="text" class="form-control" id="meta_title" name="meta_title" value="{{ $game->meta_title }}" placeholder="Enter Meta Title"> </div> <!-- Meta Description field --> <div class="form-group"> <label for="meta_description">Meta Description (Optional)</label> <textarea class="form-control" id="meta_description" name="meta_description" placeholder="Enter Meta Description" rows="3">{{ $game->meta_description }}</textarea> </div> </div> </div> <!-- /.card --> </div> <div class="col-md-4"> <!-- general form elements --> <div class="card card-primary"> <div class="card-body"> <!-- Image Drag-and-Drop field --> <div class="form-group"> <label for="image">Game Image</label> <div id="image-drop-area" class="drop-area"> <p>Drag & drop an image here or click to select a file</p> <img id="image-preview" src="{{ asset('images/games/icons/' . $game->image) }}" alt="Image Preview" style="max-width: 100%; height: auto; margin-top: 10px;"> <input type="file" class="form-control-file" id="image" name="image" accept="image/*"hidden> </div> </div> <!-- Banner Drag-and-Drop field --> <div class="form-group"> <label for="banner">Game Banner (Optional)</label> <div id="banner-drop-area" class="drop-area"> <p>Drag & drop a banner here or click to select a file</p> <img id="banner-preview" src="{{ asset('images/games/banner/' . $game->banner) }}" alt="Banner Preview" style="max-width: 100%; height: auto; margin-top: 10px;"> <input type="file" class="form-control-file" id="banner" name="banner" accept="image/*" hidden> </div> </div> <!-- Tags field --> <div class="form-group"> <label for="tags">Tags (Optional)</label> <input type="text" class="form-control" id="tags" name="tags" value="{{ $game->tags }}" placeholder="Enter Tags (comma separated)"> </div> <div class="row"> <div class="col-md-6"> <!-- Featured field --> <div class="form-group"> <label for="featured">Featured</label> <select class="form-control" name="featured" id="featured" required> <option value="0">No</option> <option value="1">Yes</option> </select> </div> </div> <div class="col-md-6"> <!-- Status field --> <div class="form-group"> <label for="status">Status</label> <select class="form-control" name="status" id="status" required> <option value="1">Active</option> <option value="0">Inactive</option> </select> </div> </div> </div> </div> <!-- /.card-body --> <div class="card-footer text-right"> <button type="submit" class="btn btn-primary">Submit</button> </div> </div> <!-- /.card --> </div> </div> </form> </div><!--/. container-fluid --> </section> <!-- Move the scripts and styles directly into the content section --> <style> .drop-area { border: 2px dashed #ccc; padding: 20px; text-align: center; cursor: pointer; transition: border-color 0.3s ease; } .drop-area.drag-over { border-color: #007bff; } .drop-area p { margin: 0; font-size: 16px; } </style> <script> document.addEventListener('DOMContentLoaded', function () { function initDragAndDrop(dropAreaId, inputId, previewId) { let dropArea = document.getElementById(dropAreaId); let input = document.getElementById(inputId); let preview = document.getElementById(previewId); dropArea.addEventListener('dragover', (event) => { event.preventDefault(); dropArea.classList.add('drag-over'); }); dropArea.addEventListener('dragleave', () => { dropArea.classList.remove('drag-over'); }); dropArea.addEventListener('drop', (event) => { event.preventDefault(); dropArea.classList.remove('drag-over'); input.files = event.dataTransfer.files; if (input.files.length > 0) { const file = input.files[0]; const reader = new FileReader(); reader.onload = function(e) { preview.src = e.target.result; preview.style.display = 'block'; }; reader.readAsDataURL(file); } }); dropArea.addEventListener('click', () => { input.click(); }); input.addEventListener('change', () => { if (input.files.length > 0) { const file = input.files[0]; const reader = new FileReader(); reader.onload = function(e) { preview.src = e.target.result; preview.style.display = 'block'; }; reader.readAsDataURL(file); } }); } initDragAndDrop('image-drop-area', 'image', 'image-preview'); initDragAndDrop('banner-drop-area', 'banner', 'banner-preview'); }); </script> @endsection
| ver. 1.4 |
Github
|
.
| PHP 8.2.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings