-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedit-form.php
58 lines (54 loc) · 1.79 KB
/
edit-form.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
<div class="row">
<div class="col-md-4">
<form method="post" action="" id="login_form1">
<div class="form-group">
<label class="control-label">Project Name</label>
<input type="text" name="project_name" value="<?php echo $project_name; ?>" class="form-control input-sm" required>
</div>
<div class="form-group">
<label class="control-label">Project Case Study</label>
<input type="text" name="project_case" value="<?php echo $project_case ?>" class="form-control input-sm" required>
</div>
<div class="form-group">
<label class="control-label">Project Level</label>
<select name="project_level" class="form-control input-sm " required>
<option value="<?php echo $project_level; ?>" selected><?php echo $project_level; ?></option>
<option value="ND">ND</option>
<option value="HND">HND</option>
</select>
</div>
<input type="hidden" name="project_id" value="<?php echo $_GET['id']; ?>">
<button type="submit" class="btn btn-sm btn-default">Submit</button>
</form>
</div>
<div class="col-md-8">
<?php include 'all_project.php'; ?>
</div>
</div>
<script>
$(document).ready(function(){
$("#login_form1").submit(function(e){
e.preventDefault();
var formData = $(this).serialize();
$.ajax({
type: "POST",
url: "updateproject.php",
data: formData,
success: function(html){
alert(html);
if(html=='true')
{
$.jGrowl("Please Wait......", { sticky: true });
$.jGrowl("Successfully added", { header: 'Success !!' });
var delay = 5000;
setTimeout(function(){ window.location = 'create-project.php' }, delay);
}else
{
$.jGrowl("Error updating project", { header: 'Project update failed' });
}
}
});
return false;
});
});
</script>