-
Notifications
You must be signed in to change notification settings - Fork 0
/
portal.php
161 lines (159 loc) · 6.09 KB
/
portal.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
<style>
header.masthead{
background-image: url('<?php echo validate_image($_settings->info('cover')) ?>') !important;
}
header.masthead .container{
background: transparent;
}
</style>
<!-- Masthead-->
<header class="masthead">
<div class="container">
<div class="masthead-subheading">WELCOME TO DOXTYPE.CO</div>
<div class="masthead-heading text-uppercase">Explore our Tour Packages</div>
<a class="btn btn-primary btn-xl text-uppercase" href="#home">View Tours</a>
</div>
</header>
<!-- Services-->
<section class="page-section bg-dark" id="home">
<div class="container">
<h2 class="text-center">TOUR PACKAGES</h2>
<div class="d-flex w-100 justify-content-center">
<hr class="border-warning" style="border:3px solid" width="15%">
</div>
<div class="row">
<?php
$packages = $conn->query("SELECT * FROM `packages` order by rand() limit 3");
while($row = $packages->fetch_assoc() ):
$cover='';
if(is_dir(base_app.'uploads/package_'.$row['id'])){
$img = scandir(base_app.'uploads/package_'.$row['id']);
$k = array_search('.',$img);
if($k !== false)
unset($img[$k]);
$k = array_search('..',$img);
if($k !== false)
unset($img[$k]);
$cover = isset($img[2]) ? 'uploads/package_'.$row['id'].'/'.$img[2] : "";
}
$row['description'] = strip_tags(stripslashes(html_entity_decode($row['description'])));
$review = $conn->query("SELECT * FROM `rate_review` where package_id='{$row['id']}'");
$review_count =$review->num_rows;
$rate = 0;
while($r= $review->fetch_assoc()){
$rate += $r['rate'];
}
if($rate > 0 && $review_count > 0)
$rate = number_format($rate/$review_count,0,"");
?>
<div class="col-md-4 p-4 ">
<div class="card w-100 rounded-0">
<img class="card-img-top" src="<?php echo validate_image($cover) ?>" alt="<?php echo $row['title'] ?>" height="200rem" style="object-fit:cover">
<div class="card-body">
<h5 class="card-title truncate-1 w-100"><?php echo $row['title'] ?></h5><br>
<div class=" w-100 d-flex justify-content-start">
<div class="stars stars-small">
<input disabled class="star star-5" id="star-5" type="radio" name="star" <?php echo $rate == 5 ? "checked" : '' ?>/> <label class="star star-5" for="star-5"></label>
<input disabled class="star star-4" id="star-4" type="radio" name="star" <?php echo $rate == 4 ? "checked" : '' ?>/> <label class="star star-4" for="star-4"></label>
<input disabled class="star star-3" id="star-3" type="radio" name="star" <?php echo $rate == 3 ? "checked" : '' ?>/> <label class="star star-3" for="star-3"></label>
<input disabled class="star star-2" id="star-2" type="radio" name="star" <?php echo $rate == 2 ? "checked" : '' ?>/> <label class="star star-2" for="star-2"></label>
<input disabled class="star star-1" id="star-1" type="radio" name="star" <?php echo $rate == 1 ? "checked" : '' ?>/> <label class="star star-1" for="star-1"></label>
</div>
</div>
<p class="card-text truncate"><?php echo $row['description'] ?></p>
<div class="w-100 d-flex justify-content-end">
<a href="./?page=view_package&id=<?php echo md5($row['id']) ?>" class="btn btn-sm btn-flat btn-warning">View Package <i class="fa fa-arrow-right"></i></a>
</div>
</div>
</div>
</div>
<?php endwhile; ?>
</div>
<div class="d-flex w-100 justify-content-end">
<a href="./?page=packages" class="btn btn-flat btn-warning mr-4">Explore Package <i class="fa fa-arrow-right"></i></a>
</div>
</div>
</section>
<!-- About-->
<section class="page-section" id="about">
<div class="container">
<div class="text-center">
<h2 class="section-heading text-uppercase">About Us</h2>
</div>
<div>
<div class="card w-100">
<div class="card-body">
<?php echo file_get_contents(base_app.'about.html') ?>
</div>
</div>
</div>
</div>
</section>
<!-- Contact-->
<section class="page-section" id="contact">
<div class="container">
<div class="text-center">
<h2 class="section-heading text-uppercase">Contact Us</h2>
<h3 class="section-subheading text-muted">Send us a message for inquiries.</h3>
</div>
<!-- * * * * * * * * * * * * * * *-->
<!-- * * SB Forms Contact Form * *-->
<!-- * * * * * * * * * * * * * * *-->
<!-- This form is pre-integrated with SB Forms.-->
<!-- To make this form functional, sign up at-->
<!-- https://startbootstrap.com/solution/contact-forms-->
<!-- to get an API token!-->
<form id="contactForm" >
<div class="row align-items-stretch mb-5">
<div class="col-md-6">
<div class="form-group">
<!-- Name input-->
<input class="form-control" id="name" name="name" type="text" placeholder="Your Name *" required />
</div>
<div class="form-group">
<!-- Email address input-->
<input class="form-control" id="email" name="email" type="email" placeholder="Your Email *" data-sb-validations="required,email" />
</div>
<div class="form-group mb-md-0">
<input class="form-control" id="subject" name="subject" type="subject" placeholder="Subject *" required />
</div>
</div>
<div class="col-md-6">
<div class="form-group form-group-textarea mb-md-0">
<!-- Message input-->
<textarea class="form-control" id="message" name="message" placeholder="Your Message *" required></textarea>
</div>
</div>
</div>
<div class="text-center"><button class="btn btn-primary btn-xl text-uppercase" id="submitButton" type="submit">Send Message</button></div>
</form>
</div>
</section>
<script>
$(function(){
$('#contactForm').submit(function(e){
e.preventDefault()
$.ajax({
url:_base_url_+"classes/Master.php?f=save_inquiry",
method:"POST",
data:$(this).serialize(),
dataType:"json",
error:err=>{
console.log(err)
alert_toast("an error occured",'error')
end_loader()
},
success:function(resp){
if(typeof resp == 'object' && resp.status == 'success'){
alert_toast("Inquiry sent",'success')
$('#contactForm').get(0).reset()
}else{
console.log(resp)
alert_toast("an error occured",'error')
end_loader()
}
}
})
})
})
</script>