-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmanager.php
executable file
·114 lines (106 loc) · 4.24 KB
/
manager.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
<?php
include_once 'header.php';
include_once 'headerfiles.php';
?>
<body class="skin-blue sidebar-collapse">
<div class="wrapper">
<?php
include_once 'navigation.php';
include_once 'sidebar.php';
if(isset($_POST['managerid']))
{
$managerid=sanitizeString($_POST['managerid']);
$name=sanitizeString($_POST['name']);
$contact=sanitizeString($_POST['contact']);
$query="Update managers set name='$name',contact='$contact' where managerid=$managerid";
echo $query;
queryMysql($query);
echo<<<_END
<script type="text/javascript">
window.location.replace("managers.php");
</script>
_END;
}
if(isset($_GET['managerid']))
{
$managerid=sanitizeString($_GET['managerid']);
$query="Select * from managers where managerid=$managerid";
$result=queryMysql($query);
$row=mysqli_fetch_array($result);
?>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
Edit Manager
<small>Enter Manager details</small>
</h1>
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
<li>Items</li>
<li class="active">Add</li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<!-- Your Page Content Here -->
<div class="row">
<div class="col-md-12">
<div class="box box-primary">
<form class="myform" action="manager.php" method="post">
<div class="box-body">
<div class="row">
<div class="col-md-3">
<div class="form-group has-success">
<label>Manager Name</label>
<?php
echo<<<_END
<input type="text" name="name" value="$row[name]" class="form-control focus mandatory" placeholder="Manager Name"/>
<input type="hidden" name="managerid" value="$row[managerid]"/>
_END;
?>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Manager Contact</label>
<?php
echo<<<_END
<input type="text" value="$row[contact]" name="contact" class="form-control" placeholder="Manager Contact"/>
_END;
?>
</div>
</div>
</div>
<div class="row">
<div class="box-body">
<div class="col-md-2">
<button class="focusable btn btn-block btn-primary submit">Add Manager</button>
</div>
<div class="col-md-2">
<button class="focusable btn btn-block btn-warning cancel">Cancel</button>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</section><!-- /.content -->
</div><!-- /.content-wrapper -->
<?php
}
?>
<!-- Main Footer -->
<footer class="main-footer">
<!-- To the right -->
<div class="pull-right hidden-xs">
TMStock - The Makers Stock
</div>
<!-- Default to the left -->
<strong>Copyright © 2015 <a href="http://themakersweb.com">The Makers Web</a>.</strong> All rights reserved.
</footer>
</div><!-- ./wrapper -->
</body>
</html>