-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.php
executable file
·159 lines (150 loc) · 6.08 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
<?php
/*
* Initial Resume Builder Template
*/
require_once __DIR__ . '/Template.php';
$templateObj = new Template();
$templatesFiles = $templateObj->getTemplates();
$templates = ($templatesFiles) ? $templatesFiles : [];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Resume Builder</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">
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
body {
font: 20px Montserrat, sans-serif;
line-height: 1.8;
color: #f5f6f7;
}
p {font-size: 16px;}
.margin {margin-bottom: 45px;}
.bg-1 {
background-color: #1abc9c; /* Green */
color: #ffffff;
min-height: 470px;
}
.bg-4 {
background-color: #2f2f2f; /* Black Gray */
color: #fff;
}
select{
width:440px;
color: #ccc;
font-size: 16px;
}
.container-fluid {
padding-top: 70px;
padding-bottom: 70px;
}
.navbar {
padding-top: 15px;
padding-bottom: 15px;
border: 0;
border-radius: 0;
margin-bottom: 0;
font-size: 12px;
letter-spacing: 5px;
}
.navbar-nav li a:hover {
color: #1abc9c !important;
}
#downloadcontent{
display: none;
width: 450px;
margin: 0 auto;
}
#downloadcontent a{
color:#fff;
font-size: 14px;
font-weight: 600;
text-decoration: underline;
}
</style>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function (e) {
jQuery('#choosetemplate').on('change', function (ev) {
jQuery('#downloadcontent').hide();
var template = $(this).val();
if (template !== '') {
console.log(template);
jQuery.ajax({
url: 'action.php',
method: 'POST',
data: {
template: template
},
dataType: 'json',
success: function (response) {
console.log(response);
if (response.success) {
jQuery('#pdfdownload').attr('href', response.pdf);
jQuery('#docxownload').attr('href', response.docx);
jQuery('#downloadcontent').show();
} else {
jQuery('#downloadcontent').hide();
alert(response.message);
}
}
});
} else {
jQuery('#pdfdownload').attr('href', '#');
jQuery('#docxownload').attr('href', '#');
jQuery('#downloadcontent').hide();
}
});
});
</script>
</head>
<body>
<!-- Navbar -->
<nav class="navbar navbar-default">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.php">Resume Builder</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav navbar-right">
<li><a href="index.php">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</div>
</nav>
<!-- First Container -->
<div id="about" class="container-fluid bg-1 text-center">
<h3 class="margin">Please select a template for resume.</h3>
<form>
<div class="form-group">
<select class="form-control1" id="choosetemplate">
<option value="" selected>Choose a template</option>
<?php foreach ($templates as $template): ?>
<option value="<?php echo $template['path']; ?>"><?php echo $template['name']; ?></option>
<?php endforeach; ?>
</select>
</div>
</form>
<div id="downloadcontent">
<div class="col-md-6"><a id="pdfdownload" href="#" download>Download PDF <span class="glyphicon glyphicon-file"></span></a></div>
<div class="col-md-6"><a id="docxownload" href="#" download>Download Docx <span class="glyphicon glyphicon-file"></span></a></div>
</div>
</div>
<!-- Footer -->
<footer class="container-fluid bg-4 text-center">
<p>Resume Builder Template</p>
</footer>
</body>
</html>