-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfirmteacher.php
154 lines (126 loc) · 3.84 KB
/
confirmteacher.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
<?php
include ( "inc/connection.inc.php" );
ob_start();
session_start();
if (!isset($_SESSION['user_login'])) {
header('location: login.php');
}
else {
$user = $_SESSION['user_login'];
$result = $con->query("SELECT * FROM user WHERE id='$user'");
$get_user_name = $result->fetch_assoc();
$uname_db = $get_user_name['fullname'];
$utype_db = $get_user_name['type'];
}
if (isset($_REQUEST['confirm'])) {
$tid = mysqli_real_escape_string($con, $_REQUEST['confirm']);
$result = mysqli_query($con, "INSERT INTO applied_post (applied_by,applied_to) VALUES ('$user','$tid')");
$result = $con->query("SELECT * FROM user WHERE id='$tid'");
$get_user_name = $result->fetch_assoc();
$uname = $get_user_name['fullname'];
$utype = $get_user_name['type'];
$error = "You Successfully Selected <a href='aboutme.php?uid=".$tid."' style='color: #4CAF50;'>".$uname."</a>";
}else{
header('location: logout.php');
}
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="css/style.css">
<link href="css/footer.css" rel="stylesheet" type="text/css" media="all" />
<!-- menu tab link -->
<link rel="stylesheet" type="text/css" href="css/homemenu.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
</head>
<body class="body1">
<div>
<div>
<header class="header">
<div class="header-cont">
<?php
include 'inc/banner.inc.php';
?>
</div>
</header>
<div class="w3-sidebar w3-bar-block w3-collapse w3-card-2 w3-animate-left" stylRe="width:100px;" id="mySidebar">
<button class="w3-bar-item w3-button w3-large w3-hide-large" onclick="w3_close()">Close ×</button>
<a href="index.php" class="w3-bar-item w3-button">Tution</a>
<a href="photography.php" class="w3-bar-item w3-button">Photography</a>
<a href="#" class="w3-bar-item w3-button">IT</a>
</div>
<div class="topnav">
<div class="parent2">
<div class="mask2"><i class="fa fa-home fa-3x"></i></div>
</div>
<a class="active navlink" href="index.php" style="margin: 0px 0px 0px 100px;">Newsfeed</a>
<a class="navlink" href="search.php">Search Tutor</a>
<?php
if($utype_db == "teacher")
{
}else {
echo '<a class="navlink" href="postform.php">Post</a>';
}
?>
<div style="float: right;" >
<table>
<tr>
<?php
if($user != ""){
$resultnoti = $con->query("SELECT * FROM applied_post WHERE post_by='$user' AND student_ck='no'");
$resultnoti_cnt = $resultnoti->num_rows;
if($resultnoti_cnt == 0){
$resultnoti_cnt = "";
}else{
$resultnoti_cnt = '('.$resultnoti_cnt.')';
}
echo '<td>
<a class="navlink" href="notification.php">Notification'.$resultnoti_cnt.'</a>
</td>
<td>
<a class="navlink" href="profile.php?uid='.$user.'">'.$uname_db.'</a>
</td>
<td>
<a class="navlink" href="logout.php">Logout</a>
</td>';
}else{
echo '<td>
<a class="navlink" href="login.php">Login</a>
</td>
<td>
<a class="navlink" href="registration.php">Register</a>
</td>';
}
?>
</tr>
</table>
</div>
</div>
</div>
<!-- newsfeed -->
<div class="nbody" style="margin: 0px 100px; overflow: hidden; padding-top: 50px;">
<div class="nfeedleft">
<?php
echo '
<div class="nfbody">
<div class="p_body">
<p>'.$error.'</p>
</div>
</div>';
?>
</div>
<div class="nfeedright">
</div>
</div>
</div>
<!-- main jquery script -->
<script src="js/jquery-3.2.1.min.js"></script>
<!-- homemenu tab script -->
<script src="js/homemenu.js"></script>
<!-- topnavfixed script -->
<script src="js/topnavfixed.js"></script>
<!-- topnavfixed script -->
<script src="js/nfeedleftsearchfixed.js"></script>
</body>
</html>