-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_projekti.php
211 lines (174 loc) · 7.6 KB
/
admin_projekti.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<?php
require ('inc/config.php');
session_start();
require (MYSQL);
if (!isset($_SESSION['id_skrbniki'])) {
$url = BASE_URL . 'login.php';
ob_end_clean();
header("Location: $url");
exit();
}
mysqli_set_charset($link, "utf8");
$query_temp1 = "CREATE OR REPLACE VIEW vsi_sodelujoci AS
SELECT tk_idprojekt ,COUNT(*) as stevilo_sodelujocih
FROM projektopia.projekt_sodelujoci
GROUP BY tk_idprojekt;";
$query_temp2 = "CREATE OR REPLACE VIEW vsi_stroski AS
SELECT SUM(dejanski_strosek) as stroski, tk_idprojekt as tk_idprojekt2
FROM projektopia.strosek
GROUP BY tk_idprojekt2;";
$link ->query($query_temp1);
$link ->query($query_temp2);
$FLAG_NOBEN_PROJEKT = FALSE;
if (isset($_POST['_METHOD'])) {
if ($_POST['_METHOD'] == 'POST_PRO_SPEC') {
$query_get_projekte = "SELECT idprojekt, naziv, grafika, narocnik, datum_konca, stevilo_sodelujocih, stroski
FROM projektopia.projekt, vsi_sodelujoci, vsi_stroski
WHERE idprojekt = tk_idprojekt
AND idprojekt = tk_idprojekt2
AND naziv LIKE '%" . $_POST['iskanje'] . "%'
ORDER BY datum_konca DESC;";
}
}else{
$query_get_projekte = "SELECT idprojekt, naziv, grafika, narocnik, datum_konca, stevilo_sodelujocih, stroski
FROM projektopia.projekt, vsi_sodelujoci, vsi_stroski
WHERE idprojekt = tk_idprojekt
AND idprojekt = tk_idprojekt2
ORDER BY datum_konca DESC;";
}
$RS_get_projekte = $link ->query($query_get_projekte);
if(mysqli_num_rows($RS_get_projekte) == 0){
$FLAG_NOBEN_PROJEKT = TRUE;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="shortcut icon" href="img/ikona3.ico" />
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>PROJEKTopia - Skrbniški pogled</title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap_admin.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/sb-admin.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:https:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div id="wrapper">
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="admin_home.php">PROJEKTopia Admin Panel</a>
</div>
<!-- Top Menu Items -->
<ul class="nav navbar-right top-nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-user"></i> <?php echo $_SESSION['ime']." ".$_SESSION['priimek']; ?> <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<a href="logout.php"><i class="fa fa-fw fa-power-off"></i> Log Out</a>
</li>
<li>
<a href="index.php"><i class="fa fa-fw fa-home"></i>Izhod iz plošče</a>
</li>
</ul>
</li>
</ul>
<!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav side-nav">
<li>
<a href="admin_home.php"><i class="fa fa-fw fa-dashboard"></i> Vstopna stran</a>
</li>
<li>
<a href="admin_add_participant.php"><i class="fa fa-fw fa-adn"></i> Dodaj Sodelujoče</a>
</li>
<li>
<a href="admin_add_projekt.php"><i class="fa fa-fw fa-archive"></i> Dodaj Projekt</a>
</li>
<li class="active">
<a href="admin_projekti.php"><i class="fa fa-fw fa-bullseye"></i> Ogled vseh Projektov</a>
</li>
<li>
<a href="admin_sodelujoci.php"><i class="fa fa-fw fa-pencil"></i> Ogled vseh Sodelujocih</a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</nav>
<div id="page-wrapper">
<div class="container-fluid">
<!-- Page Heading -->
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">
Brskanje med projekti
<small>za podrobno iskanje vnesite ključno besedo (poizvedovanje po NAZIVu)</small>
</h1>
<form action="admin_projekti.php" method="post" role="form">
<div class="col-lg-6">
<label for="iskanje">Iskanje po projektih</label>
<input type="text" class="form-control" name="iskanje" placeholder="Vnesite kljucno besedo">
</div>
<div class="col-lg-2">
<div style="height: 24px;">
<label for="Poizveduj"></label>
</div>
<input type="hidden" name="_METHOD" value="POST_PRO_SPEC"/>
<input class="btn btn-primary form-control" type="submit" value="Poizveduj "/>
</div>
</form>
</div>
<hr style="width: 100%; color: black; height: 1px;" />
<div class="col-lg-12">
<?php
if($FLAG_NOBEN_PROJEKT){
echo "Najden ni bil noben taki projekt ki bi usrezal ključni besedi :(";
}else{
while($row = $RS_get_projekte ->fetch_array()){
echo "<div class='col-lg-10'>";
echo "<div class=\"panel panel-default\">";
echo "<div class=\"panel-body\">";
echo strtoupper($row['naziv']) . " → narocnik: " . $row['narocnik'] . " → število sodelujocih: " . $row['stevilo_sodelujocih'] . " → skupni stroški: " . $row['stroski'];
echo "</div>";
echo "</div>";
echo "</div>";
echo "<div class='col-lg-1'>";
echo "</i><a href='projekti.php?p=" . $row['idprojekt'] . "' class='btn btn-warning btn-lg'> Polni Pogled</a>";
echo "</div>";
}
}
?>
</div>
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
</div>
<!-- /#page-wrapper -->
</div>
<!-- /#wrapper -->
<!-- jQuery -->
<script src="js/jquery.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>