-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient_edit.php
More file actions
160 lines (143 loc) · 5.2 KB
/
Copy pathclient_edit.php
File metadata and controls
160 lines (143 loc) · 5.2 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
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
<?php
// Authenticate
require("class.AuthenticationManager.php");
require("class.CommandMenu.php");
if (!$authenticationManager->isLoggedIn() || !$authenticationManager->hasAccess('aclClients')) {
Header('Location: login.php?clearanceRequired=' . get_acl_level('aclClients'));
exit;
}
// Connect to database.
$dbh = dbConnect();
$contextUser = strtolower($_SESSION['contextUser']);
//load local vars from superglobals
$client_id = $_REQUEST['client_id'];
//define the command menu
$commandMenu->add(new TextCommand("Back", true, "javascript:history.back()"));
//build the query
$query = "SELECT client_id, organisation, description, address1, address2,".
"city, country, postal_code, contact_first_name, contact_last_name,".
"username, contact_email, phone_number, fax_number, gsm_number, ".
"http_url ".
"FROM $CLIENT_TABLE ".
"WHERE $CLIENT_TABLE.client_id=$client_id";
//run the query
list($qh, $num) = dbQuery($query);
$data = dbResult($qh);
?>
<html>
<head>
<title>Modify client information</title>
<?php include ("header.inc");?>
</head>
<body <?php include ("body.inc"); ?> >
<?php include ("banner.inc"); ?>
<form action="client_action.php" method="post">
<input type="hidden" name="action" value="edit" />
<input type="hidden" name="client_id" value="<?php echo $client_id ?>" />
<table width="600" align="center" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" class="face_padding_cell">
<!-- include the timesheet face up until the heading start section -->
<?php include("timesheet_face_part_1.inc"); ?>
<table width="100%" border="0">
<tr>
<td align="left" nowrap class="outer_table_heading" nowrap>
Edit Client: <?php echo $data["organisation"]; ?>
</td>
</tr>
</table>
<!-- include the timesheet face up until the heading start section -->
<?php include("timesheet_face_part_2.inc"); ?>
<table width="100%" align="center" border="0" cellpadding="0" cellspacing="0" class="outer_table">
<tr>
<td>
<table width="100%" border="0" cellpadding="1" cellspacing="2" class="table_body">
<tr>
<td align="right">Organisation:</td>
<td><input size="60" name="organisation" value="<?php echo $data["organisation"]; ?>" style="width: 100%;" maxlength="64" /></td>
</tr>
<tr>
<td valign="top" align="right">Description:</td>
<td>
<textarea name="description" rows="4" cols="58" style="width: 100%;"><?php echo trim($data["description"]); ?></textarea>
</td>
</tr>
<tr>
<td align="right">Address1:</td>
<td><input size="60" name="address1" value="<?php echo $data["address1"]; ?>" style="width: 100%;" /></td>
</tr>
<tr>
<td align="right">Address2:</td>
<td><input size="60" name="address2" value="<?php echo $data["address2"]; ?>" style="width: 100%;" /></td>
</tr>
<tr>
<td align="right">City:</td>
<td><input size="60" name="city" value="<?php echo $data["city"]; ?>" style="width: 100%;" /></td>
</tr>
<tr>
<td align="right">Country:</td>
<td><input size="60" name="country" value="<?php echo $data["country"]; ?>" style="width: 100%;" /></td>
</tr>
<tr>
<td align="right">Postal Code:</td>
<td><input size="13" name="postal_code" value="<?php echo $data["postal_code"]; ?>" /></td>
</tr>
<tr>
<td align="right">Contact Firstname:</td>
<td><input size="60" name="contact_first_name" value="<?php echo $data["contact_first_name"]; ?>" style="width: 100%;" /></td>
</tr>
<tr>
<td align="right">Contact Lastname:</td>
<td><input size="60" name="contact_last_name" value="<?php echo $data["contact_last_name"]; ?>" style="width: 100%;" /></td>
</tr>
<tr>
<td align="right">Username:</td>
<td><input size="32" name="username" value="<?php echo $data["username"]; ?>" style="width: 100%;" /></td>
</tr>
<tr>
<td align="right">Contact email:</td>
<td><input size="60" name="contact_email" value="<?php echo $data["contact_email"]; ?>" style="width: 100%;" /></td>
</tr>
<tr>
<td align="right">Phone Number:</td>
<td><input size="20" name="phone_number" value="<?php echo $data["phone_number"]; ?>" style="width: 100%;" /></td>
</tr>
<tr>
<td align="right">Fax Number:</td>
<td><input size="20" name="fax_number" value="<?php echo $data["fax_number"]; ?>" style="width: 100%;" /></td>
</tr>
<tr>
<td align="right">Mobile Number:</td>
<td><input size="20" name="gsm_number" value="<?php echo $data["gsm_number"]; ?>" style="width: 100%;" /></td>
</tr>
<tr>
<td align="right">Website:</td>
<td><input size="60" name="http_url" value="<?php echo $data["http_url"]; ?>" style="width: 100%;" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%" border="0" class="table_bottom_panel">
<tr>
<td align="center">
<input type="submit" name="edit" value="Submit Changes" />
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- include the timesheet face up until the end -->
<?php include("timesheet_face_part_3.inc"); ?>
</td>
</tr>
</table>
</form>
<?php include("footer.inc"); ?>
</body>
</HTML>
<?php
// vim:ai:ts=4:sw=4
?>