-
Notifications
You must be signed in to change notification settings - Fork 0
/
events.php
92 lines (91 loc) · 4.22 KB
/
events.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
83
84
85
86
87
88
89
90
91
92
<?php include 'header.php'; ?>
<div class="page account">
<div class="container-fluid">
<div class="row">
<div class="col-sm-3 col-md-2 sidebar">
<ul class="nav nav-sidebar">
<li class="active"><a href="account.php">Головна</a></li>
<li><a href="contacts.php">Контакти</a></li>
<li><a href="companies.php">Організації</a></li>
<li><a href="events.php">Події</a></li>
</ul>
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<div class="events__header fw">
<h2 class="sub-header">Події</h2>
<div class="events__add-btn-wrap fw">
<a href="event_add.php" class="btn btn-success">Додати подію</a>
</div>
</div>
<?php
include ("functions/get_all_events.php");
?>
<?php if(!mysql_num_rows($result)) : ?>
<h4>Тут будуть відображатись ваші події. Вперед, додайте їх!!!</h4>
<? else : ?>
<div class="events-filter fw">
<div class="filter-item fw">
<label for="filter__type">Тип події</label>
<select class="form-control" id="filter__type">
<option value="0">Всі типи подій</option>
<?php
include ("functions/bd.php");
$types = mysql_query("SELECT * FROM event_type", $db);
while ($row = mysql_fetch_assoc($types)) {
?>
<option value="<?php echo $row["id"] ?>"><?php echo $row["name"] ?></option>
<?php }
mysql_free_result($types);
?>
</select>
</div>
<div class="filter-item fw">
<label for="filter__type">Дата події</label>
<div class='input-group date' id='datetimepicker-filter'>
<input type='text' class="form-control" id="datetimepicker-filter-input"/>
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
<?php endif; ?>
<div class="list-group">
<?php
while ($row = mysql_fetch_assoc($result)) {
$item_date = new DateTime($row["date"]);
?>
<div class="list-group-item events__item" data-type="<?php echo $row["type"] ?>" data-date="<?php echo $item_date->format('Y-m-d'); ?>">
<div class="events__item-type"><?php echo $row["type_name"] ?></div>
<div class="row events__item-body fw">
<div class="col-md-6 events__item-descr">
<h4 class="list-group-item-heading"><?php echo $row["name"] ?></h4>
<p class="list-group-item-text"><?php echo $row["description"] ?></p>
</div>
<div class="col-md-3 event-time__wrap">
<div class="event__item-time event-time fw">
<div class="event-time__date">
<?php echo $item_date->format('Y-m-d'); ?>
</div>
<div class="event-time__time">
<?php echo $item_date->format('H:i'); ?>
</div>
</div>
</div>
<div class="col-md-3">
<div class="fw event-item__buttons">
<a href="event_edit.php?id=<?php echo $row['id']; ?>" class="btn events-item__edit-btn btn-primary">Редагувати</a>
<a href="#" data-id="<?php echo $row['id'] ?>" class="btn btn-danger event-item__delete">Видалити</a>
</div>
</div>
</div>
</div>
<?php }
mysql_free_result($result);
?>
</div>
</div>
</div>
</div>
</div>
<?php include 'footer.php'; ?>