-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfromfile.html
142 lines (121 loc) · 7.14 KB
/
fromfile.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="" />
<meta name="author" content="" />
<!-- <title>Grayscale - Start Bootstrap Theme</title>-->
<link rel="icon" type="image/x-icon" href="{{url_for('static', filename='assets/img/favicon.ico')}}" />
<!-- Font Awesome icons (free version)-->
<script src="https://use.fontawesome.com/releases/v5.12.1/js/all.js" crossorigin="anonymous"></script>
<!-- Google fonts-->
<link href="https://fonts.googleapis.com/css?family=Varela+Round" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet" />
<!-- Core theme CSS (includes Bootstrap)-->
<link href={{url_for('static', filename='css/styles.css')}} rel="stylesheet" />
</head>
<body id="page-top">
<!-- Navigation-->
<nav class="navbar navbar-expand-lg navbar-light fixed-top" id="mainNav">
<div class="container">
<a href="http://127.0.0.1:5000/" class="navbar-brand js-scroll-trigger" href="#page-top">Home</a><button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">Menu<i class="fas fa-bars"></i></button>
</div>
</nav>
<header class="masthead">
<div class="container d-flex h-100 align-items-center">
<div class="mx-auto text-center">
<form id="upload-form" action="{{ url_for('fromFile') }}" method="POST" enctype="multipart/form-data">
<h2 class="text-white mb-5">Виберіть файл (*.csv)</h2><br>
<input id="file-picker" type="file" name="file" accept="image/*" multiple>
<div id="msg"></div>
<input class="btn btn-primary mx-auto" type="submit" value="ОК" id="upload-button">
</form>
<script>
$("#file-picker").change(function(){
var input = document.getElementById('file-picker');
for (var i=0; i<input.files.length; i++)
{
//koala.jpg, koala.JPG substring(index) lastIndexOf('a') koala.1.jpg
var ext= input.files[i].name.substring(input.files[i].name.lastIndexOf('.')+1).toLowerCase()
if ((ext == 'csv'))
{
$("#msg").text("Files are supported")
}
else
{
$("#msg").text("Files are NOT supported")
document.getElementById("file-picker").value ="";
}
}
} );
</script>
<p>
{% if data.result != None %}
<h3 class="text-white mb-5">Зчитана умова</h3>
<div class="d-flex justify-content-center">
<table class="table table-striped table-dark">
<tbody>
<tr>
<th scope="row">Роботи</th>
{% for i in data.j %}
<td>{{ i }}</td>
{% endfor %}
</tr>
<tr>
<th scope="row">Штрафи</th>
{% for i in data.w %}
<td>{{ i }}</td>
{% endfor %}
</tr>
<tr>
<th scope="row">Директивні строки</th>
{% for i in data.d %}
<td>{{ i }}</td>
{% endfor %}
</tr>
<tr>
<th scope="row">Час виконання</th>
{% for i in data.p %}
<td>{{ i }}</td>
{% endfor %}
</tr>
</tbody>
</table>
</div>
<div class="d-flex justify-content-center">
<div class="card bg-light mb-3" style="max-width: 18rem;">
<div class="card-header">Жадібний алгоритм</div>
<div class="card-body">
<p class="card-text">Розклад робіт</p>
<h5 class="card-title text-info">{{ data.solutionG }}</h5>
<p class="card-text">Цільова функція</p>
<h4 class="text-info">{{ data.goalG }}</h4>
</div>
</div>
<div class="card bg-light mb-3" style="max-width: 18rem;">
<div class="card-header">Метод гілок та меж</div>
<div class="card-body">
<p class="card-text">Розклад робіт</p>
<h5 class="card-title text-info">{{ data.solutionB }}</h5>
<p class="card-text">Цільова функція</p>
<h4 class="text-info">{{ data.goalB }}</h4>
</div>
</div>
</div>
{% endif %}
</div>
</div>
</header>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.3.0/Chart.min.js"></script>
<!-- Footer-->
<footer class="footer bg-black small text-center text-white-50"><div class="container"> © 2020</div></footer>
<!-- Bootstrap core JS-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.bundle.min.js"></script>
<!-- Third party plugin JS-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.4.1/jquery.easing.min.js"></script>
<!-- Core theme JS-->
<script src="{{url_for('static', filename='js/scripts.js')}}"></script>
</body>
</html>