forked from Abilash1503/Garbage-Management-System
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequest_application.php
More file actions
82 lines (58 loc) · 2.29 KB
/
Copy pathrequest_application.php
File metadata and controls
82 lines (58 loc) · 2.29 KB
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
<?php
session_start();
if(!isset($_SESSION['loggedin']) || $_SESSION['loggedin']!=true){
header("location: login.php");
exit;
}
include "dbconnect.php";
$login_username=$_SESSION['login_username'];
$select_display= "select * from users where login_username='$login_username'" ;
$select_sql1 = mysqli_query($conn,$select_display);
while($row1 = mysqli_fetch_array($select_sql1)){
$login_username=$row1[2];
}
$service_id=$_GET['service_id'];
$select_service_display= "select * from services where service_id='$service_id'" ;
$sql1 = mysqli_query($conn,$select_service_display);
while($row=mysqli_fetch_assoc($sql1)){
$admin_username=$row['admin_username'];
$service_name=$row['service_name'];
}
date_default_timezone_set('Asia/Kolkata');
$timestamp = date("Y-m-d H:i:s");
$service_request_query = "INSERT INTO `application_request` ( `service_name`,`admin_username`,`login_username`,`permission`) VALUES ('$service_name','$admin_username','$login_username','2') limit 1,1";
$result = mysqli_query($conn, $service_request_query);
if($result)
{
$showAlert=true;
header('location:Requested_applications_user.php');
}
else
{
//$showError=true;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- This file has been downloaded from bootdey.com @bootdey on twitter -->
<!-- All snippets are MIT license http://bootdey.com/license -->
<title>profile </title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<link rel="stylesheet" href="css/bootstrap.css">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.0/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>
<?php
if($showAlert){
echo ' <div class="alert alert-danger alert-dismissible fade show" role="alert">
<strong>Service sent for approval</strong> '. $showAlert.'
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div> ';
}
?>
</html>