-
Notifications
You must be signed in to change notification settings - Fork 0
/
proj_edit.php
executable file
·74 lines (62 loc) · 2.48 KB
/
proj_edit.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
<?php
require_once "include/Class_DB.php";
require_once('include/login/auth.php');
require_once('include/debug.php');
$owner = $_SESSION['SESS_MEMBER_ID'];
$id = (int)$_REQUEST['proj_id'];
$GetDataProjectName = $db->query("SELECT * FROM projects WHERE project_id = ".$id." AND project_owner = ".$owner."");
$executesql = $db->fetch_assoc($GetDataProjectName);
if(isset($_POST['delete'])) {
$sqlDeleteProject = "DELETE FROM projects WHERE project_id = ".$id." ";
$sql_exec_component_delete = $db->query($sqlDeleteProject);
$sqlDeleteProject = "DELETE FROM projects_data WHERE projects_data_project_id = ".$id." ";
$sql_exec_project_delete = $db->query($sqlDeleteProject);
header("Location: .");
}
?>
<!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" xml:lang="sv" lang="sv">
<head>
<link rel="stylesheet" type="text/css" href="include/style.css" media="screen"/>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<link rel="shortcut icon" href="favicon.ico" />
<link rel="apple-touch-icon" href="img/apple.png" />
<title>Your Projects - ecDB</title>
<?php include_once("include/analytics.php") ?>
</head>
<body>
<div id="wrapper">
<!-- Header -->
<?php include 'include/header.php'; ?>
<!-- END -->
<!-- Main menu -->
<?php include 'include/menu.php'; ?>
<!-- END -->
<!-- Main content -->
<div id="content">
<h1>Edit Project</h1>
<?php
include('include/include_proj_update.php');
$AddProj = new ProjAdd;
$AddProj->AddProj();
?>
<form class="globalForms" method="post" action="">
<div class="textInput">
<label class="keyWord">Project name</label>
<div class="input"><input name="name" type="text" class="medium" value="<?php echo $executesql['project_name']; ?>" /></div>
</div>
<div class="buttons">
<div class="input">
<button class="button green" name="submit" type="submit"><span class="icon medium save"></span> Save</button>
<button class="button red" name="delete" type="submit"><span class="icon medium trash"></span> Delete</button>
</div>
</div>
</form>
</div>
<!-- END -->
<!-- Text outside the main content -->
<?php include 'include/footer.php'; ?>
<!-- END -->
</div>
</body>
</html>