forked from twpayne/igc2kmz.py
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.php
161 lines (153 loc) · 7.49 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
<link rel="manifest" href="manifest.json">
<meta name="description" content="IGC2KMZ - converts paraglider and hang glider track logs into Google Earth KML format with lots of features.">
<meta name="keywords" content="paragliding, weather, India, Bir, paragliding weather, outdoor activities, Himachal Pradesh, India, Himalayas">
<meta name="author" content="Jigish Gohil - https://igc2kmz.cyberorg.co.in">
<meta name="robots" content="index, follow"><!-- Direct search engines to index and follow the page -->
<meta name="revisit-after" content="7 days"><!-- Suggest how often search engines should revisit the page -->
<meta name="language" content="English"><!-- Specify the language of the content -->
<meta name="distribution" content="global"><!-- Indicate the distribution of the content -->
<meta name="referrer" content="origin-when-cross-origin"><!-- Define the referrer policy -->
<meta name="copyright" content="2024 Jigish Gohil"><!-- Provide copyright information -->
<meta name="geo.placename" content="Bir, Himachal Pradesh, India"><!-- Specify geographical location -->
<meta name="geo.region" content="IN-HP"><!-- Specify the geographical region -->
<meta name="geo.position" content="32.037° N; 76.708° E"><!-- Specify latitude and longitude -->
<meta name="ICBM" content="32.037, 76.708"><!-- Specify latitude and longitude in decimal degrees -->
<meta name="rating" content="general"><!-- Specify content rating -->
<!-- Meta tags for web app capabilities -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="IGC2KMZ">
<meta name="application-name" content="IGC2KMZ">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="apple-touch-icon.png">
<meta name="msapplication-tooltip" content="IGC2KMZ">
<meta name="msapplication-starturl" content="https://igc2kmz.cyberorg.co.in/">
<meta name="theme-color" content="#ffffff">
<!-- Open Graph meta tags for social sharing -->
<meta property="og:title" content="IGC2KMZ">
<meta property="og:description" content="IGC2KMZ - converts paraglider and hang glider track logs into Google Earth KML format with lots of features.">
<meta property="og:url" content="https://igc2kmz.cyberorg.co.in/">
<meta property="og:image" content="https://igc2kmz.cyberorg.co.in/preview.jpg">
<meta property="og:type" content="website">
<meta property="og:locale" content="en_US">
<meta property="og:site_name" content="IGC2KMZ">
<!-- Twitter meta tags for social sharing -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@cyberorg">
<meta name="twitter:title" content="IGC2KMZ">
<meta name="twitter:description" content="IGC2KMZ - converts paraglider and hang glider track logs into Google Earth KML format with lots of features.">
<meta name="twitter:image" content="https://igc2kmz.cyberorg.co.in/preview.jpg">
<title>IGC to KMZ converter</title>
<link rel="icon" type="image/png" href="favicon-32x32.png">
<link rel="stylesheet" href="styles.css">
<style>
#loading-message {
display: none;
text-align: center;
}
</style>
</head>
<body>
<div class="container">
<div style="text-align: center;"><img class="logo" src="android-chrome-192x192.png" alt="logo"></div>
<h1>IGC to KMZ Converter</h1>
<form id="upload-form" action="" method="post" enctype="multipart/form-data">
<div>
<label for="file-input" class="choose-file-label">Choose file</label>
<input type="file" name="pic" accept=".igc" id="file-input"/>
<span id="file-name" class="file-name">No file chosen</span>
<button type="submit" name="btn-upload" class="upload-button-label">Upload</button>
</div>
</form>
<table>
<thead>
<tr>
<th>Filename</th>
<th style="text-align:center;">Size</th>
<th style="text-align:center;">At</th>
<th></th>
</tr>
</thead>
<tbody>
<div id="loading-message">Please wait...</div>
<?php
// Function to delete a file
function deleteFile($filename) {
if (file_exists($filename)) {
unlink($filename);
return true;
}
return false;
}
// Upload file if button is clicked
if(isset($_POST['btn-upload'])) {
$pic = rand(1000,100000)."-".$_FILES['pic']['name'];
$pic_loc = $_FILES['pic']['tmp_name'];
$folder="uploaded_files/";
$cmd = "./i2k $folder$pic $pic_loc";
system($cmd,$ret_val);
echo "<meta http-equiv=\"refresh\" content=\"1;URL=index.php\">";
}
$uploaded_files = glob("uploaded_files/*");
foreach($uploaded_files as $file) {
$filename = basename($file);
$size = filesize($file);
$lastUpdated = date("Y-m-d H:i:s", filemtime($file));
echo "<tr>";
echo "<td><a href='uploaded_files/$filename' download>$filename</a></td>";
echo "<td>" . round($size / 1024, 2) . " KB</td>";
echo "<td>$lastUpdated</td>";
echo "<td><a href='?delete=$filename'><img src='delete.svg' alt='Delete' class='delete-icon'></a></td>";
echo "</tr>";
}
?>
</tbody>
</table>
</div>
<div class="footer">
<div class="bookcontainer" style="margin-bottom: 5px;">
<div class="image-column"><img src="cover-w.svg" width="100%" height="100%" alt="cover"></div>
<div class="description-column">
<b>ALOFT AND UNBOUND</b><br>
A book about paragliding life<br>
<a href="https://aloftandunbound.paraguide.in">https://aloftandunbound.paraguide.in</a>
</div>
</div>
<div id="info" style="padding:15px;">
<a href="https://github.com/cyberorg/igc2kmz">This page source code</a><br>
<a href="http://cyberorg.github.io/xcleague/">All about Paragliding in India</a><br>
<a href="http://paraguide.in/">Paragliding Guide, Thermalling and XC courses in India</a><br>
</div>
</div>
<?php
// Handle file deletion
if(isset($_GET['delete'])) {
$fileToDelete = "uploaded_files/" . $_GET['delete'];
if(deleteFile($fileToDelete)) {
echo "<p>File deleted successfully.</p>";
echo "<meta http-equiv=\"refresh\" content=\"1;URL=index.php\">";
} else {
echo "<p>Error deleting the file.</p>";
}
}
?>
<script>
document.getElementById('file-input').addEventListener('change', function() {
document.getElementById('file-name').textContent = this.files[0].name;
});
document.getElementById('upload-form').addEventListener('submit', function() {
document.getElementById('loading-message').style.display = 'block';
});
</script>
</body>
</html>