forked from zygtech/goldwater
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathclient.php
executable file
·85 lines (81 loc) · 3.66 KB
/
client.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
<?php
/*
* client.php
*
* Copyright 2018 Krzysztof Hrybacz <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
*
*/
?>
<?php
require_once('config.php');
session_start();
if ($_SESSION['login']!='') {
$link = mysqli_connect($sql, $sqluser, $sqlpass, $sqldb);
mysqli_set_charset($link,'utf8');
if ($_GET['id']!='') {
$result = mysqli_query($link,'SELECT * FROM `clients` WHERE id=' . $_GET['id'] . ';');
$client = mysqli_fetch_array($result);
}
?>
<html>
<head>
<title>Client Edit</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Titillium+Web%3A400%2C300%2C900%7CPT+Sans%3A700&subset=latin" rel="stylesheet">
<script src="limit.js"></script>
</head>
<body>
<div class="container">
<img class="right" src="logo.png" />
<h1> Welcome: <?php echo $_SESSION['login']; ?> <span class="logout">(<a href="index.php?logout=true">log out</a>)</span></h1>
</div>
<div class="ribbon"><div class="container">
<h2> CLIENT EDIT </h2>
</div></div>
<div class="main"><div class="container">
<form action="clientedit.php" method="POST">
<table>
<input type="hidden" name="id" value="<?php echo $client['id']; ?>" />
<tr><td>Company</td><td><input type="text" name="company" value="<?php echo $client['company']; ?>" maxlength="50" /></td></tr>
<tr><td>Full name</td><td><input type="text" name="fullname" value="<?php echo $client['fullname']; ?>" maxlength="20" /></td></tr>
<tr><td>Address</td><td><textarea name="address" onkeyup="limitTextarea(this,5,100)"><?php echo $client['address']; ?></textarea></td></tr>
<tr><td>Mobile</td><td><input type="text" name="mobile" value="<?php echo $client['mobile']; ?>" maxlength="20" /></td></tr>
<tr><td>E-mail</td><td><input type="text" name="mail" value="<?php echo $client['mail']; ?>" maxlength="50" /></td></tr>
<tr><td>WWW</td><td><input type="text" name="www" value="<?php echo $client['www']; ?>" maxlength="50" /></td></tr>
<tr><td>Folder</td><td><input type="text" name="folder" value="<?php echo $client['folder']; ?>" maxlength="50" /></td></tr>
<tr><td>Category</td><td><select name="category">
<option <?php if ($client['category']=='ACTIVE') echo 'selected'; ?>>ACTIVE</option>
<option <?php if ($client['category']=='RING') echo 'selected'; ?>>RING</option>
<option <?php if ($client['category']=='FREEZE') echo 'selected'; ?>>FREEZE</option>
<option disabled <?php if ($client['category']=='NEW') echo 'selected'; ?>>NEW</option>
</select></td></tr>
<tr><td>Additional Info</td><td><textarea name="info" onkeyup="limitTextarea(this,5,100)"><?php echo $client['info']; ?></textarea></td></tr>
<tr><td></td><td><input type="submit" value="Save" /></td></tr>
</table>
</form>
</div></div>
<div class="ribbon"><div class="container">
<?php require_once('menu.php'); ?>
</div></div>
</body>
</html>
<?php
}
?>