-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateProject.php
More file actions
152 lines (128 loc) · 5.58 KB
/
createProject.php
File metadata and controls
152 lines (128 loc) · 5.58 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
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
<?php
include './Template.php';
include './DBConfig.php';
$mysql = new DBConfig();
$db = $mysql->getDBConfig();
session_start();
$nameErr = $descErr = $sdateErr = $edateErr = $empErr = $pName = $pDesc = $pSDate = $pEDate = $pSts = $pPrio = "";
//Getting Error Messages
if (!empty($_SESSION['pNameErr'])) {
$nameErr = $_SESSION['pNameErr'];
$_SESSION['pNameErr'] = "";
}
if (!empty($_SESSION['pDescErr'])) {
$descErr = $_SESSION['pDescErr'];
$_SESSION['pDescErr'] = "";
}
if (!empty($_SESSION['pSDateErr'])) {
$sdateErr = $_SESSION['pSDateErr'];
$_SESSION['pSDateErr'] = "";
}
if (!empty($_SESSION['pEDateErr'])) {
$edateErr = $_SESSION['pEDateErr'];
$_SESSION['pEDateErr'] = "";
}
if (!empty($_SESSION['costErr'])) {
$costErr = $_SESSION['costErr'];
$_SESSION['costErr'] = "";
}
//Getting Old Values
if (!empty($_SESSION['pName'])) {
$pName = $_SESSION['pName'];
$_SESSION['pName'] = "";
}
if (!empty($_SESSION['pDesc'])) {
$pDesc = $_SESSION['pDesc'];
$_SESSION['pDesc'] = "";
}
if (!empty($_SESSION['pSDate'])) {
$pSDate = $_SESSION['pSDate'];
$_SESSION['pSDate'] = "";
}
if (!empty($_SESSION['pEDate'])) {
$pEDate = $_SESSION['pEDate'];
$_SESSION['pEDate'] = "";
}
if (!empty($_SESSION['pSts'])) {
$pSts = $_SESSION['pSts'];
$_SESSION['pSts'] = "";
}
if (!empty($_SESSION['pPrio'])) {
$pPrio = $_SESSION['pPrio'];
$_SESSION['pPrio'] = "";
}
if (!empty($_SESSION['pCost'])) {
$pCost = $_SESSION['pCost'];
$_SESSION['pCost'] = "";
}
//Save Emp old value NEED
$head = '<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script src="js/updateTask3.js" type="text/javascript"></script>
';
$header = new Template("./header.php", array('head' => $head, 'title' => "Create a project",'return'=>"createProject.php",'current_page'=>2));
$header->out();
?>
<!-- content-wrap -->
<div id="content-wrap">
<!-- content -->
<div id="content" class="clearfix">
<!-- main -->
<div id="main">
<div class="main-content">
<form method='post' action='createProjectProcessing.php' id='mainForm'>
<!-- Name -->
<label >Project Name</label>
<input type='text' class='form-control' name='projname'
value='<?php echo $pName; ?>' placeholder='Enter project name' maxlength = "100" required/>
<span class="error"><?php echo $nameErr ?></span>
<!-- Description -->
<label >Project Description</label>
<textarea rows='10' cols='50' name='descr' maxlength = "20000" required><?php echo $pDesc; ?></textarea>
<span class="error"><?php echo $descErr; ?></span>
<!-- Set dates -->
<label for="exampleInputEmail1">Start Date</label>
<input class="form-control" name="startdate" id="from" value='<?php if ($pSDate) echo $pSDate; ?>'
placeholder="MM/DD/YYYY" readonly="true">
<span class="error"><?php echo $sdateErr; ?></span>
<label for="exampleInputEmail1">End Date</label>
<input class="form-control" name="enddate" id="to" value='<?php echo $pEDate; ?>'
placeholder="MM/DD/YYYY" readonly="true">
<span class="error"><?php echo $edateErr; ?></span>
<!-- Status -->
<label >Status</label>
<select class='form-control' name='status' id='sts' style='width: 165px'>
<option <?php echo ($pSts === "Default") ? "selected" : ""; ?> value='Default'>Default</option>
<option <?php echo ($pSts === "Closed") ? "selected" : ""; ?> value='Closed'>Closed</option>
</select>
<!-- priority -->
<label >Priority</label>
<select class='form-control' name='priority' style='width: 165px'>
<option <?php echo ($pPrio === 'High') ? 'selected' : ''; ?> value='High'>High</option>
<option value='Mid' <?php echo ($pPrio === "Mid") ? "selected" : ""; ?>>Mid</option>
<option <?php echo ($pPrio === "Low") ? "selected" : ""; ?> value='Low'>Low</option>
</select>
<!-- Cost -->
<label >Project Budget</label>
<input type='text' class='form-control' name='cost'
value='<?php echo $pCost; ?>' placeholder='Enter project budget' maxlength = "15" required/>
<span class="error"><?php echo isset($costErr) ? $costErr : ""; ?></span>
<!-- Buttons -->
</br>
<input type='reset' name= 'cancel' value='Cancel' class='btn btn-info1'>
<input type='submit' name= 'submit' value='Create Project' onclick='getTime()' class='btn btn-info2'>
</div>
</form>
</div>
<!-- /main -->
</div>
<!-- sidebar -->
<? include './sidebar.php'; ?>
<!-- content -->
</div>
<!-- /content-out -->
</div>
<!-- extra -->
<?php
include './footer.php';
?>