-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit_group.php
More file actions
95 lines (91 loc) · 2.99 KB
/
Copy pathedit_group.php
File metadata and controls
95 lines (91 loc) · 2.99 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
<?php
require('dbconfig.php');
if(!$dbfun->is_logged_in()){ header('Location: login.php'); }
if(isset($_POST['btn-update'])){
$id = $_GET['edit_id'];
$name = $_POST['name'];
if($dbfun->updateGroup($id,$name))
{
$msg = "<div class='alert alert-info'>
Grupa została uaktualniona <strong><a href='groups.php'>Wróć</a></strong>
</div>";
}
else
{
$msg = "<div class='alert alert-warning'>
<strong>SORRY!</strong> ERROR
</div>";
}
}
if(isset($_GET['edit_id'])){
$id = $_GET['edit_id'];
extract($dbfun->getGroupDetailsbyID($id));
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="pl">
<head>
<meta charset="utf-8">
<title>Drawing Tasks System</title>
<meta name="Marek Kozłowski">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.validate.min.js"></script>
<script>
$(document).ready(function(){
$('#edit_group-form').validate({
rules: {
name: {required: true}
},
messages: {
name: {required: 'Musisz podać nazwę grupy'}
},
errorElement: 'div',
errorLabelContainer: '.errorTxt'
});
});
</script>
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
<style type="text/css">
body { background: url(assets/bglight.png);}
.hero-unit { background-color: #fff; }
.center { display: block; margin: 0 auto; }
.navbar-fixed-bottom {background-color: #f5f5f5; }
</style>
</head>
<body>
<?php
if($dbfun->isadmin($_SESSION['key']) == 1){
include_once("ui/logged_navtop_admin.htm");
}else {
include_once("ui/logged_navtop.htm");
}
?>
<div class="container hero-unit">
<?php
if(isset($msg))
{
echo $msg;
}
?>
<form id="edit_group-form" role="form" method='post'>
<table class='table table-bordered'>
<tr>
<td>Imię</td>
<td><input type='text' name='name' class='form-control' value="<?php echo $name; ?>"></td>
</tr>
<tr>
<td colspan="2">
<button type="submit" class="btn btn-primary" name="btn-update">
<span class="glyphicon glyphicon-edit"></span> Aktualizuj
</button>
<a href="groups.php" class="btn btn-success"><i class="glyphicon glyphicon-backward"></i>Innym razem</a>
</td>
</tr>
</table>
<div class="errorTxt"></div>
</form>
</div>
<?php include("ui/footer.htm"); ?>
</body>
</html>