-
Notifications
You must be signed in to change notification settings - Fork 0
/
fileupdate.php
98 lines (86 loc) · 2.8 KB
/
fileupdate.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
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<!DOCTYPE html>
<html lang="en">
<head>
<title>File Update</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script>
function startUpload()
{
var id = setInterval(frame, 50);
var percent = 1;
$('.btnprogress').text('Continue')
function frame() {
if (percent >= 100) {
clearInterval(id);
$('.btnprogress').text('Close')
} else {
percent++;
$('.progress-bar').css('width', percent+'%').attr('aria-valuenow', percent);
}
}
}
function clickProgress()
{
var progress = $('.btnprogress').text();
if(progress =='Continue')
{
window.open(window.location.href);
}
else
{
$('#myModal').modal('toggle');
}
}
</script>
</head>
<body>
<div class="container well">
<form>
<div class="form-group">
<label for="usr">Topic</label>
<input type="text" class="form-control" id="usr">
</div>
<div class="form-group">
<label for="pwd">Description</label>
<input type="text" class="form-control" id="pwd">
</div>
<div class="pull-right">
<button type="button" class="btn btn-primary" data-toggle="modal" data-backdrop="static" data-keyboard="false" data-target="#myModal" onclick="startUpload()" >Update</button>
</div>
</form>
</div>
<!-- Modal -->
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Update initiated</h4>
</div>
<div class="modal-body">
<p>File update in progress.....</p>
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="70"
aria-valuemin="0" aria-valuemax="100" style="width:70%">
<span class="sr-only">70% Complete</span>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-info btnprogress" onclick="clickProgress()">
Continue
</button>
</div>
</div>
</div>
</div>
</body>
</html>