-
Notifications
You must be signed in to change notification settings - Fork 0
/
themew7.php
244 lines (219 loc) · 8.62 KB
/
themew7.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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
<?php
ini_set('display_errors', 'On');
error_reporting(E_ALL);
$p = $_GET['p'] ?? '1';
$w = $_GET['w'] ?? '1';
require 'dspcnt.php';
$xml=simplexml_load_file("data/website".$b.".xml") or die("Error: Cannot create object");
$page = $xml->xpath("/website/page[name!='']");
function ic_html($pname) {
if (strpos(" ".$pname,chr(0xef))==1) $rt = '<i class="fa">'.substr($pname,0,3).'</i> '.strtoupper(substr($pname,4));
else $rt = strtoupper($pname);
return $rt;
}
function ic_strip($pname) {
if (strpos(" ".$pname,chr(0xef))==1) $rt = strtoupper(substr($pname,4));
else $rt = strtoupper($pname);
return $rt;
}
//if($_SERVER['HTTPS']) $mps="https://"; else $mps="http://";
?>
<!DOCTYPE html>
<html>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<title><?php echo strip_tags($xml->title) ?></title>
<style>
body,h1,h2,h3,h4,h5,h6 {font-family: "Lato", sans-serif;}
body, html {
height: 100%;
color: #777;
line-height: 1.8;
}
/* Create a Parallax Effect */
.bgimg-1, .bgimg-2, .bgimg-3, .bgimg-4, .bgimg-5, .bgimg-6 {
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
/* First image (Logo. Full height) */
.bgimg-1 {
background-image: url('<?php echo $page[0]->image ?>');
min-height: 100%;
}
/* Second image */
.bgimg-2 {
background-image: url("<?php echo $page[1]->image ?>");
min-height: 400px;
}
/* Third image */
.bgimg-3 {
background-image: url("<?php echo $page[2]->image ?>");
min-height: 400px;
}
/* Fourth image */
.bgimg-4 {
background-image: url("<?php echo $page[3]->image ?>");
min-height: 400px;
}
/* Fifth image */
.bgimg-5 {
background-image: url("<?php echo $page[4]->image ?>");
min-height: 400px;
}
/* Sixth image */
.bgimg-6 {
background-image: url("<?php echo $page[5]->image ?>");
min-height: 400px;
}
.w3-wide {letter-spacing: 10px;}
.w3-hover-opacity {cursor: pointer;}
/* Turn off parallax scrolling for tablets and phones */
@media only screen and (max-device-width: 1024px) {
.bgimg-1, .bgimg-2, .bgimg-3, .bgimg-4, .bgimg-5, .bgimg-6 {
background-attachment: scroll;
}
}
</style>
<body>
<!-- Navbar (sit on top) -->
<div class="w3-top">
<div class="w3-bar" id="myNavbar">
<a class="w3-bar-item w3-button w3-hover-black w3-hide-medium w3-hide-large w3-right" href="javascript:void(0);" onclick="toggleFunction()" title="Toggle Navigation Menu">
<i class="fa fa-bars"></i>
</a>
<a href="#home" class="w3-bar-item w3-button">HOME</a>
<?php
$i=1;
foreach ($page as $item)
echo "<a href='#p".$i++."' class='w3-bar-item w3-button w3-hide-small'>" . ic_html($item->name) . "</a>";
?>
<a href="#" class="w3-bar-item w3-button w3-hide-small w3-right w3-hover-red">
<i class="fa fa-search"></i>
</a>
</div>
<!-- Navbar on small screens -->
<div id="navDemo" class="w3-bar-block w3-white w3-hide w3-hide-large w3-hide-medium">
<?php
$i=1;
foreach ($page as $item)
echo "<a href='#p".$i++."' class='w3-bar-item w3-button' onclick='toggleFunction()'>" . ic_strip($item->name) . "</a>";
?>
<a href="#" class="w3-bar-item w3-button">SEARCH</a>
</div>
</div>
<!-- First Parallax Image with Logo Text -->
<div class="bgimg-1 w3-display-container w3-opacity-min" id="home">
<div class="w3-display-middle" style="white-space:nowrap;">
<span class="w3-center w3-padding-large w3-black w3-xlarge w3-wide w3-animate-opacity"><?php echo strtoupper($xml->title) ?></span>
</div>
</div>
<?php
$i=0;
foreach ($page as $item) {
if((++$i>1) && (strlen($item->image)>4)) {
echo "<div class='bgimg-".$i." w3-display-container w3-opacity-min'>";
echo "<div class='w3-display-middle'>";
echo "<span class='w3-xxlarge w3-text-white w3-wide'>".ic_strip($item->name)."</span>";
echo "</div>";
echo "</div>";
}
echo "<div class='w3-content w3-container w3-padding-64' id='p".$i."' lang='".$item['language']."'>";
echo trim($item->contents);
if($item['type']=="comments") {
// begin htmlcommentbox.com -->
echo "<div id='HCB_comment_box'>";
?> <a href="https://www.htmlcommentbox.com">HTML Comment Box</a> is loading comments...</div>
<link rel="stylesheet" type="text/css" href="https://www.htmlcommentbox.com/static/skins/default/skin.css" />
<script type="text/javascript" language="javascript" id="hcb"> /*<!--*/ if(!window.hcb_user){hcb_user={ };} (function(){s=document.createElement("script");s.setAttribute("type","text/javascript");s.setAttribute("src", "https://www.htmlcommentbox.com/jread?page="+escape((window.hcb_user && hcb_user.PAGE)||(""+window.location)).replace("+","%2B")+"&opts=470&num=10");if (typeof s!="undefined") document.getElementsByTagName("head")[0].appendChild(s);})(); /*-->*/ </script>
<!-- end htmlcommentbox.com --><?php
}
if($item['type']=="form") {
?> <div>
<div class="w3-half">
<form action="#alert" role="form" method="post">
<p><input type="text" class="w3-input w3-border" placeholder="Name" name="name"></p>
<p><input type="text" class="w3-input w3-border" placeholder="Contact Phone #" name="phone"></p>
<p><input type="email" class="w3-input w3-border" placeholder="Email" name="email"></p>
<p><input type="text" class="w3-input w3-border" placeholder="Message" name="message"></p>
<p><button class="w3-button w3-black w3-border" type="submit" id="alert">
<i class="fa fa-paper-plane"></i> SEND MESSAGE
</button></p>
</form>
<?php
if ($name!="")
if(sendDb($name,$phone,$email,$message)) {
echo "<div class='w3-panel w3-green' id='alert'>";
echo "<b>Contact information submitted. We will contact you as soon as possible.</b>";
echo "</div>";
} else {
echo "<div class='w3-panel w3-blue' id='alert'>";
echo "<b>Missing Name or Contact Info.</b>";
echo "</div>";
}
} ?>
</div>
</div><?php
echo "</div>";
}
?>
<!-- Footer -->
<footer class="w3-center w3-black w3-padding-64 w3-opacity w3-hover-opacity-off">
<a href="#home" class="w3-button w3-light-grey"><i class="fa fa-arrow-up w3-margin-right"></i>To the top</a>
<div class="w3-xlarge w3-section">
<i class="fa fa-facebook-official w3-hover-opacity"></i>
<i class="fa fa-instagram w3-hover-opacity"></i>
<i class="fa fa-snapchat w3-hover-opacity"></i>
<i class="fa fa-pinterest-p w3-hover-opacity"></i>
<i class="fa fa-twitter w3-hover-opacity"></i>
<i class="fa fa-linkedin w3-hover-opacity"></i>
</div>
<p>Powered by <a href="https://www.w3schools.com/w3css/default.asp" title="W3.CSS" target="_blank" class="w3-hover-text-green">w3.css</a></p>
</footer>
<!-- Add Google Maps -->
<script>
function myMap()
{
myCenter=new google.maps.LatLng(41.878114, -87.629798);
var mapOptions= {
center:myCenter,
zoom:12, scrollwheel: false, draggable: false,
mapTypeId:google.maps.MapTypeId.ROADMAP
};
var map=new google.maps.Map(document.getElementById("googleMap"),mapOptions);
var marker = new google.maps.Marker({
position: myCenter,
});
marker.setMap(map);
}
// Change style of navbar on scroll
window.onscroll = function() {myFunction()};
function myFunction() {
var navbar = document.getElementById("myNavbar");
if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100) {
navbar.className = "w3-bar" + " w3-card-2" + " w3-animate-top" + " w3-white";
} else {
navbar.className = navbar.className.replace(" w3-card-2 w3-animate-top w3-white", "");
}
}
// Used to toggle the menu on small screens when clicking on the menu button
function toggleFunction() {
var x = document.getElementById("navDemo");
if (x.className.indexOf("w3-show") == -1) {
x.className += " w3-show";
} else {
x.className = x.className.replace(" w3-show", "");
}
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBu-916DdpKAjTmJNIgngS6HL_kDIKU0aU&callback=myMap"></script>
<!--
To use this code on your website, get a free API key from Google.
Read more at: https://www.w3schools.com/graphics/google_maps_basic.asp
-->
</body>
</html>