File: edit.php

package info (click to toggle)
mediamate 0.9.3.6-5
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,256 kB
  • ctags: 1,071
  • sloc: php: 5,023; sh: 647; sql: 97; makefile: 70
file content (296 lines) | stat: -rw-r--r-- 9,311 bytes parent folder | download | duplicates (3)
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
<?php
/*
 * Copyright 2003-2004 Jamin W. Collins <jcollins@asgardsrealm.net>
 * Copyright 2001-2003 Tony Collins
 *
 * This file is part of Media Mate
 * 
 * Media Mate 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.
 * 
 * Media Mate 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 Media Mate; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 */

// This script shows details on movies and borrowers.
require_once('header.php');

?>

<!-- Some necessary crap to set the page up. -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
   <head>
      <link rel="stylesheet" type="text/css"
         href="themes/<?php echo $global_prefs['theme'];?>.css">
      <script language="javascript" type="text/javascript" src="validate.js">
      </script>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <title>
      
<?php 
echo $global_prefs['edituserdetails'];
?>

      </title>
   </head>
   <body>
      <!-- Center the background canvas on the page -->
      <div align="center">
         <div id="pageborder">
            <!-- The table that everything else goes into -->
            <div align="center">
         
               <a href="index.php">
                  <div id="title">
                  </div>
               </a>

<?php
if ( ($_SESSION['level'] == '3') && (is_numeric($_GET['id'])) ) {
   $id = $_GET['id'];

   $sql = "SELECT * FROM global_users WHERE user_id = ?";
   $result = $mm->dbExec($sql, array($id));
   list($user_id, $admin_level, $user_name, $user_password, $real_name, 
      $address_1, $address_2, $email_address, $user_phone, $jabber_id) 
      = $mm->dbFetchRow($result);
?>

               <br/>
               <p class="subheading">

<?php 
   echo "{$global_text['editdetailsforuser']} - $user_name";
?>

               </p>

<form action="modify.php" method="post">

               <table class="admin">
                  <input type="hidden" name="id" value="<?php echo "$id";?>">
                  <input type="hidden" name="action" value="edituser">
                  <tr>
                     <td align="right" valign="top">
                        <p class="adminlabel">

<?php 
   echo $global_text['realname'], "&nbsp;&nbsp;\n"
?>

                        </p>
                     </td>
                     <td>
                        <input class="admintext" type="text" 
                           name="real_name" size="40" maxlength="40" 
                           value="<?php echo "$real_name";?>">
                        <input type="hidden" name="r_real_name" 
                           value="<?php echo $global_text['realnamemissing'];?>">
                     </td>
                  </tr>
                  <tr>
                     <td align="right" valign="top">
                        <p class="adminlabel">

<?php 
   echo $global_text['address'], "&nbsp;&nbsp;\n";
?>

                        </p>
                     </td>
                     <td>
                        <input class="admintext" type="text" 
                           name="address_1" size="40" maxlength="40" 
                           value="<?php echo "$address_1";?>">
                     </td>
                  </tr>
                  <tr>
                     <td></td>
                     <td>
                        <input class="admintext" type="text" 
                           name="address_2" size="40" maxlength="40" 
                           value="<?php echo "$address_2";?>">
                     </td>
                  </tr>
                  <tr>
                     <td align="right">
                        <p class="adminlabel">

<?php 
   echo $global_text['email'], "&nbsp;&nbsp;\n";
?>

                        </p>
                     </td>
                     <td>
                        <input class="admintext" type="text" 
                           name="email_address" size="40" maxlength="100" 
                           value="<?php echo "$email_address";?>">
                     </td>
                  </tr>
                  <tr>
                     <td align="right">
                        <p class="adminlabel">

<?php 
   echo $global_text['telephone'], "&nbsp;&nbsp;\n";
?>

                        </p>
                     </td>
                     <td>
                        <input class="admintext" type="text" 
                           name="user_phone" size="20" maxlength="20" 
                           value="<?php echo "$user_phone";?>">
                     </td>
                  </tr>
                  <tr>
                     <td align="right">
                        <p class="adminlabel">
                           
<?php 
   echo $global_text['adminlevel'], "&nbsp;&nbsp;\n";
?>

                        </p>
                     </td>
                     <td>
                        <select class="adminlist" name="admin_level">

<?php
   $adminlevel_array = array (1 => "leveloneuser", 2 => "leveltwouser", 
      3 => "levelthreeuser");
   foreach (array_keys($adminlevel_array) as $level) {
      echo "<option class='adminlist' value='$level'";
      if ($admin_level == $level){ 
         echo " SELECTED";
      };
      echo ">";
      echo $global_text["{$adminlevel_array[$level]}"];
      echo "</option>\n";
   };
?>

                        </select>
                     </td>
                  </tr>
                  <tr>
                     <td align="right">
                        <p class="adminlabel">

<?php 
   echo $global_text['jabberid'], "&nbsp;&nbsp;\n";
?>

                        </p>
                     </td>
                     <td align="left">
                        <input class="admintext" type="text" 
                           name="jabber_id" size="40" maxlength="100" 
                           value="<?php echo "$jabber_id";?>">
                     </td>
                  </tr>
               </table>
               <br/>
               <p class="subheading">

<?php 
   echo $global_text['changeuserspass'];
?>

               </p>
               <table class="admin">
                  <tr>
                     <td align="right">
                        <p class="adminlabel">

<?php 
   echo $global_text['password'], "&nbsp;&nbsp;\n";
?>

                        </p>
                     </td>
                     <td align="left">
                        <input class="admintext" type="password" 
                           name="password_1" size="10" maxlength="10">
                     </td>
                  </tr>
                  <tr>
                     <td align="right">
                        <p class="adminlabel">

<?php 
   echo $global_text['confirm'], "&nbsp;&nbsp;\n";
?>

                        </p>
                     </td>
                     <td align="left">
                        <input class="admintext" type="password" 
                           name="password_2" size="10" maxlength="10">
                     </td>
                  </tr>
               </table>
               <br/>

               <table class="admin" cellpadding="5">
                  <tr>
                     <td align="right">
                        <input class="adminbutton" type="button" 
                           value="<?php echo $global_text['savedetails'];?>"
                           onclick="check(form,form.elements.length)">

</form>
                     </td>
                     <td align="left">
                        <form action="details.php">
                           <input type="hidden" name="id" 
                              value="<?php echo "$id";?>">
                           <input class="adminbutton" type="submit" 
                              value="<?php echo $global_text['cancel'];?>">
                        </form>
                     </td>
                     <td>
                        <form action="" method="get" 
                           onSubmit="window.open('help.php?page=edituser','Help', 'width=450,height=350,toobar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1'); return false">
                           <input class="adminbutton" type="submit" 
                              value="<?php echo $global_text['showhelp'];?>">
                        </form>
                     </td>
                  </tr>
               </table>
               
               <br/><br/>


<?php
// End of the actions
};
?>
               
               <a class="returnlink" href="index.php">

<?php 
echo $global_text['returntofront'];
?>

               </a>
            <!-- End of the column that everything else is inside of -->
            </div>

         <!-- End of centering the canvas on the page -->
         </div>
      </div>
   </body>
</html>