-
Notifications
You must be signed in to change notification settings - Fork 0
/
approve.php
129 lines (117 loc) · 4.03 KB
/
approve.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
<?php
include('database_connect.php');
if(isset($_GET['approveid']))
{
$getall="Select * from register where id='".$_GET['approveid']."'";
$result = mysqli_query($con,$getall);
while($row=mysqli_fetch_assoc($result)){
$pass= $row['universityID'];
}
$approve="active";
echo "string";
$sqluq="update register set status='".$approve."', password='".$pass."' WHERE id='".$_GET['approveid']."'";
mysqli_query($con,$sqluq);
echo "<script>window.close();</script>";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/ideacss.css" />
<link rel="stylesheet" href="css/bootstrap.min.css"></link>
<!--Closes the new window-->
<script>
function closeWin() {
window.opener.location.href = window.opener.location.href;
if (window.opener.progressWindow) {
window.opener.progressWindow.close()
}
window.close();
}
</script>
<title>IDEAPOOL Admin Page</title>
</head>
<body>
<!-- load the selected submission details to textboxes-->
<?php
include("database_connect.php");
if(mysqli_connect_errno()){
echo "failed to connect to MySQL.".mysqli_connect_error();
}
if ( isset($_GET['sendId'])){
$sendID = $_GET['sendId'];
echo "<script> window.postid = ".$sendID." </script>";
$result=mysqli_query($con,"Select * from register where id='".$sendID."' ");
if (!$result) {
printf("Error: %s\n", mysqli_error($con));
exit();
}
while($row=mysqli_fetch_array($result)){?>
<div class="panel-body">
<form name="form1" method="POST" action="block.php">
<div class="form-group">
<label for="addr">Full Name</label>
<input type="text" class="form-control" name="post" value="<?php echo $row['fname']." ".$row['lname'] ?>">
</div>
<div class="form-group">
<label for="fnam">Address</label>
<textarea class="form-control" name="faculty"><?php echo $row['address'] ?></textarea>
</div>
<div class="form-group">
<label for="lnam">Contact</label>
<input type="text" class="form-control" name="department" value="<?php echo $row['contact'] ?>">
</div>
<div class="form-group">
<label for="lnam">Gender</label>
<input type="text" class="form-control" name="department" value="<?php echo $row['gender'] ?>">
</div>
<div class="form-group">
<label for="lnam">Email</label>
<input type="text" class="form-control" name="department" value="<?php echo $row['emil'] ?>">
</div>
<div class="form-group">
<label for="lnam">Category</label>
<input type="text" class="form-control" name="department" value="<?php echo $row['category'] ?>">
</div>
<div class="form-group">
<label for="lnam">University Id</label>
<input type="text" class="form-control" name="department" value="<?php echo $row['universityID'] ?>">
</div>
<div class="form-group">
<label for="lnam">Status</label>
<input type="text" class="form-control" name="department" value="<?php echo $row['status'] ?>">
</div>
<div class="form-group">
<!--<button type="submit" class="btn btn-danger" name="confirm">Update</button>-->
<button type="button" class="btn btn-primary" onclick="closeWin()">Cancel </button>
<button type="button" name="button" class="btn btn-success" onclick="javascript:ApproveUser(<?php echo $row['id']; ?>)">Approve</button>
<button type="button" name="button" class="btn btn-danger" onclick="javascript:delete_id(<?php echo $row['id']; ?>)">Delete</button>
</div>
<input type="hidden" name="postid" value="<?php echo $row['id']; ?>">
</form>
<?php }
} ?>
</div>
<script type="text/javascript">
function ApproveUser(id)
{
if(confirm('Are you sure you want to send credentials to this user?'))
{
window.location.href='approve.php?approveid='+id;
}
}
</script>
<script type="text/javascript">
function delete_id(id)
{
if(confirm('Are you sure To Remove This Record ?'))
{
window.location.href='newuser_delete.php?delete_id='+id;
}
}
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
</body>
</html>