forked from luponzo86/rhapsody-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
query_Uniprot.php
86 lines (71 loc) · 2.35 KB
/
query_Uniprot.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
<!DOCTYPE html>
<html lang="en">
<head>
<?php readfile("./html/header.html"); ?>
</head>
<body>
<?php
$currentPage = '';
include './html/navbar.php';
?>
<div class="jumbotron">
<div class="container text-center">
<h2>Uniprot search tool</h2>
</div>
</div>
<div class="container">
<form class="needs-validation" novalidate action="javascript:query_Uniprot()">
<div class="form-row">
<div class="col-md"></div>
<div class="col-md-6 py-4">
<div class="input-group">
<div class="input-group-prepend">
<button class="btn btn-primary" type="submit" id="btn">
<i class="fas fa-search"></i></button>
</div>
<input type="text" class="form-control" name="Uquery" id="Uquery"
placeholder="search Uniprot..." required>
</div>
<small class="form-text text-muted">find the correct
unique entry identifier for your sequence by querying the Uniprot
database
</small>
<div class="invalid-feedback">
Invalid query
</div>
</div>
<div class="col-md"></div>
</div>
</form>
</div>
<?php readfile("./html/footer.html"); ?>
<?php readfile("./html/js_src.html"); ?>
<script>
function query_Uniprot() {
var query = document.getElementById("Uquery").value;
query = query.trim().split(' ').join('+');
var url = 'https://www.uniprot.org/uniprot/?query=' + query
+ '&fil=organism%3A%22Homo+sapiens+(Human)+[9606]%22&sort=score#';
window.location.href = url;
}
// Example starter JavaScript for disabling form submissions if there are invalid fields
(function() {
'use strict';
window.addEventListener('load', function() {
// Fetch all the forms we want to apply custom Bootstrap validation styles to
var forms = document.getElementsByClassName('needs-validation');
// Loop over them and prevent submission
var validation = Array.prototype.filter.call(forms, function(form) {
form.addEventListener('submit', function(event) {
if (form.checkValidity() === false) {
event.preventDefault();
event.stopPropagation();
}
form.classList.add('was-validated');
}, false);
});
}, false);
})();
</script>
</body>
</html>