-
Notifications
You must be signed in to change notification settings - Fork 5
/
edit_event.php
82 lines (75 loc) · 2.73 KB
/
edit_event.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
75
76
77
78
79
80
81
82
<?php
require_once('funs.php');
session_start();
check_session();
$session_name = $_SESSION['username'];
$row = array();
$row = get_member_data($session_name);
$id = $row['id'];
$name = $row['name'];
$role = $row['role'];
$pic = $row['pic'];
$last_login = $row['last_login'];
$event_id = $_GET['event_id'];
$last_login = date('jS M Y H:i', strtotime($last_login));
$total_members = get_all_status();
$core_members = get_vip_status();
$total_sessions = total_sessions();
$completed_sessions = completed_sessions();
starter($id,$name,$role,$pic,$last_login,$total_members,$core_members,$total_sessions,$completed_sessions);
if($role != 'President')
{
echo '<div class="text-center alert bg-warning col-md-offset-4 col-md-4"><p><b>Access Forbidden</b></p></div>';
echo '<script>setTimeout(function () { window.location.href = "home.php";}, 1000);</script>';
exit();
}
?>
<div class="row">
<ol class="breadcrumb">
<li><a href="home.php"><i class="fa fa-home" aria-hidden="true"></i></a></li>
<li><a href="schedule.php">Schedule & sessions</a></li>
<li class="active">Edit Session</li>
</ol>
</div><!--/.row-->
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Edit Session</h1>
</div>
</div><!--/.row-->
<?php
$query = "SELECT * FROM sessions where session_id='$event_id'";
$result = mysqli_query($con,$query);
$rows = mysqli_affected_rows($con);
if($rows == 1)
{
while($member_data = mysqli_fetch_assoc($result))
{
$session_name = $member_data['session_name'];
$session_details = $member_data['session_details'];
$session_date = $member_data['session_date'];
}
}
else
{
echo 'error while retriving information';
}
?>
<div class="row">
<div class="error">
<?php edit_event($event_id,$role); ?>
</div>
<div class="col-lg-offset-2 col-lg-6">
<form class="form-signin" method="post" action="">
<label for="name">Event Title</label>
<input type="text" value="<?php echo $session_name; ?>" name="name" placeholder="max 150 char" id="name" class="form-control" require><br>
<label for="name">Event Description</label>
<textarea type="text" name="description" placeholder="Description max 250 char" id="email" class="form-control" require><?php echo $session_details; ?></textarea><br>
<label for="name">Event Date</label>
<input type="text" value="<?php echo $session_date; ?>" data-field="datetime" placeholder="date" name="date" class="form-control" require>
<div id="dtBox"></div><br>
<button class="btn btn-primary" name="edit_event" type="submit">Edit</button>
<a type="button" class="btn btn-default" href="mange_events.php" class="btn btn-default">Cancel</a>
</form>
</div><!--/.row-->
<?php
at_bottom();