-
Notifications
You must be signed in to change notification settings - Fork 0
/
approve-business2.php
194 lines (153 loc) · 5.93 KB
/
approve-business2.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
<?php
session_start();
if(!isset($_SESSION['id'])){
header("location: login.php");
}
require "database/connection.php";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>Easy Learn</title>
<meta content="" name="description">
<meta content="" name="keywords">
<!-- Favicons -->
<link href="assets/img/easylearn/logo4.png" rel="icon">
<link href="assets/img/easylearn/logo4.png" rel="apple-touch-icon">
<!-- Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,600;1,700&family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap" rel="stylesheet">
<!-- Vendor CSS Files -->
<link href="assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="assets/vendor/bootstrap-icons/bootstrap-icons.css" rel="stylesheet">
<link href="assets/vendor/fontawesome-free/css/all.min.css" rel="stylesheet">
<link href="assets/vendor/glightbox/css/glightbox.min.css" rel="stylesheet">
<link href="assets/vendor/swiper/swiper-bundle.min.css" rel="stylesheet">
<link href="assets/vendor/aos/aos.css" rel="stylesheet">
<!-- Template Main CSS File -->
<link href="assets/css/main.css" rel="stylesheet">
</head>
<body>
<main id="main">
<section id="pricing" class="pricing pt-0">
<div class="container" data-aos="fade-up">
<div class="section-header mt-2 d-flex justify-content-center align-items-center">
<a href="javascript:history.back();">
<i class="bi bi-arrow-left"></i>
<a href="#" style="font-size: 1.2rem; color: rgba(0,0,0,1); margin-left: .5rem;"> Approve Business</a>
</a>
</div>
<div class="fetch-room-mate">
<?php
if(isset($_GET['id'])){
$id = $_GET['id'];
}
$output = '';
$sql2 = "SELECT * FROM products WHERE id=?";
$stmt2 = $conn->prepare($sql2);
$stmt2->bind_param('s', $id);
if($stmt2->execute()){
$result2 = $stmt2->get_result();
if($result2->num_rows > 0){
$rowss = $result2->fetch_assoc();
$sql3 = "SELECT * FROM users WHERE user_id=?";
$stmt3 = $conn->prepare($sql3);
$yid = $rowss['user_id'];
$stmt3->bind_param('s', $yid);
if($stmt3->execute()){
$result3 = $stmt3->get_result();
if($result3->num_rows > 0){
$row3 = $result3->fetch_assoc();
$name = $row3['lastname'] . " " . $row3['firstname'];
}}
?>
<form id="business_form">
<div class="row gy-4">
<div class="col-lg-4" data-aos="fade-up" data-aos-delay="100">
<div class="pricing-item message">
<h3><?= $rowss['item_name']; ?></h3>
<h4 style="font-size: 1.3rem; color: rgba(0,0,0,.6);">#<?= $rowss['category'].' #'.$rowss['price'].' #'.$rowss['description']; ?></h4>
<section id="testimonials" class="testimonials">
<input type="hidden" id="teacher_id" value="<?= $id; ?>">
<input type="hidden" id="yid" value="<?= $yid; ?>">
<div class="container position-relative" data-aos="fade-up">
<div class="testimonials-slider swiper" data-aos="fade-up" data-aos-delay="100">
<div class="swiper-wrapper">
<div class="swiper-slide">
<div class="testimonial-item">
<img src="<?= $rowss['image']; ?>" style="border-radius: 25px;" class="testimonial-img" alt="">
</div>
</div>
</div>
<div class="swiper-pagination"></div>
</div>
</form>
</div>
</section>
<button name="btn" id="btn" class="buy-btn">Approve Business</button>
</div>
</div><!-- End Pricing Item -->
</div>
<?php
}
}
echo $output;
?>
</div>
</div>
</section><!-- End Pricing Section -->
</main>
<footer id="footer" class="footer">
</footer><!-- End Footer -->
<!-- End Footer -->
<a href="#" class="scroll-top d-flex align-items-center justify-content-center"><i class="bi bi-arrow-up-short"></i></a>
<div id="preloader"></div>
<!-- Vendor JS Files -->
<script src="assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="assets/vendor/purecounter/purecounter_vanilla.js"></script>
<script src="assets/vendor/glightbox/js/glightbox.min.js"></script>
<script src="assets/vendor/swiper/swiper-bundle.min.js"></script>
<script src="assets/vendor/aos/aos.js"></script>
<script src="assets/vendor/php-email-form/validate.js"></script>
<!-- Template Main JS File -->
<script src="js/jquery2.js"></script>
<script src="assets/js/main.js"></script>
</body>
</html>
<script>
$(document).ready(function(){
$(document).on('click', '#btn', function(e){
e.preventDefault();
var btn = $('#btn').val();
var yid = $('#yid').val();
var teacher_id = $('#teacher_id').val();
if(yid == ""){
Swal.fire(
'Invalid',
'Enter a comment',
'error'
)
}
else{
$.ajax({
url: 'backend/approve-business2.php',
type: 'post',
data:
{
btn: btn,
yid: yid,
teacher_id:teacher_id
},
success: function(data){
$('.message').html(data);
//location.href = 'admin-dashboard.php';
}
});
$('#business_form')[0].reset();
}
});
});
</script>