-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAdminProjectUpload.php
More file actions
61 lines (50 loc) · 1.72 KB
/
AdminProjectUpload.php
File metadata and controls
61 lines (50 loc) · 1.72 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
<?php
include "db.php";
session_start();
error_reporting(0);
if (isset($_POST["Upload"])) {
$pid=$_POST["pid"];
$pname=$_POST["pname"];
$uid=$_POST["uid"];
$mid= $_POST["mid"];
$marks=$_POST["marks"];
$des=$_POST["des"];
try {
$sql = "INSERT INTO user_projects(Project_Id,Project_Name,User_Id,Marks,Manager_Id, Description) VALUES($pid, '$pname', '$uid', $mid, $marks, '$des')";
if ($res=$db->query($sql)) {
echo "Project Uploaded";
echo "<script>window.open('AdminProjects.php','_self')</script>";
}
else{
throw new Exception;
}
}
catch (Exception $e) {////////////////////
echo "Cannot Update Table".$e->getMessage();
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="style.css">
<title>Upload Project</title>
</head>
<body>
<main class="main">
<section class="card">
<form method="post" action="<?php echo $_SERVER["PHP_SELF"]; ?>" class="form" >
<h3>Update Project</h3>
<input type="text" placeholder="Project Id" name="pid"/>
<input type="text" placeholder="Project Name" name="pname"/>
<input type="text" placeholder="User Id" name="uid"/>
<input type="text" placeholder="Marks" name="marks"/>
<input type="text" placeholder="Manager Id" name="mid"/>
<input type="text" placeholder="Description" name="des"/>
<button type="submit" name="Upload" class="button" >Upload</button>
</form>
</main>
</body>
</html>