whoami7 - Manager
:
/
proc
/
self
/
root
/
home
/
papecmvm
/
www
/
application
/
views
/
media
/
Upload File:
files >> //proc/self/root/home/papecmvm/www/application/views/media/media_view.php
<?php require_once(APPPATH . 'views/header.php'); ?> <?php require_once(APPPATH . 'views/menu.php'); ?> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> Files </h1> <ol class="breadcrumb"> <li><a href="<?php echo site_url('admin/Welcome') ?>"><i class="fa fa-dashboard"></i> Dashboard</a></li> <li class="active">Files</li> </ol> </section> <!-- Main content --> <section class="content"> <?php $attributes = array('id' => 'formid'); echo form_open("", $attributes); ?> <!-- /.row --> <div class="row"> <div class="col-xs-12"> <div class="box"> <div class="box-header"> <div class="text-left"> <button type="button" data-toggle="modal" data-target="#myModal" class="btn btn-success"><i class="fa fa-plus"></i> Add Media</button> <button class="btn btn-danger" id='deletedata' type="button"><i class="fa fa-trash"></i> Trash </button> </div> </div><!-- /.box-header --> <div class="box-body"> <?php if ($this->session->flashdata('msg')) { echo $this->session->flashdata('msg'); } ?> <ul class="users-list clearfix"> <?php foreach ($view as $key) { ?> <li> <?php if (($key['filetype'] == '.jpg') || ($key['filetype'] == '.png') || ($key['filetype'] == '.gif')) { ?> <img data-value='<?php echo $key['tblmedia_id']; ?>' style='cursor: pointer;' class='mediaimg ajexinput' src="<?php echo base_url() . $key['file_path']; ?>" /> <?php } else if ($key['filetype'] == '.pdf') { echo '<i data-value=' . $key["tblmedia_id"] . ' class="fa fa-file-pdf-o ajexinput" style="color: #296091;font-size:125px;cursor: pointer;"></i>'; } else { echo '<i data-value=' . $key["tblmedia_id"] . ' class="fa fa-file-text ajexinput" style="color: #296091;font-size:125px;cursor: pointer;"></i>'; } ?> <a class="users-list-name" href="#" data-toggle="tooltip" title="<?php echo $key['file_name']; ?>"><?php echo $key['file_name']; ?></a> <span class="users-list-date"> <input type="checkbox" class="minimal-red" name="ck" value="<?php echo $key['tblmedia_id']; ?>"> <p style='display:none;' id="text_element_<?php echo $key['tblmedia_id']; ?>"><?php echo base_url() . $key['file_path']; ?></p> <button onclick="copyToClipboard('text_element_<?php echo $key['tblmedia_id']; ?>')" type='button' class="btn btn-link copy<?php echo $key['tblmedia_id']; ?>" title="Copy Url"><i class="fa fa-lg fa-clipboard text-center"></i></button> </span> </li> <?php } ?> </ul> </div><!-- /.box-body --> </div><!-- /.box --> </div> </div> <!-- /.row --> <?php echo form_close(); ?> </section><!-- /.content --> </div><!-- /.content-wrapper --> <div id="myModal" class="modal fade" role="dialog"> <?php $attributes = array('class' => 'defaultForm', 'data-bv-message' => 'This value is not valid', 'data-bv-feedbackicons-validating' => 'glyphicon glyphicon-refresh'); echo form_open_multipart('admin/mediamanagement/add', $attributes); ?> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header btn-success"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span></button> <h4 class="modal-title">Upload Files</h4> </div> <div class="modal-body"> <div class="form-group"> <input class="fileupload" type="file" name="mediafile[]" multiple="true" data-show-upload="false" required data-bv-notempty-message="The Images is required and cannot be empty" data-bv-notempty="true" data-bv-file="true" data-bv-file-extension="pdf,jpeg,jpg,png,gif" data-bv-file-type="image/jpeg,image/png,application/pdf,image/gif" data-bv-file-message="The selected file is not valid"/> </div> </div> <div class="modal-footer"> <button type='submit' class="btn btn-success">Upload</button> </div> </div> <!-- /.modal-content --> </div> <?php echo form_close(); ?> <!-- /.modal-dialog --> </div> <div id="FileModal" class="modal fade" role="dialog"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header btn-success"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span></button> <h4 class="modal-title">Media Detail</h4> </div> <div class="modal-body ajexresult"> </div> </div> <!-- /.modal-content --> </div> <!-- /.modal-dialog --> </div> <?php require_once(APPPATH . 'views/footer.php'); ?> <script type="text/javascript"> $(document).ready(function () { // $(".fileupload").fileinput({ // allowedFileExtensions: ["jpg", "gif", "png", "PDF"], // maxFileCount: 5, // }); $(".ajexinput").click(function () { i = $(this).data("value"); $.get("mediamanagement/openmodel/" + i, function (data, status) { $('.ajexresult').html(data); }); $('#FileModal').modal('show'); }); }); function copyToClipboard(elementId) { var res = elementId.split("_"); $('.copy' + res[2]).html('Copid!'); // Create an auxiliary hidden input var aux = document.createElement("input"); // Get the text from the element passed into the input aux.setAttribute("value", document.getElementById(elementId).innerHTML); // Append the aux input to the body document.body.appendChild(aux); // Highlight the content aux.select(); // Execute the copy command document.execCommand("copy"); // Remove the input from the body document.body.removeChild(aux); setInterval(function () { $('.copy' + res[2]).html('<i class="fa fa-lg fa-clipboard text-center">'); }, 1000); } $(document).ready(function () { //---------------- delete message ------------------------------------- $('#deletedata').click(function () { var exists = $('input[type=checkbox][name^=ck]:checked').filter(':checked').length; if (!exists) { alert('Please select at least 1 checkbox!'); return false; } else if (confirm('Are you sure you want to delete this Data?')) { var cct = $.cookie("<?php echo $this->config->item('csrf_cookie_name'); ?>"); var postData = $('input[type=checkbox][name^=ck]:checked').serialize(); $.post("mediamanagement/deleteimageselected", {ck: postData, '<?php echo $this->security->get_csrf_token_name(); ?>': cct}, function (data, status) { location.reload(); }); //$('#formid').submit(); } else { return false; } }); }); </script>
Copyright ©2021 || Defacer Indonesia