forked from chiragmaniar/php_website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactcount.php
More file actions
106 lines (86 loc) · 2.82 KB
/
actcount.php
File metadata and controls
106 lines (86 loc) · 2.82 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
<?php
ob_start();
session_start();
if(!isset($_SESSION['loggedInUser'])){
//send the iser to login page
header("location:index.php");
}
include_once('head.php');
include_once('header.php');
if($_SESSION['username'] == 'hodextc@somaiya.edu')
{
include_once('sidebar_hod.php');
}
else
include_once('sidebar.php');
/*$_SESSION["Username"] = 'test';
$user = $_SESSION["Username"];
echo $user;*/
?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Main content -->
<section class="content">
<div class="row">
<!-- left column -->
<div class="col-md-6">
<!-- general form elements -->
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Form for applying activities</h3>
</div><!-- /.box-header -->
<!-- form start -->
<?php echo $_SESSION['username'];?>
<form role="form" action="" method="POST">
<div class="box-body">
<div class="form-group">
<label for="activity">Number of papers to be entered</label>
<input type="number" id="count" value="1" name="count"/>
</div>
</div><!-- /.box-body -->
<div class="box-footer">
<button type="submit" name="submit_count" id="submit" value="" class="btn btn-primary">Log Activity!</button>
<button type="submit" name="cancel" id="cancel" value="" class="btn btn-primary">Cancel</button>
</div>
<?php
$username = $_SESSION['username'];
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if(isset($_POST['submit_count']))
{
$count = $_REQUEST["count"];
}
else{
$count = 0;
}
$_SESSION['count'] = $count;
if($count <=0 )
{
$result="Don't enter zero or negative value<br>";
echo '<div class="error">'.$result.'</div>';
}
else{
if($_SESSION['username'] == 'hodextc@somaiya.edu' || $_SESSION['username'] == 'member@somaiya.edu')
{
header("location:1_add_paper_multiple_hod.php?alert=success");
}
else
header("location:1_add_paper_multiple.php?alert=success");
}
}
if(isset($_POST['cancel']))
{
if($username == 'hodextc@somaiya.edu')
{
header("location:2_dashboard_hod.php");
}
else
header("location:2_dashboard.php");
}
?>
</form>
</div>
</div>
</div>
</section>
</div><!-- /.content-wrapper -->
<?php include_once('footer.php'); ?>