UnknownSec Bypass
403
:
/
var
/
www
/
stp-bhaktisagar-backend
/
src
/
views
/ [
drwxrwxr-x
]
Menu
Upload
Mass depes
Mass delete
Terminal
Info server
About
name :
book.ejs
<!-- partial:partials/_navbar.html --> <div class="page-wrapper"> <%- include('header.ejs') %> <!-- partial --> <div class="page-content"> <div class="d-flex justify-content-between align-items-center flex-wrap grid-margin" > <div> <h4 class="mb-3 mb-md-0"><%= title %></h4> </div> <div class="d-flex align-items-center flex-wrap text-nowrap"> <a href="/add-book" class="btn btn-primary btn-icon-text mb-2 mb-md-0"> <i class="btn-icon-prepend" data-feather="plus"></i> Add </a> </div> </div> <div class="row"> <div class="col-lg-12 grid-margin stretch-card"> <div class="card"> <div class="card-body"> <h4 class="card-title">Book</h4> <div class="table-responsive pt-3"> <table id="dataTable" class="table table-hover table-bordered" ></table> </div> </div> </div> </div> </div> </div> </div> <script> let dataTable; const deleteRow = async (id, button) => { // console.log(id, $(button).parent().parent()); let yes = await showConfirmation(); if (yes) { Notiflix.Loading.circle("Please Wait..."); try { let r = await callApi("DELETE", `/api/book/${id}`); // console.log(r); if (r && r.status) { Notiflix.Notify.success(r.message); dataTable.row($(button).parent().parent()).remove().draw(); } } catch (e) { console.log("error", e); Notiflix.Notify.failure("Somthing went wrong."); } Notiflix.Loading.remove(); } }; const init = async () => { Notiflix.Loading.circle("Loading..."); try { let r = await callApi("GET", `/api/book`); dataTable = new DataTable("#dataTable", { stateSave: true, pageLength: 50, data: r.data, // columnDefs: [ // { // targets: [1,2], // width:'20%' // }, // ], order: [[0, "desc"]], columns: [ { title: "id", data: "id" }, { title: "Title", data: "title", render: function (data, type, row, meta) { return `<div style="width:200px;display:flex"><img class="mr-1" style="border-radius:5px; width:40px;height:40px;background-color:#eee;object-fit:cover;" src="${ row.artwork || "/assets/images/audio.png" }"/><div> ${data}<br/>${row.title_hi}</div></div>`; }, }, { title: "Category", data: "book_category", render: function (data, type, row, meta) { let pl = []; try { pl = JSON.parse(data); } catch {} pl = pl ?? []; // console.log("plplpl", pl, pl.map((p) => p.title).join(",")); return pl.map((p) => p.title).join(", "); }, }, { title: "PDF URL", data: "url", }, { title: "Created At", data: "datetime", render: function (data, type, row, meta) { return moment(data).format("DD-MMM-YYYY"); }, }, { title: "Action", data: "id", render: function (data, type, row, meta) { // console.log(data,meta) return `<a class="btn btn-sm btn-warning mr-1" href="/add-book/${data}" >Edit</a><button class="btn btn-sm btn-danger" onclick="deleteRow(${data},this)" >Delete</button>`; }, }, ], }); } catch (e) { console.log("error", e); Notiflix.Notify.failure("Somthing went wrong."); } Notiflix.Loading.remove(); }; init(); </script>
Copyright © 2025 - UnknownSec