-
Notifications
You must be signed in to change notification settings - Fork 0
/
add_new_project.php
58 lines (38 loc) · 1.7 KB
/
add_new_project.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
<?php
include('header.php');
check_session();
print ' <div id="content">';
//start framework
include('sub-header.php');
$button_menu[] = array('link'=>'my_task.php','text'=>'My Task','icon'=>'plus');
$button_menu[] = array('link'=>'hgc_design_grant_chart/','text'=>'Design Grant Chart for project');
$button_menu[] = array('link'=>'add_new_project.php','text'=>'Add New Project','icon'=>'plus');
$button_menu[] = array('link'=>'index.php','text'=>'Go to Dashboard');
button_menu_create($button_menu);
print page_header('Add New Project');
if(isset($_POST['submit'])){
$query ="INSERT INTO `project` (`id`, `id_person_create`, `date_start`, `date_end`, `title`, `description`, `status`)
VALUES (NULL, ".$_SESSION['id'].", '".$_POST['pr_start']."', '".$_POST['pr_end']."', '".$_POST['pr_name']."', '".$_POST['pr_desc']."', '".$_POST['pr_status']."');";
if(mysql_query($query)){
print ' <div class="alert alert-success"> New Project has been added Successfully . </div>';
}else{
print ' <div class="alert alert-error"> Error occured.</div>';
}
}
form_start();
input_text('Project Name','pr_name');
input_area('Description','pr_desc');
input_date('Project Start','pr_start');
input_date('Project End','pr_end');
input_dropdown('Project Status','pr_status',array(1=>'On',0=>'Off'));
print '<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" name="submit" id="submit" class="btn btn-primary">'.icon('pencil').' Save</button>
<a href="index.php" class="btn btn-default"><i class="glyphicon glyphicon-remove-circle"></i> Cancel</a>
</div>
</div>';
form_end();
//end farmework
print ' </div>';
include('footer.php');
?>