444 lines
12 KiB
HTML
444 lines
12 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>Project-B</title>
|
|
|
|
<meta name="description" content="">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<!-- Favicon -->
|
|
<link rel="icon" type="image/png" sizes="56x56" href="assets/images/fav-icon/v.png">
|
|
<!-- bootstrap CSS -->
|
|
<link rel="stylesheet" href="./assets/css/bootstrap.min.css" type="text/css" media="all" />
|
|
<!-- carousel CSS -->
|
|
<link rel="stylesheet" href="assets/css/owl.carousel.min.css" type="text/css" media="all"/>
|
|
<!-- nivo-slider CSS -->
|
|
<link rel="stylesheet" href="assets/css/nivo-slider.css" type="text/css" media="all" />
|
|
<!-- animate CSS -->
|
|
<link rel="stylesheet" href="assets/css/animate.css" type="text/css" media="all" />
|
|
<!-- animated-text CSS -->
|
|
<link rel="stylesheet" href="assets/css/animated-text.css" type="text/css" media="all" />
|
|
<!-- font-awesome CSS -->
|
|
<link rel="stylesheet" href="assets/css/all.min.css" type="text/css" media="all" />
|
|
<!-- font-flaticon CSS -->
|
|
<link rel="stylesheet" href="assets/css/flaticon.css" type="text/css" media="all" />
|
|
<!-- theme-default CSS -->
|
|
<link rel="stylesheet" href="assets/css/theme-default.css" type="text/css" media="all" />
|
|
<!-- meanmenu CSS -->
|
|
<link rel="stylesheet" href="assets/css/meanmenu.min.css" type="text/css" media="all" />
|
|
<link rel="stylesheet" href="assets/css/font-awesome.min.css" type="text/css" media="all" />
|
|
<!-- Main Style CSS -->
|
|
<link rel="stylesheet" href="style.css" type="text/css" media="all" />
|
|
<!-- transitions CSS -->
|
|
<link rel="stylesheet" href="assets/css/owl.transitions.css" type="text/css" media="all" />
|
|
<!-- venobox CSS -->
|
|
<link rel="stylesheet" href="venobox/venobox.css" type="text/css" media="all" />
|
|
<!-- widget CSS -->
|
|
<link rel="stylesheet" href="assets/css/widget.css" type="text/css" media="all" />
|
|
<!-- responsive CSS -->
|
|
<link rel="stylesheet" href="assets/css/responsive.css" type="text/css" media="all" />
|
|
<!-- modernizr js -->
|
|
<script src="assets/js/vendor/modernizr-3.5.0.min.js"></script>
|
|
<link href='https://fonts.googleapis.com/css?family=Titillium+Web:400,600' rel='stylesheet' type='text/css'>
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css">
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
/* The Modal (background) */
|
|
.modal {
|
|
display: none; /* Hidden by default */
|
|
position: fixed; /* Stay in place */
|
|
z-index: 1; /* Sit on top */
|
|
padding-top: 100px; /* Location of the box */
|
|
left: 0;
|
|
top: 0;
|
|
width: 100%; /* Full width */
|
|
height: 100%; /* Full height */
|
|
overflow: auto; /* Enable scroll if needed */
|
|
background-color: rgb(0,0,0); /* Fallback color */
|
|
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
|
|
}
|
|
|
|
/* Modal Content */
|
|
.modal-content {
|
|
background-color: #fefefe;
|
|
margin: auto;
|
|
padding: 20px;
|
|
border: 1px solid #888;
|
|
width: 80%;
|
|
}
|
|
|
|
/* The Close Button */
|
|
.close {
|
|
color: #aaaaaa;
|
|
float: right;
|
|
font-size: 28px;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.close:hover,
|
|
.close:focus {
|
|
color: #000;
|
|
text-decoration: none;
|
|
cursor: pointer;
|
|
}
|
|
|
|
/* Style for the Choose File button */
|
|
.file-input {
|
|
background-color: #533dfd;
|
|
color: #fff;
|
|
border: none;
|
|
padding: 10px 20px;
|
|
border-radius: 5px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
/* Style for the Submit button */
|
|
.submit-button {
|
|
background-color: #2ecc71;
|
|
color: #fff;
|
|
border: none;
|
|
padding: 10px 20px;
|
|
height: 55px;
|
|
border-radius: 5px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
body {
|
|
background-image: url('assets/images/bg1-1.png');
|
|
background-size: cover; /* Adjust as needed */
|
|
background-repeat: no-repeat;
|
|
background-attachment: fixed;
|
|
}
|
|
|
|
|
|
.landing-icons{
|
|
width: 100%;
|
|
text-align: right;
|
|
margin-bottom: -32px;
|
|
}
|
|
|
|
|
|
|
|
|
|
</style>
|
|
|
|
</head>
|
|
<body>
|
|
|
|
|
|
<!-- loder -->
|
|
<div class="loader-wrapper">
|
|
<div class="loader"></div>
|
|
<div class="loder-section left-section"></div>
|
|
<div class="loder-section right-section"></div>
|
|
</div>
|
|
|
|
|
|
<!-- main-header -->
|
|
<div class="main-header">
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
<div id="sticky-header" class="nav-menu">
|
|
<div class="header-logo">
|
|
<a href="dashboard.html" ><h2 style="margin-top: 25px;"><img src="assets/images/fav-icon/icon.png" alt=""> PROJECT-B</h2></a>
|
|
<a class="main_sticky" href="dashboard.html" class="project"><h2><img src="assets/images/fav-icon/icon.png" alt=""> PROJECT-B</h2></a>
|
|
</div>
|
|
<div class="heder-menu">
|
|
<ul>
|
|
<li><a href="addform.html"><i class="fa fa-plus" aria-hidden="true" style="font-size: 24px;"></i> New</a></li>
|
|
<li><a href="#" id="myBtn"><i class="fa fa-upload" aria-hidden="true" style="font-size: 24px;"></i> Open</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mobile-menu-area d-sm-block d-md-block d-lg-none ">
|
|
<div class="mobile-menu">
|
|
<nav class="itsoft_menu">
|
|
<ul class="nav_scroll">
|
|
<li><a href="dashboard.html">home </a></li>
|
|
<li><a href="addform.html">Add New</a></li>
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- <div class="blog-area" >
|
|
<div class="row" style="margin-left: 140px;margin-right: 140px;">
|
|
<div class="col-lg-12" style="text-align: right;padding: 0px; margin-left: 70px;
|
|
margin-right: 70px;">
|
|
<div class="slider-btn" style="margin-top: -43px;">
|
|
<a href="#" class="float-right" id="listview">List View</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="container">
|
|
<div class="row" id="card"></div>
|
|
</div>
|
|
</div> -->
|
|
|
|
<div class="Recent">Recent</div>
|
|
<div class="row section" style="margin-left: 140px;margin-right: 140px;">
|
|
<div class="col-lg-12" style="text-align: right;padding: 0px;margin-left: 70px;
|
|
margin-right: 70px;">
|
|
|
|
</div>
|
|
</div>
|
|
<div class="sideber-box" style="width: 87%;margin-right: 6%;margin-left: 6%; margin-top: 50px" >
|
|
<div class="sideber-content">
|
|
<div class="sideber-title">
|
|
</div>
|
|
</div>
|
|
<div id="list"></div>
|
|
</div>
|
|
|
|
<!-- The Modal -->
|
|
<div id="myModal" class="modal">
|
|
|
|
<!-- Modal content -->
|
|
<div class="modal-content" style="width: 600px; height: 200px;">
|
|
<span class="close" style="margin-left: 530px;">×</span>
|
|
|
|
<span style="margin-top: -13px; font-size: 18px;color: black;font-weight: 500;
|
|
">Select File To Import:</span>
|
|
|
|
<div class = "form_box">
|
|
<input type="file" id="fileInput" accept="application/xml,text/xml" onchange="validateFile(this)" style="margin-top: 15px; border: 3px solid #EEECFE;">
|
|
</div>
|
|
<div class="form-button" style="margin-top: 5px; margin-left: 10px;">
|
|
<button onclick="uploadFile()">Import</button><span id="Message" style="color: rgb(243, 21, 21);"></span>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="copy-right-area">
|
|
<div class="copy-left">
|
|
<span style="color: #533dfd;">© 2023 Project-B. All rights reserved.</span>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- jquery js -->
|
|
<script src="./node_modules/jquery/dist/jquery.min.js" onload="window.$ = window.jQuery = module.exports;"></script>
|
|
<!-- bootstrap js -->
|
|
<script src="assets/js/bootstrap.min.js"></script>
|
|
<!-- carousel js -->
|
|
<script src="assets/js/owl.carousel.min.js"></script>
|
|
<!-- counterup js -->
|
|
<script src="assets/js/jquery.counterup.min.js"></script>
|
|
<!-- waypoints js -->
|
|
<script src="assets/js/waypoints.min.js"></script>
|
|
<!-- wow js -->
|
|
<script src="assets/js/wow.js"></script>
|
|
<!-- imagesloaded js -->
|
|
<script src="assets/js/imagesloaded.pkgd.min.js"></script>
|
|
<!-- venobox js -->
|
|
<script src="venobox/venobox.js"></script>
|
|
<!-- ajax mail js -->
|
|
<!-- <script src="assets/js/ajax-mail.js"></script> -->
|
|
<!-- animated-text js -->
|
|
<script src="assets/js/animated-text.js"></script>
|
|
<!-- venobox min js -->
|
|
<script src="venobox/venobox.min.js"></script>
|
|
<!-- isotope js -->
|
|
<script src="assets/js/isotope.pkgd.min.js"></script>
|
|
<!-- jquery nivo slider pack js -->
|
|
<script src="assets/js/jquery.nivo.slider.pack.js"></script>
|
|
<!-- jquery meanmenu js -->
|
|
<script src="assets/js/jquery.meanmenu.js"></script>
|
|
<script src="assets/js/popper.min.js"></script>
|
|
<!-- jquery scrollup js -->
|
|
|
|
<script src="assets/js/jquery.scrollUp.js"></script>
|
|
<!-- theme js -->
|
|
<script src="assets/js/theme.js"></script>
|
|
<script src="assets/js/jquery.barfiller.js"></script>
|
|
<script src="index.js"></script>
|
|
|
|
|
|
<!-- jquery js -->
|
|
|
|
|
|
<script>
|
|
const Swal = require('sweetalert2')
|
|
function uploadFile() {
|
|
const fileInput = document.getElementById('fileInput');
|
|
const selectedFile = fileInput.files[0];
|
|
console.log(selectedFile)
|
|
|
|
fileupload(selectedFile)
|
|
}
|
|
|
|
var msgDiv = document.getElementById('Message');
|
|
var modal = document.getElementById('myModal');
|
|
var fileInput = document.getElementById('fileInput');
|
|
|
|
function fileupload(filePaths) {
|
|
|
|
console.log('File path:', filePaths);
|
|
|
|
// Handle the selected folder path here
|
|
// You can specify the destination folder path where you want to copy/move the files
|
|
const destinationFolderPath = 'xml';
|
|
|
|
// Use fs to copy or move the file
|
|
const fileName =filePaths.name;
|
|
|
|
var getfilepath =filePaths.path;
|
|
console.log(getfilepath)
|
|
const sourceStream = fs.createReadStream(getfilepath);
|
|
console.log(sourceStream)
|
|
const destinationStream = fs.createWriteStream(path.join(destinationFolderPath, fileName));
|
|
|
|
sourceStream.pipe(destinationStream);
|
|
|
|
sourceStream.on('end', () => {
|
|
console.log('File Uploaded successfully');
|
|
modal.style.display = 'none';
|
|
fileInput.value = "";
|
|
Swal.fire({
|
|
title: 'File Uploaded Successfully',
|
|
icon: 'success',
|
|
confirmButtonText: 'OK'
|
|
}).then((result) => {
|
|
if (result.isConfirmed) {
|
|
location.reload();
|
|
}
|
|
});
|
|
});
|
|
|
|
sourceStream.on('error', (err) => {
|
|
console.error('File Upload error:', err);
|
|
modal.style.display = 'none';
|
|
fileInput.value = "";
|
|
Swal.fire('<i class="fa fa-ban" aria-hidden="true" style="color:red"></i>File Upload error:', err)
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
// $(document).ready(function(){
|
|
|
|
|
|
|
|
// $('.blog-area').show();
|
|
// $('.sideber-box').hide();
|
|
// $('#cardview').hide();
|
|
// $('#listview').show();
|
|
// })
|
|
|
|
// function switchToListView() {
|
|
// $('.blog-area').hide();
|
|
// $('.sideber-box').show();
|
|
// $('#cardview').show();
|
|
// $('#listview').hide();
|
|
// }
|
|
|
|
// // Function to handle switching to card view
|
|
// function switchToCardView() {
|
|
// $('.blog-area').show();
|
|
// $('.sideber-box').hide();
|
|
// $('#cardview').hide();
|
|
// $('#listview').show();
|
|
// }
|
|
|
|
// // Handle the click event for switching to list view
|
|
// $('#listview').on('click', function () {
|
|
// switchToListView();
|
|
// });
|
|
|
|
// // Handle the click event for switching to card view
|
|
// $('#cardview').on('click', function () {
|
|
// switchToCardView();
|
|
// });
|
|
|
|
// Get the modal
|
|
var modal = document.getElementById("myModal");
|
|
|
|
// Get the button that opens the modal
|
|
var btn = document.getElementById("myBtn");
|
|
|
|
// Get the <span> element that closes the modal
|
|
var span = document.getElementsByClassName("close")[0];
|
|
|
|
// When the user clicks the button, open the modal
|
|
btn.onclick = function() {
|
|
modal.style.display = "block";
|
|
}
|
|
|
|
// When the user clicks on <span> (x), close the modal
|
|
span.onclick = function() {
|
|
modal.style.display = "none";
|
|
}
|
|
|
|
// When the user clicks anywhere outside of the modal, close it
|
|
window.onclick = function(event) {
|
|
if (event.target == modal) {
|
|
modal.style.display = "none";
|
|
}
|
|
}
|
|
|
|
|
|
function validateFile(input) {
|
|
const file = input.files[0];
|
|
const allowedExtensions = ["xml"];
|
|
const fileExtension = file.name.split(".").pop().toLowerCase();
|
|
|
|
if (!allowedExtensions.includes(fileExtension)) {
|
|
alert('Invalid file type. Only xml files are allowed.')
|
|
input.value = "";
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
// Function to download a file by filename
|
|
function downloadFile(filename) {
|
|
// You can change the path to your server or specify a URL to download the file
|
|
const fileURL = `xml/${filename}`;
|
|
console.log(fileURL)
|
|
// Create a hidden anchor element to trigger the download
|
|
const a = document.createElement('a');
|
|
a.style.display = 'none';
|
|
a.href = fileURL;
|
|
a.download = filename;
|
|
|
|
// Append the anchor to the body and click it to trigger the download
|
|
document.body.appendChild(a);
|
|
a.click();
|
|
|
|
// Remove the anchor element
|
|
document.body.removeChild(a);
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
</body>
|
|
</html>
|