관리-도구
편집 파일: index.blade.php
@extends('layouts.app') <!-- DataTables CSS --> <link href="https://cdn.datatables.net/1.13.4/css/jquery.dataTables.min.css" rel="stylesheet"> <style> p.ct_job_discriptas { height: 100px; overflow: hidden; width: 500px; } .ct_btn_edit { background: transparent; border: 1px solid #3333; width: 100%; display: block; color: black; text-align: center; padding: 5px 10px; margin: 6px 0px; } button.selected-dlt-btn.btn.btn-danger { position: absolute; top: 114px; width: 32px; height: 30px; left: 61px; padding: 0; } </style> @section('content') <div class="page-wrapper"> <div class="container-fluid"> <div class="row page-titles"> <div class="col-md-5 align-self-center"> <h4 class="text-themecolor"> </h4> </div> <div class="col-md-7 align-self-center text-end"> <div class="d-flex justify-content-end align-items-center"> <ol class="breadcrumb justify-content-end"> <li class="breadcrumb-item"><a href="{{ url('/admin') }}">Home</a></li> <li class="breadcrumb-item active">Job Listing</li> </ol> <!--<form action="{{ route('createBlog') }}"> <button type="submit" class="btn btn-info d-none d-lg-block m-l-15 text-white"><i class="fa fa-plus-circle"></i> Create New</button> </form>--> </div> </div> </div> <div class="row"> <!-- column --> <div class="col-12"> <div class="card"> <div class="card-body"> <h4 class="card-title"> Jobs Listing </h4> @if (Session::has('success')) @elseif (Session::has('error')) <div class="alert alert-danger alert-dismissible fade show" role="alert"> {{ Session::get('error') }} </div> @endif <div class="table-responsive ct-selected-jobs"> <form action="{{ route('jobs.bulk-delete') }}" method="POST" id="bulkDeleteForm"> @csrf @method('DELETE') <table class="table" id="jobTable"> <thead> <tr> <th><input type="checkbox" id="selectAll"></th> <!-- Checkbox to select all jobs --> <th style="width: 270px;" >Title</th> <th>Description</th> <th>Job Link</th> <th>Job Date</th> <!--<th>Expected Salary</th>--> <th class="text-center" style="width: 100px;">Action</th> </tr> </thead> <tbody> @foreach ($data as $job) <tr> <td><input type="checkbox" name="selected_jobs[]" value="{{ $job->id }}" class="job-checkbox"></td> <!-- Job checkbox --> <td class="ct-jobtitle" >{{ $job->job_title }}</td> <td><p class="ct_job_discriptas">{!! $job->job_description !!}</p></td> <td><p class="ct_job_discriptas">{!! $job->link_space !!}</p></td> <!--<td>${!! $job->min_salary !!} - ${!! $job->max_salary !!}</td>--> <td>{{ $job->created_at->format('Y-m-d') }}</td> <td class="text-center"> <div class="dropdown"> <button class="btn btn-light dropdown-toggle btn-xs" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> {{ _lang('Action') }} <i class="fas fa-angle-down"></i> </button> <div class="dropdown-menu" aria-labelledby="dropdownMenuButton"> <a href="{{ route('job.edit', $job->id) }}" class="ct_btn_edit">Edit</a> <a href="{{ route('job.show',$job->id) }}" class="ct_btn_edit">View</a> <form action="{{ route('job.destroy', $job->id) }}" method="POST"> @csrf @method('DELETE') <button class="ct_btn_edit" type="submit" onclick="return confirm('Are you sure you want to delete this job post?')">Delete</button> </form> </div> </div> </td> </tr> @endforeach </tbody> </table> <!-- Bulk Delete Button --> <button type="submit" class="selected-dlt-btn btn btn-danger" onclick="return confirm('Are you sure you want to delete selected jobs?')"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash" viewBox="0 0 16 16"> <path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z"/> <path d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4zM2.5 3h11V2h-11z"/> </svg></button> </form> </div> {{--<table class="table" id="jobTable"> <thead> <tr> <th>Title</th> <th>Description</th> <th>Expected Salary</th> <th class="text-center" style="width: 100px;">Action</th> </tr> </thead> <tbody> @foreach ($data as $job) <tr> <td>{{ $job->job_title }}</td> <td><p class="ct_job_discriptas">{!! $job->job_description !!}</p>....</td> <td>${!! $job->min_salary !!} - ${!! $job->max_salary !!}</td> <td class="text-center"> <div class="dropdown"> <button class="btn btn-light dropdown-toggle btn-xs" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> {{ _lang('Action') }} <i class="fas fa-angle-down"></i> </button> <div class="dropdown-menu" aria-labelledby="dropdownMenuButton"> <a href="{{ route('job.edit', $job->id) }}" class="ct_btn_edit">Edit</a> <form action="{{ route('job.show',$job->id) }}"> <button class="ct_btn_edit">View</button> </form> <form action="{{ route('job.destroy', $job->id) }}" method="POST"> @csrf @method('DELETE') <button class="ct_btn_edit" type="submit" onclick="return confirm('Are you sure you want to delete this job post?')">Delete</button> </form> </div> </div> </td> </tr> @endforeach </tbody> </table>--}} {{--<div class="table-responsive"> <table class="table"> <thead> <tr> <th>Title</th> <th>Description</th> <th>Expected Salary</th> <th class="text-center" style="width: 100px;">Action</th> </tr> </thead> <tbody> @foreach ($data as $job) <tr> <td>{{ $job->job_title }}</td> <td><p class="ct_job_discriptas" >{!! $job->job_description !!}</p>....</td> <td>${!! $job->min_salary !!} - ${!! $job->max_salary !!}</td> <td> </td> <td class="text-center"> <div class="dropdown"> <button class="btn btn-light dropdown-toggle btn-xs" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> {{ _lang('Action') }} <i class="fas fa-angle-down"></i> </button> <div class="dropdown-menu" aria-labelledby="dropdownMenuButton"> <a href="{{ route('job.edit', $job->id) }}" class="ct_btn_edit">Edit</a> <form action="{{ route('job.show',$job->id) }}"> <button class="ct_btn_edit">View</button> </form> <form action="{{ route('job.destroy', $job->id) }}" method="POST"> @csrf @method('DELETE') <button class="ct_btn_edit" type="submit" onclick="return confirm('Are you sure you want to delete this job post?')">Delete</button> </form> </div> </form> </div> </td> <td> </td> </tr> @endforeach </tbody> </table> {!! $data->links() !!} </div>--}} </div> </div> </div> </div> </div> </div> <!-- jQuery --> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://cdn.datatables.net/1.13.4/js/jquery.dataTables.min.js"></script> <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script> <!-- DataTables JS --> <script> $(document).ready(function() { $('#jobTable').DataTable(); }); </script> <script> // Select all checkboxes document.getElementById('selectAll').addEventListener('click', function(event) { const checkboxes = document.querySelectorAll('.job-checkbox'); checkboxes.forEach(checkbox => checkbox.checked = event.target.checked); }); </script> @endsection