Untitled
plain_text
2 months ago
14 kB
1
Indexable
Never
<script type="text/javascript"> $(document).ready(function() { $('table#example1 td a.remove').click(function() { swal({ title: "Anda yakin akan menghapus Data ini?", text: "Anda tidak akan bisa mengembalikan Data yang terhapus!", icon: "warning", showCancelButton: true, buttons: { cancel: { text: "Tidak, Batalkan!", value: null, visible: true, className: "btn-warning", closeModal: false, }, confirm: { text: "Ya, Hapus saja!", value: true, visible: true, className: "", closeModal: false } } }).then(isConfirm => { if (isConfirm) { var id = $(this).parents("tr").attr('id'); // alert(id); var data = 'action=delete&id=' + id; var parent = $(this).parent().parent(); // var_dump(data); $.ajax({ type: "POST", url: "<?php echo $this->basePath; ?>/cms/aboutdelete", data: data, cache: false, success: function() { parent.fadeOut('slow', function() { $(this).parents("tr").remove(); }); open_url_to_div('<?php echo $this->basePath; ?>/cms/about'); } }); swal("Terhapus!", "Data sudah terhapus.", "success"); } else { swal("Batal", "", "error"); } }); }); }); </script> <?php /** * @var Laminas\View\Renderer\PhpRenderer $this */ //require(path_share.'function.php'); ?> <?php // if ($login == 1) { ?> <div class="content-body" id="page-content"> <!-- eCommerce statistic --> <div class="app-content content"> <div class="content-wrapper"> <div class="content-header row mb-1"> <div class="content-header-left col-md-12 col-12 mb-2 breadcrumb-new"> <h3 class="content-header-title mb-0 d-inline-block">About</h3> <div class="row breadcrumbs-top d-inline-block"> <div class="breadcrumb-wrapper col-12"> <ol class="breadcrumb"> <li class="breadcrumb-item active">About </li> </ol> </div> </div> </div> </div> <div> <!-- Base style table --> <section id="base-style"> <div class="row"> <div class="col-12"> <div class="card"> <div class="card-header"> <h4 class="card-title">List About</h4> <a class="heading-elements-toggle"><i class="la la-ellipsis-v font-medium-3"></i></a> <div class="heading-elements"> <a class="menu-item" user="" href="#" onClick="open_url_to_div('/cms/aboutform/0')"><button class="btn btn-primary btn-sm"><i class="la la-plus"></i> Add Data</button></a> </div> </div> <!-- <a class="btn btn-sm btn-danger box-shadow-2 round btn-min-width pull-right white" href="bank-add-loan.html"> <i class="ft-plus white"></i>Add New Loan </a> --> <div class="card-content collapse show tab-content"> <div role="tabpanel" class="card-body card-dashboard tab-pane active" id="active3" aria-labelledby="active-tab3" aria-expanded="true"> <div class="table-responsive" method="POST"> <? if (!empty($dataabout)) { ?> <table class="table table-striped table-bordered zero-configuration" id="example1"> <thead> <tr> <th width="5%" scope="col">No</th> <th width="25%" scope="col">judul</th> <th width="10%" scope="col">Deskripsi</th> <!-- <th width="20%" scope="col">Image</th> --> <th width="10%" scope="col">Status</th> <th width="20%" scope="col">Actions</th> </tr> </thead> <tbody> <?php $i = 1; foreach ($dataabout as $row) { ?> <tr id="<?php echo $row['i_id_holabout'] ?>"> <td align="right"> <?php echo $i ?> </td> <td> <?php echo $row['n_hol_about'] ?> </td> <td> <?php echo $row['e_hol_about'] ?> </td> <!-- <td align="center"> <img id="image<?php echo $row['i_id_holabout'] ?>" title="<?php echo $row['n_hol_about']; ?>" class="view-img img-thumbnail img-fluid" src="<?php echo $this->basePath . $aboutimagePath . "fac_" . $row['i_id_holabout'] . "/" . $row['n_hol_aboutimg'] . "?t=" . time() ?>" width="200" itemprop="thumbnail" alt="Image description"> </td> --> <?php if ($row['f_hol_about'] == 1) { ?> <td align="center">Published</td> <?php } else { ?> <td align="center">Not Published</td> <?php } ?> <td align="center"> <a class="btn btn-sm btn-info menu-item" user="" title="View Detail" href="#" onclick="open_url_to_div('/cms/facilitiesform/<?php echo $row['i_id_holabout']; ?>');"><i class="la la-pencil-square "></i></a> <a class="btn btn-sm btn-info menu-item" user="" title="Edit user" href="#" onclick="open_url_to_div('/cms/facilitiesform/<?php echo $row['i_id_holabout']; ?>');"><i class="la la-pencil-square "></i></a> <a class="btn btn-sm btn-danger remove menu-item" user="" title="Delete user" href="#"><i class="la la-trash "></i></a> </td> </tr> <?php $i++; } ?> </tbody> </table> <? } ?> </div> </div> </div> </div> </div> </section> </div> </div> </div> </div> </div> <!-- END: Content--> <div class="modal hide fade" tabindex="-1" role="dialog" id="videomodal"> <div class="modal-dialog modal-dialog-centered modal-lg" role="document"> <div class="modal-content"> <div class="modal-header"> <span id="title"></span> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <video width="100%" id="video" autoplay="autoplay" loop="" height="100%" controls> </video> </div> </div> </div> </div> <div class="modal hide fade" tabindex="-1" role="dialog" id="imgmodal"> <div class="modal-dialog modal-dialog-centered modal-lg" role="document"> <div class="modal-content"> <div class="modal-header"> <span id="title2"></span> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body" id="img"> </div> </div> </div> </div> <div class="modal hide fade" tabindex="-1" role="dialog" id="videomodal"> <div class="modal-dialog modal-dialog-centered modal-lg" role="document"> <div class="modal-content"> <div class="modal-header"> <span id="title"></span> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <video width="100%" id="video" autoplay="autoplay" loop="" height="100%" controls> </video> </div> </div> </div> </div> <div class="modal hide fade" tabindex="-1" role="dialog" id="imgmodal"> <div class="modal-dialog modal-dialog-centered modal-lg" role="document"> <div class="modal-content"> <div class="modal-header"> <span id="title2"></span> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body" id="img"> </div> </div> </div> </div> <script> function divRefresh(ID, URL) { // alert(URL); $("#" + ID).attr("src", URL + `?v=${new Date().getTime()}`); // $("#"+ID).attr("src", URL + `?v=${new Date().getTime()}`); } </script> <script type="text/javascript"> $(function() { $("#example1").dataTable({ "bPaginate": true, "bLengthChange": true, "bFilter": true, "bSort": false, "bInfo": true, "bAutoWidth": false }); $("#example3").dataTable({ "bPaginate": true, "bLengthChange": true, "bFilter": true, "bSort": false, "bInfo": true, "bAutoWidth": false }); }); </script> <script> $(document).ready(function() { // Close modal on button click $(".view_video").click(function() { var filename = $(this).attr("filename"); var title = $(this).attr("title"); //alert('<?php echo $this->pathfileregn ?>'+filename); var media = $("#video").get(0); media.play(); media.currentTime = 0; $('#videomodal').modal("show"); $('#title').html(title); $('#video').html('<source src="<?php echo $this->basePath . $aboutimagePath ?>' + filename + '" type="video/mp4"> Your browser does not support the video tag.'); // sets }); $(".view-img").click(function() { var filename = $(this).attr("src"); var title = $(this).attr("title"); //alert(title); $('#imgmodal').modal("show"); $('#title2').html(title); $('#img').html('<img class="img-fluid" src="' + filename + '">'); // sets }); $(".close").click(function() { var media = $("#video").get(0); media.pause(); media.currentTime = 0; }); }); </script>